Detect Risk Early. Act Decisively. Stay Compliant.
Theia is a production-ready fraud detection platform powered by five specialised AI agents that work together to investigate financial transactions, retrieve evidence and reach a consensus risk verdict, all within a structured 16-phase pipeline.
Most fraud detection tools rely on a single AI model making decisions alone. Theia takes a different approach. Five independent agents each examine a transaction from a distinct angle: threat intelligence, regulatory compliance, historical patterns, entity relationships and behavioural analysis, then cross-validate their findings before producing a final risk score. This is called a Multi-Agent Retrieval-Augmented Generation (MARAG) architecture.
The result is a system that is more accurate, more explainable, and more auditable than conventional approaches.
| Audience | What Theia offers |
|---|---|
| Financial institutions | Real-time fraud scoring with AML/KYC compliance intelligence |
| Compliance teams | Complete audit trails and explainable investigation reports |
| Data scientists | Multi-dataset benchmarking with Precision, Recall, F1, AUC-ROC metrics and advanced machine learning methods |
| Developers | A clean TypeScript codebase with modular architecture and full test coverage |
| Recruiters & evaluators | A working, deployed agentic AI system built on current industry-standard tooling |
Five specialised agents collaborate across a 16-phase pipeline. Each agent contributes an independent assessment based on its area of expertise. Their findings are then aggregated through a weighted consensus mechanism that factors in confidence scores, evidence quality and historical performance. Where agents disagree, a built-in orchestration layer applies predefined conflict-resolution strategies to produce the final verdict.
| Agent | Role |
|---|---|
| TIRA | Threat Intelligence Retrieval Agent |
| RCRA | Regulatory Compliance Retrieval Agent |
| HPRA | Historical Pattern Retrieval Agent |
| ERRA | Entity Relationship Retrieval Agent |
| BARA | Behavioural Analysis Retrieval Agent |
The pipeline runs phases sequentially, in parallel and through convergent execution depending on the stage, so no single bottleneck slows the investigation.
Fraud detection
- Real-time risk scoring on a 0–100 scale across five risk categories
- Multi-agent reasoning and weighted consensus
- Explainable investigation reports with six tabbed sections
- Live pipeline status tracking as each phase completes
Compliance and audit
- AML/KYC intelligence retrieval via RCRA
- Full audit trails for every investigation
- Case management from detection through to resolution
- Automatic error recovery with fallback strategies
Analytics and benchmarking
- Performance metrics: Precision, Recall, F1-Score, AUC-ROC
- Statistical significance testing with p-values and effect sizes
- Multi-dataset comparison across Credit Card, PaySim and MomtSim fraud datasets
- Temporaray downloadable visualisation gallery with six chart types
User experience
- AI-powered chat interface with DeepSearch and Quick Templates
- Agent mode selection: Auto / Fast / Expert / Heavy
- Interface complexity modes: Easy / Focus / Balanced / Expert
- Fully responsive across mobile, tablet and desktop
| Layer | Technology |
|---|---|
| Framework | Preact (React-compatible, lightweight) |
| Language | TypeScript (strict mode) |
| Styling | Tailwind CSS 4.x |
| UI components | Radix UI (accessible, unstyled) |
| State management | Preact Signals |
| Build tool | Vite |
| Testing | Vitest and Testing Library |
| Linter / formatter | Biome |
| AI platform | Relevance AI SDK |
| Multi-agent orchestration | MARAG Workforce |
| Datasets | Credit Card (MLG-ULB), PaySim, MomtSim via Kaggle |
| Requirement | Version |
|---|---|
| Node.js | 18.x LTS or higher (20.x / 22.x recommended) |
| npm | 9.x (included with Node.js) |
| Git | 2.x |
| Relevance AI account | Required for live MARAG agents |
Tip: Use nvm (macOS / Linux) or nvm-windows to manage Node.js versions.
# Clone the repository
git clone https://github.com/techgirldiaries/theia.git
cd theia
# Install all dependencies
npm installCreate a .env file in the project root and fill in the provided Relevance AI credentials:
VITE_REGION=your-region
VITE_PROJECT=your-project-id
VITE_WORKFORCE_ID=your-workforce-id
# or VITE_AGENT_ID=your-agent-idFor assessment: A pre-configured
.envfile with working credentials is included in the submission zip. No manual setup is needed.
npm run devOpen your browser to http://localhost:5173. The app reloads automatically on any file change.
- The Theia header and chat interface are visible
- The MARAG status panel shows all five agents (TIRA, RCRA, HPRA, ERRA, BARA)
- Typing a message triggers the 16-phase pipeline
- The connection status indicator shows Connected
# Run all unit and integration tests
npm test
# Run in watch mode during development
npm run test -- --watch
# Open the browser-based Vitest UI
npm run test:ui
# Generate a coverage report
npm run test:coverageTest files are located in src/hooks/ and src/test/. Coverage output is written to coverage/.
# Compile and bundle for production
npm run build
# Preview the production build locally
npm run preview
# Opens http://localhost:4173For full deployment options and configuration, see DEPLOYMENT.md.
theia-fraud-intelligence/
├── src/
│ ├── ui/ # Presentation layer (layouts, dashboards, charts, dialogs)
│ ├── core/ # Business logic (API services, utilities)
│ ├── state/ # State management (signals, actions, effects, types)
│ ├── config/ # Constants, system prompts, global types
│ ├── components/ # 47 UI components
│ ├── prompts/ # AI prompts and 16-phase pipeline specifications
│ ├── types/ # TypeScript type definitions
│ ├── hooks/ # Custom React/Preact hooks
│ └── test/ # Unit and integration tests
├── docs/ # Full project documentation
├── datasets/ # creditcard.csv, paysim.csv, momtsim.csv
└── README.md
For the complete 60+ file mapping and migration strategy, see PROJECT_STRUCTURE_GUIDE.md.
All limitations below are documented, academically justified and represent common constraints in real-world fraud systems not implementation failures.
| Area | Status | Note |
|---|---|---|
| Live classification metrics | Types defined; live tracking requires verified fraud data | Validated data typically takes 3–7 days to emerge in production systems |
| Confusion matrix | Available in benchmarking; not yet in live dashboard | Visualisation gap only — no algorithmic impact |
| Advanced V2 charts | Planned as future enhancements | Core gallery with six chart types is fully operational |
Critical gaps: None
Major gaps: None
Blockers: None
- Evidence Network Graph: Interactive 3D agent correlation visualisation with conflict resolution indicators
- Performance Radar Chart: Multi-dimensional dataset comparison with overlaid metrics
- Statistical Heatmap: P-value significance matrix and effect size visualisation
- Advanced MARAG Panel: Expandable agent findings with evidence drill-down
| Document | Description |
|---|---|
| Project Structure Guide | Full directory tree |
| PRD | Product requirements and technical specifications |
| Quick Templates | Ready-to-use prompts and template examples |
| Testing Guide | Testing strategies and coverage guidance |
| Deployment Guide | Deployment options and environment configuration |
| Problem | Likely cause | Fix |
|---|---|---|
npm install fails |
Node.js version too old | Upgrade to Node.js 18+ |
Blank page on npm run dev |
.env missing or misconfigured |
Re-check all three VITE_* variables |
| Agents not responding | Invalid API key or region | Verify credentials in the Relevance AI dashboard |
| TypeScript errors | Stale node_modules |
Delete node_modules/ and re-run npm install |
| Port 5173 already in use | Another Vite server running | Run npm run dev -- --port 5174 |
crypto shim errors |
Node version mismatch | Ensure Node.js 18+ and run npx vite --force |
- Project Supervisor: Department of Computing & Technology, University of Bedfordshire
- Relevance AI: Multi-agent workforce platform
- Preact Team: Lightweight React alternative
- Radix UI: Accessible component primitives
- Datasets: Credit Card Fraud by MLG-ULB, PaySim, MomtSim (Kaggle)
GitHub: github.com/techgirldiaries/theia
Issues: GitHub Issues
Discussions: GitHub Discussions
See LICENSE.md for full terms.
