# agundranvi/forensicaianalyzer architecture

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

- Interactive diagram: https://gitdiagram.com/agundranvi/forensicaianalyzer
- Repository: https://github.com/agundranvi/forensicaianalyzer

## Overview

CICC Forensic AI Analyzer is a local, authenticated forensic-investigation workspace. Investigators sign in, create cases, import and verify exports, inspect normalized artifacts and analytical views, ask evidence-grounded questions, then draft, approve, and export reports. Its main runtime coordinator is the FastAPI application; imports normalize source records, analytics and retrieval support examination, and optional local Ollama supplies AI interpretations. The graph reflects the sampled source and README; some UI and report-route details are documented but not shown in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`app/main.py`](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py) (FastAPI Application), [`app/database.py`](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/database.py) (Case Database), [`app/importing.py`](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/importing.py) (Import Processing), [`ai_engine/evidence_retrieval.py`](https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/evidence_retrieval.py) (Artifact Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_case_intake["Cases and Intake"]
  node_case_management["Case Management<br/>[main.py]"]
  node_evidence_upload["Evidence Intake<br/>[main.py]"]
  node_import_worker["Import Processing<br/>[importing.py]"]
  node_export_adapter["Export Adapter"]
end

subgraph group_examination["Evidence Examination"]
  node_artifact_search["Artifact Search"]
  node_artifact_views["Artifact Views<br/>[main.py]"]
  node_communication_metrics["Communication Metrics<br/>[analytics.py]"]
  node_financial_indicators["Financial Indicators<br/>[analytics.py]"]
  node_endpoint_clusters["Endpoint Clusters<br/>[analytics.py]"]
  node_timeline_analysis["Timeline Analysis<br/>[analytics.py]"]
end

subgraph group_ai_analysis["AI Analysis"]
  node_assistant["Forensic Assistant"]
  node_ollama_transport["Ollama Client<br/>[ollama_client.py]"]
  node_analysis_history["Analysis History<br/>[main.py]"]
end

subgraph group_reporting["Reporting"]
  node_report_workflow["Report Workflow<br/>[main.py]"]
  node_report_renderer["DOCX and PDF<br/>[reporting.py]"]
end

subgraph group_platform["Application Platform"]
  node_web_ui["Web Interface<br/>[app.js]"]
  node_page_templates["Page Templates<br/>[index.html]"]
  node_api_app["FastAPI Application<br/>[main.py]"]
  node_request_security["Request Limits<br/>[security.py]"]
  node_settings["Runtime Configuration<br/>[config.py]"]
  node_relational_store[("Case Database<br/>[database.py]")]
  node_schemas["Request Schemas<br/>[schemas.py]"]
  node_authentication["Authentication<br/>[security.py]"]
end

node_investigator(("Investigator"))
node_local_model{{"Local Ollama"}}

node_investigator -.->|"uses"| node_web_ui
node_web_ui -.->|"sends requests"| node_api_app
node_api_app -->|"routes"| node_case_management
node_api_app -->|"handles uploads"| node_evidence_upload
node_api_app -.->|"limits requests"| node_request_security
node_api_app -->|"uses settings"| node_settings
node_api_app -->|"queries"| node_relational_store
node_api_app -->|"authenticates"| node_authentication
node_api_app -->|"starts imports"| node_import_worker
node_import_worker -->|"parses records"| node_export_adapter
node_import_worker -->|"stores artifacts"| node_relational_store
node_api_app -->|"serves artifacts"| node_artifact_views
node_api_app -->|"retrieves evidence"| node_artifact_search
node_artifact_search -->|"reads artifacts"| node_relational_store
node_api_app -->|"requests analysis"| node_assistant
node_assistant -->|"sends prompt"| node_ollama_transport
node_ollama_transport -->|"calls locally"| node_local_model
node_api_app -->|"records analyses"| node_analysis_history
node_api_app -->|"builds analysis"| node_communication_metrics
node_api_app -.->|"extracts indicators"| node_financial_indicators
node_api_app -.->|"groups endpoints"| node_endpoint_clusters
node_api_app -.->|"serves timeline"| node_timeline_analysis
node_api_app -->|"handles reports"| node_report_workflow
node_report_workflow -.->|"exports reports"| node_report_renderer
node_report_renderer -->|"uses statistics"| node_communication_metrics
node_api_app -->|"validates payloads"| node_schemas
node_relational_store -->|"reads database URL"| node_settings

click node_web_ui "https://github.com/agundranvi/forensicaianalyzer/blob/main/static/app.js"
click node_page_templates "https://github.com/agundranvi/forensicaianalyzer/blob/main/templates/index.html"
click node_api_app "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_request_security "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/security.py"
click node_settings "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/config.py"
click node_relational_store "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/database.py"
click node_case_management "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_evidence_upload "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_import_worker "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/importing.py"
click node_export_adapter "https://github.com/agundranvi/forensicaianalyzer/blob/main/parsers/cellebrite_adapter.py"
click node_artifact_search "https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/evidence_retrieval.py"
click node_artifact_views "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_communication_metrics "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py"
click node_financial_indicators "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py"
click node_endpoint_clusters "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py"
click node_timeline_analysis "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py"
click node_assistant "https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/forensic_assistant.py"
click node_ollama_transport "https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/ollama_client.py"
click node_analysis_history "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_report_workflow "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py"
click node_report_renderer "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/reporting.py"
click node_schemas "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/schemas.py"
click node_authentication "https://github.com/agundranvi/forensicaianalyzer/blob/main/app/security.py"

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_case_management,node_evidence_upload,node_import_worker,node_export_adapter toneBlue
class node_artifact_search,node_artifact_views,node_communication_metrics,node_financial_indicators,node_endpoint_clusters,node_timeline_analysis toneAmber
class node_assistant,node_ollama_transport,node_analysis_history toneMint
class node_report_workflow,node_report_renderer toneRose
class node_web_ui,node_page_templates,node_api_app,node_request_security,node_settings,node_relational_store,node_schemas,node_authentication,node_investigator,node_local_model toneIndigo
```

## Components

### Cases and Intake

- [Case Management](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`
- [Evidence Intake](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`
- [Import Processing](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/importing.py): `app/importing.py`
- [Export Adapter](https://github.com/agundranvi/forensicaianalyzer/blob/main/parsers/cellebrite_adapter.py): `parsers/cellebrite_adapter.py`

### Evidence Examination

- [Artifact Search](https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/evidence_retrieval.py): `ai_engine/evidence_retrieval.py`
- [Artifact Views](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`
- [Communication Metrics](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py): `app/analytics.py`
- [Financial Indicators](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py): `app/analytics.py`
- [Endpoint Clusters](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py): `app/analytics.py`
- [Timeline Analysis](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/analytics.py): `app/analytics.py`

### AI Analysis

- [Forensic Assistant](https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/forensic_assistant.py): `ai_engine/forensic_assistant.py`
- [Ollama Client](https://github.com/agundranvi/forensicaianalyzer/blob/main/ai_engine/ollama_client.py): `ai_engine/ollama_client.py`
- [Analysis History](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`

### Reporting

- [Report Workflow](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`
- [DOCX and PDF](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/reporting.py): `app/reporting.py`

### Application Platform

- [Web Interface](https://github.com/agundranvi/forensicaianalyzer/blob/main/static/app.js): `static/app.js`
- [Page Templates](https://github.com/agundranvi/forensicaianalyzer/blob/main/templates/index.html): `templates/index.html`
- [FastAPI Application](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/main.py): `app/main.py`
- [Request Limits](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/security.py): `app/security.py`
- [Runtime Configuration](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/config.py): `app/config.py`
- [Case Database](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/database.py): `app/database.py`
- [Request Schemas](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/schemas.py): `app/schemas.py`
- [Authentication](https://github.com/agundranvi/forensicaianalyzer/blob/main/app/security.py): `app/security.py`

### Other components

- **Investigator**
- **Local Ollama**

## Connections

- Investigator → Web Interface: uses (evidence: `README.md`)
- Web Interface → FastAPI Application: sends requests (evidence: `README.md`)
- FastAPI Application → Case Management: routes (evidence: `app/main.py`)
- FastAPI Application → Evidence Intake: handles uploads (evidence: `app/main.py`)
- FastAPI Application → Request Limits: limits requests (evidence: `app/main.py`)
- FastAPI Application → Runtime Configuration: uses settings (evidence: `app/main.py`)
- FastAPI Application → Case Database: queries (evidence: `app/main.py`)
- FastAPI Application → Authentication: authenticates (evidence: `app/main.py`)
- FastAPI Application → Import Processing: starts imports (evidence: `app/main.py`)
- Import Processing → Export Adapter: parses records (evidence: `app/importing.py`)
- Import Processing → Case Database: stores artifacts (evidence: `app/importing.py`)
- FastAPI Application → Artifact Views: serves artifacts (evidence: `app/main.py`)
- FastAPI Application → Artifact Search: retrieves evidence (evidence: `app/main.py`)
- Artifact Search → Case Database: reads artifacts (evidence: `ai_engine/evidence_retrieval.py`)
- FastAPI Application → Forensic Assistant: requests analysis (evidence: `app/main.py`)
- Forensic Assistant → Ollama Client: sends prompt (evidence: `ai_engine/forensic_assistant.py`)
- Ollama Client → Local Ollama: calls locally (evidence: `ai_engine/ollama_client.py`)
- FastAPI Application → Analysis History: records analyses (evidence: `app/main.py`)
- FastAPI Application → Communication Metrics: builds analysis (evidence: `app/main.py`)
- FastAPI Application → Financial Indicators: extracts indicators (evidence: `app/main.py`)
- FastAPI Application → Endpoint Clusters: groups endpoints (evidence: `app/main.py`)
- FastAPI Application → Timeline Analysis: serves timeline (evidence: `app/main.py`)
- FastAPI Application → Report Workflow: handles reports (evidence: `app/main.py`)
- Report Workflow → DOCX and PDF: exports reports (evidence: `app/main.py`)
- DOCX and PDF → Communication Metrics: uses statistics (evidence: `app/reporting.py`)
- FastAPI Application → Request Schemas: validates payloads (evidence: `app/main.py`)
- Case Database → Runtime Configuration: reads database URL (evidence: `app/database.py`)
