# nagu2k15/intellect architecture

> Architecture diagram of the GitHub repository nagu2k15/intellect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagu2k15/intellect
- Repository: https://github.com/nagu2k15/intellect

## Overview

This is a prototype FinServ regulatory-compliance copilot. Users browse a synthetic regulatory corpus or submit questions, transactions, circular changes, and report populations through a web UI; the backend returns cited, risk-rated, impact, or audit-report results. The documented runtime separates API routing, deterministic domain services, synthetic data, and optional LLM narration. The supplied tree and source excerpts omit the README-described `app/` and `static/` files, so component links below rely on README statements rather than inspected implementation.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_web["Copilot web UI"]
  node_persona["Persona display"]
end

subgraph group_api["API layer"]
  node_api_router["Copilot API"]
  node_app["FastAPI application"]
  node_schemas["Request/response models"]
end

subgraph group_domain["Compliance services"]
  node_qa["Regulatory Q&amp;A"]
  node_retrieval["Clause retrieval"]
  node_screening["Transaction screening"]
  node_impact["Change impact analysis"]
  node_report["Compliance reporting"]
end

subgraph group_data["Synthetic data"]
  node_corpus[("Regulatory corpus")]
  node_policies[("Internal policies")]
  node_transactions[("Sample transactions")]
  node_circulars[("Circular amendments")]
  node_prior[("Prior-period baseline")]
end

subgraph group_narration["Optional narration"]
  node_llm["Claude narration"]
end

node_user(("Compliance user"))
node_anthropic["Anthropic API"]

node_user -->|"uses"| node_web
node_web -->|"submits requests"| node_api_router
node_app -->|"mounts endpoints"| node_api_router
node_api_router -.->|"uses models"| node_schemas
node_api_router -->|"routes Q&amp;A"| node_qa
node_api_router -->|"routes screening"| node_screening
node_api_router -->|"routes impact analysis"| node_impact
node_api_router -->|"routes reporting"| node_report
node_qa -->|"retrieves clauses"| node_retrieval
node_retrieval -->|"searches clauses"| node_corpus
node_screening -->|"screens samples"| node_transactions
node_impact -->|"compares amendments"| node_circulars
node_impact -->|"matches policies"| node_policies
node_report -->|"computes trend deltas"| node_prior
node_report -.->|"reports transaction findings"| node_screening
node_qa -->|"requests narration"| node_llm
node_llm -.->|"calls optionally"| node_anthropic
node_persona -->|"controls detail"| node_web
node_web -->|"shows results"| node_user

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_persona,node_user toneBlue
class node_api_router,node_app,node_schemas toneAmber
class node_qa,node_retrieval,node_screening,node_impact,node_report,node_anthropic toneMint
class node_corpus,node_policies,node_transactions,node_circulars,node_prior toneRose
class node_llm toneIndigo
```

## Components

### User interface

- **Copilot web UI**
- **Persona display**

### API layer

- **Copilot API**
- **FastAPI application**
- **Request/response models**

### Compliance services

- **Regulatory Q&A**
- **Clause retrieval**
- **Transaction screening**
- **Change impact analysis**
- **Compliance reporting**

### Synthetic data

- **Regulatory corpus**
- **Internal policies**
- **Sample transactions**
- **Circular amendments**
- **Prior-period baseline**

### Optional narration

- **Claude narration**

### Other components

- **Compliance user**
- **Anthropic API**

## Connections

- Compliance user → Copilot web UI: uses (evidence: `README.md`)
- Copilot web UI → Copilot API: submits requests (evidence: `README.md`)
- FastAPI application → Copilot API: mounts endpoints (evidence: `README.md`)
- Copilot API → Request/response models: uses models
- Copilot API → Regulatory Q&A: routes Q&A (evidence: `README.md`)
- Copilot API → Transaction screening: routes screening (evidence: `README.md`)
- Copilot API → Change impact analysis: routes impact analysis (evidence: `README.md`)
- Copilot API → Compliance reporting: routes reporting (evidence: `README.md`)
- Regulatory Q&A → Clause retrieval: retrieves clauses (evidence: `README.md`)
- Clause retrieval → Regulatory corpus: searches clauses (evidence: `README.md`)
- Transaction screening → Sample transactions: screens samples (evidence: `README.md`)
- Change impact analysis → Circular amendments: compares amendments (evidence: `README.md`)
- Change impact analysis → Internal policies: matches policies (evidence: `README.md`)
- Compliance reporting → Prior-period baseline: computes trend deltas (evidence: `README.md`)
- Compliance reporting → Transaction screening: reports transaction findings
- Regulatory Q&A → Claude narration: requests narration (evidence: `README.md`)
- Claude narration → Anthropic API: calls optionally (evidence: `README.md`)
- Persona display → Copilot web UI: controls detail (evidence: `README.md`)
- Copilot web UI → Compliance user: shows results (evidence: `README.md`)
