How fezairoumaissa100/multi-agent-threat-hunting-system works
This is a Wazuh threat-hunting application: an alert enters a FastAPI/LangGraph investigation, which gathers historical context, conditionally hunts raw logs, and produces a correlated report and risk score. The Next.js dashboard submits alerts and displays streamed progress and results. OpenSearch access is mediated by MCP tools; threat-intelligence checks are an optional capability. The graph follows documented workflow and API relationships; unsampled implementation details are not expanded beyond README-backed capabilities.
Main entry points: workflow.py LangGraph workflow · page.tsx Investigation dashboard · server.py MCP tool server · agent3_context_round1.py Alert history search
Components 24
API and workflow
- FastAPI endpoints
api_server.py - LangGraph workflow
graph/workflow.py - Shared SOC state
graph/state.py
Investigation agents
- Index mapping
agents/agent2_mapping.py - Context questions
agents/agent1_investigation_v2.py - Alert history search
agents/agent3_context_round1.py - Pattern analysis
agents/agent1_investigation_v2.py - Archive hunting
agents/agent3_hunting.py - Evidence correlation
agents/agent4_correlation.py - Investigation report
prompts/report_template.md
Data and integrations
- MCP tool server
mcp/server.py - OpenSearch tools
mcp/opensearch_tools.py - OpenSearch client
mcp/mcp_client.py - OpenSearch
- Threat intelligence tools
mcp/threat_intel_tools.py
Analyst dashboard
- Investigation dashboard
pfainterface/app/page.tsx - Alert input
pfainterface/components/dashboard/alert-input.tsx - Next API routes
pfainterface/app/api/analyse/route.ts - Pipeline progress view
pfainterface/components/dashboard/agent-pipeline.tsx - Pipeline stage display
pfainterface/components/dashboard/pipeline-node.tsx - State handoffs
pfainterface/components/dashboard/pipeline-handoff.tsx - Risk gauge
pfainterface/components/dashboard/risk-gauge.tsx
Other components
- SOC analyst
- AbuseIPDB / VirusTotal
Connections 31
- SOC analyst → Investigation dashboard: submits alert
README.md - Investigation dashboard → Alert input: accepts alert
README.md - Investigation dashboard → Next API routes: requests analysis
README.md - Next API routes → FastAPI endpoints: HTTP and SSE
README.md - FastAPI endpoints → LangGraph workflow: starts workflow
README.md - LangGraph workflow → Index mapping: runs first
graph/workflow.py - LangGraph workflow → Context questions: runs next
graph/workflow.py - LangGraph workflow → Alert history search: runs search
graph/workflow.py - LangGraph workflow → Pattern analysis: analyzes context
graph/workflow.py - LangGraph workflow → Archive hunting: conditionally runs
graph/workflow.py - LangGraph workflow → Evidence correlation: correlates evidence
graph/workflow.py - Context questions → Alert history search: provides questions
README.md - Alert history search → Pattern analysis: provides findings
README.md - Pattern analysis → Archive hunting: provides hunt questions
README.md - Pattern analysis → LangGraph workflow: sets round decision
graph/workflow.py - Archive hunting → Evidence correlation: provides evidence
README.md - Evidence correlation → Investigation report: formats report
README.md - Index mapping → MCP tool server: loads mappings
README.md - Alert history search → MCP tool server: calls search tool
agents/agent3_context_round1.py - Archive hunting → MCP tool server: queries archive
README.md - MCP tool server → OpenSearch tools: registers tools
mcp/server.py - OpenSearch tools → OpenSearch client: gets client
mcp/opensearch_tools.py - OpenSearch client → OpenSearch: connects to
- MCP tool server → Threat intelligence tools: registers tools
mcp/server.py - Threat intelligence tools → AbuseIPDB / VirusTotal: checks reputation
README.md - LangGraph workflow → Shared SOC state: uses shared state
graph/workflow.py - Investigation dashboard → Pipeline progress view: renders progress
README.md - Pipeline progress view → Pipeline stage display: renders stages
pfainterface/components/dashboard/agent-pipeline.tsx - Pipeline progress view → State handoffs: renders handoffs
pfainterface/components/dashboard/agent-pipeline.tsx - Investigation dashboard → Risk gauge: shows score
README.md - FastAPI endpoints → Investigation dashboard: streams events
README.md