How dronaduladharmateja/ai-email-forensics works
This repository implements an AI-assisted email forensics investigation system. The principal workflow is an API investigation request for a stored case, followed by evidence preparation, privacy-aware retrieval and multi-agent analysis, with a structured result returned to the caller. Other visible product surfaces include case retrieval and an MCP tool server. The README is empty; several modules are unsampled, so their capabilities are represented where supported by the tree and their connections are omitted unless documented by the source index or excerpts.
Main entry points: investigation.py Investigation handler · main.py API application · debater_nodes.py Agent debate · server.py MCP tools
Components 29
API surfaces
- API application
api/main.py - Investigation handler
api/investigation.py - API authentication
api/auth.py - Web client
frontend/js/app.js
Forensic analysis
- Agent debate
ai_engine/multi_agent_debate/debater_nodes.py - Debate trace
ai_engine/multi_agent_debate/debate_trace.py - Evidence scoring
ai_engine/multi_agent_debate/evidence_scoring.py - Prompt isolation
ai_engine/isolation_guard.py - Agent execution guard
ai_engine/agent_execution_guard.py - Dual-LLM isolation
ai_engine/dual_llm_isolation_guard.py - Forensic analyzer
ai_engine/forensic_analyzer.py - Timeline fusion
ai_engine/timeline_fuser.py - Phishing detector
ai_engine/ml_phishing_detector.py - LLM client
ai_engine/llm_client.py
Evidence retrieval
- RAG retrieval
ai_engine/rag/retrieval_engine.py - Query intent
ai_engine/rag/query_intent.py - Hybrid retrieval
ai_engine/rag/hybrid_retrieval.py - Investigation memory
ai_engine/investigation_memory/retrieval.py
Case and privacy data
- Cases repository
database/cases_repository.py - Database access
database/db.py - MySQL connection
database/mysql_connection.py - Privacy pipeline
database/privacy_vector_store/privacy_pipeline.py - Privacy mask
database/privacy_vector_store/privacy_mask.py - Scope matrix
database/privacy_vector_store/scope_matrix.py
Email tools
- MCP tools
mcp_server/server.py - Email parser
parsers/email_parser.py
Other components
- Investigator
- Email evidence
- MCP client
Connections 23
- Investigator → API application: requests investigation
api/main.py - API application → Investigation handler: routes requests
api/main.py - API application → Cases repository: retrieves cases
api/main.py - Investigation handler → Cases repository: loads case
api/investigation.py - Investigation handler → Agent debate: runs analysis
api/investigation.py - Investigation handler → RAG retrieval: retrieves context
api/investigation.py - Investigation handler → Phishing detector: classifies text
api/investigation.py - Agent debate → LLM client: requests completions
ai_engine/multi_agent_debate/debater_nodes.py - Agent debate → Evidence scoring: scores evidence
ai_engine/multi_agent_debate/debater_nodes.py - Agent debate → Prompt isolation: isolates evidence
ai_engine/multi_agent_debate/debater_nodes.py - Forensic analyzer → LLM client: requests analysis
ai_engine/forensic_analyzer.py - Forensic analyzer → Prompt isolation: isolates evidence
ai_engine/forensic_analyzer.py - RAG retrieval → Privacy pipeline: builds private vectors
ai_engine/rag/retrieval_engine.py - Privacy pipeline → Scope matrix: enforces scope
database/privacy_vector_store/privacy_pipeline.py - Privacy pipeline → Privacy mask: masks fields
database/privacy_vector_store/privacy_pipeline.py - Cases repository → Database access: executes queries
database/cases_repository.py - Database access → MySQL connection: uses connection
database/db.py - MCP client → MCP tools: invokes tools
- MCP tools → Email parser: parses email
mcp_server/server.py - Email evidence → Email parser: reads evidence
parsers/email_parser.py - MCP tools → Cases repository: loads case
mcp_server/server.py - MCP tools → Evidence scoring: scores evidence
mcp_server/server.py - API application → Web client: serves API to