How codebyshambhavi/pramana-dfir works
PRAMANA is a local-first digital-forensics investigation platform: investigators intake artifacts, preserve their hashes and custody, extract normalized events, correlate and analyze those events, then review traceable findings and produce reports. The backend exposes case, evidence, analysis, integrity, graph and reporting capabilities; the React console presents the investigation workflow. The README documents the principal domain stages, while sampled source confirms key API, persistence, parser, intelligence and UI connections. Some router and frontend data wiring was not sampled, so those links are marked unverified or omitted.
Main entry points: models.py Normalized events · main.py REST API · evidence.py Evidence API · parsers Format parsers
Components 34
Evidence intake
- SHA-256 intake
evidence-engine/intake/hashing.py - Custody log
evidence-engine/intake/custody.py - Format parsers
evidence-engine/parsers - Event provenance
evidence-engine/parsers/provenance.py - Timestamp handling
evidence-engine/parsers/timestamps.py - Event vocabulary
evidence-engine/parsers/vocabulary.py
Event analysis
- Event normalization
intelligence/common.py - Entity extraction
intelligence/entities.py - Cross-source correlation
intelligence/correlate.py - Timeline
intelligence/timeline.py - Claim generation
intelligence/claims.py - Anomaly detection
intelligence/anomalies.py - Contradiction detection
intelligence/contradictions.py - Authenticity assessment
intelligence/authenticity.py - Hypothesis engine
intelligence/hyp/engine.py
Backend services
- Evidence API
backend/app/routers/evidence.py - Analysis pipeline
backend/app/services/pipeline.py - Normalized events
backend/app/db/models.py - Analysis runs API
backend/app/routers/claims.py - Run orchestration
backend/app/services/runs.py - Run persistence
backend/app/db/runs.py - Claim persistence
backend/app/db/claims.py - Case management
backend/app/routers/cases.py - Evidence graph
backend/app/graph/builder.py - Integrity checks
backend/app/routers/integrity.py - Finding review
backend/app/routers/findings.py - Evidence lineage
backend/app/reports/lineage.py - Investigation reports
backend/app/reports/export_pdf.py - REST API
backend/app/main.py
Investigator console
- Evidence Vault
frontend/src/pages/EvidenceVault.tsx - Typed API client
frontend/src/api/client.ts - Investigation workspace
frontend/src/pages/InvestigationWorkspace.tsx
Other components
- Investigator
- Digital artifacts
Connections 38
- Investigator → Evidence Vault: submits evidence
README.md - Digital artifacts → Evidence API: uploads
README.md - Evidence Vault → Evidence API: requests intake
- Evidence API → SHA-256 intake: hashes evidence
README.md - Evidence API → Custody log: records custody
README.md - Evidence API → Format parsers: extracts events
- Format parsers → Event provenance: adds provenance
evidence-engine/parsers/chat_json.py - Format parsers → Timestamp handling: normalizes times
evidence-engine/parsers/chat_json.py - Format parsers → Event vocabulary: maps vocabulary
evidence-engine/parsers/chat_json.py - Format parsers → Analysis pipeline: provides parsers
backend/app/services/pipeline.py - Analysis pipeline → Normalized events: persists events
- Normalized events → Event normalization: supplies event data
README.md - Event normalization → Cross-source correlation: normalizes input
intelligence/correlate.py - Cross-source correlation → Entity extraction: extracts entities
intelligence/correlate.py - Normalized events → Timeline: orders by time
README.md - Cross-source correlation → Claim generation: generates claims
intelligence/claims.py - Normalized events → Anomaly detection: detects patterns
README.md - Normalized events → Contradiction detection: checks conflicts
README.md - Normalized events → Authenticity assessment: assesses images
README.md - Claim generation → Hypothesis engine: evaluates explanations
README.md - Analysis runs API → Run orchestration: creates runs
backend/app/routers/claims.py - Run orchestration → Cross-source correlation: correlates events
backend/app/services/runs.py - Run orchestration → Hypothesis engine: evaluates hypotheses
backend/app/services/runs.py - Run orchestration → Run persistence: stores run
backend/app/services/runs.py - Run orchestration → Claim persistence: stores claims
backend/app/services/runs.py - Case management → Normalized events: serves case events
backend/app/routers/cases.py - Normalized events → Evidence graph: builds relationships
README.md - Integrity checks → Custody log: checks integrity
README.md - Finding review → Investigator: records review
README.md - Investigation reports → Evidence lineage: includes lineage
README.md - Investigator → Investigation workspace: reviews findings
README.md - Investigation workspace → Typed API client: requests analysis
frontend/src/pages/InvestigationWorkspace.tsx - Typed API client → REST API: calls REST API
- REST API → Case management: routes requests
backend/app/main.py - REST API → Analysis runs API: routes requests
backend/app/main.py - REST API → Evidence API: routes requests
backend/app/main.py - REST API → Finding review: routes requests
backend/app/main.py - REST API → Integrity checks: routes requests
backend/app/main.py