# mahesh-mettireddy/falkortrace architecture

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

- Interactive diagram: https://gitdiagram.com/mahesh-mettireddy/falkortrace
- Repository: https://github.com/mahesh-mettireddy/falkortrace

## Overview

FalkorTrace investigates software incidents by resolving a service, checking whether prior findings remain applicable, tracing dependencies and patches, and verifying candidate causes against approved checks and requirements. It records findings with version fingerprints so later investigations can reuse only compatible results. The FastAPI dashboard and REST endpoints expose triage, graph inspection, remediation, fault injection, and benchmarking; an MCP server offers tool access through HTTP-mounted functions or stdio. The graph engine supports topology analysis, while a lexical baseline provides a comparison. Some subsystems are documented but their source was not sampled, so their links are omitted or grounded in README statements.

Main entry points: [`backend/agent.py`](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py) (Triage Orchestrator), [`backend/mcp_server.py`](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/mcp_server.py) (MCP Server), [`backend/main.py`](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/main.py) (REST API), [`backend/db.py`](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/db.py) (Tenant Graph Store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interfaces"]
  node_fastapi["REST API<br/>[main.py]"]
  node_dashboard["Operations Dashboard<br/>[index.html]"]
  node_mcp["MCP Server<br/>[mcp_server.py]"]
end

subgraph group_investigation["Investigation"]
  node_agent["Triage Orchestrator<br/>[agent.py]"]
  node_entity["Service Resolution<br/>[tools.py]"]
  node_memorygate["Memory Applicability<br/>[tools.py]"]
  node_lineage["Ticket And PRD Scope<br/>[tools.py]"]
  node_traversal["Dependency And Patch Analysis<br/>[tools.py]"]
  node_topology["Topology Algorithms<br/>[tools.py]"]
  node_lexical["Lexical Baseline<br/>[agent.py]"]
  node_benchmark["Ablation Benchmark<br/>[agent.py]"]
end

subgraph group_verification["Verification And Memory"]
  node_checks["Approved Checks<br/>[tools.py]"]
  node_verifier["Sandbox Verifier<br/>[verifier.py]"]
  node_findings["Finding Memory<br/>[tools.py]"]
end

subgraph group_graphdata["Graph Data"]
  node_graphdb[("Tenant Graph Store<br/>[db.py]")]
  node_seeding["Tenant Graph Seeding<br/>[seed.py]"]
end

node_engineer(("Engineer"))

node_engineer -->|"uses"| node_dashboard
node_dashboard -->|"requests triage"| node_fastapi
node_engineer -->|"calls REST"| node_fastapi
node_fastapi -->|"runs triage"| node_agent
node_fastapi -->|"reads graph"| node_graphdb
node_fastapi -->|"seeds tenant"| node_seeding
node_agent -->|"resolves service"| node_entity
node_agent -->|"checks reuse"| node_memorygate
node_agent -->|"inspects scope"| node_lineage
node_agent -->|"traces dependencies"| node_traversal
node_agent -->|"analyzes islands"| node_topology
node_agent -->|"lists checks"| node_checks
node_agent -->|"verifies outputs"| node_verifier
node_agent -->|"records findings"| node_findings
node_agent -->|"compares retrieval"| node_lexical
node_agent -->|"queries graph"| node_graphdb
node_agent -->|"loads dataset"| node_seeding
node_agent -->|"runs scenarios"| node_benchmark
node_mcp -.->|"serves tools"| node_engineer
node_mcp -->|"dispatches tools"| node_entity
node_mcp -->|"evaluates applicability"| node_memorygate
node_mcp -->|"dispatches inspection"| node_lineage
node_mcp -->|"dispatches traversal"| node_traversal
node_mcp -->|"dispatches analysis"| node_topology
node_mcp -->|"dispatches checks"| node_checks
node_mcp -->|"dispatches recording"| node_findings
node_mcp -->|"computes fingerprints"| node_verifier
node_mcp -->|"selects graph"| node_graphdb
node_mcp -->|"validates tenant"| node_seeding
node_graphdb -->|"seeds graph"| node_seeding
node_findings -.->|"stores findings"| node_graphdb
node_checks -.->|"executes fixtures"| node_verifier
node_fastapi -->|"exposes benchmark"| node_benchmark
node_fastapi -->|"remediates graph"| node_graphdb

click node_fastapi "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/main.py"
click node_dashboard "https://github.com/mahesh-mettireddy/falkortrace/blob/main/frontend/index.html"
click node_mcp "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/mcp_server.py"
click node_agent "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py"
click node_entity "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_memorygate "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_lineage "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_traversal "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_topology "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_lexical "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py"
click node_checks "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_verifier "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/verifier.py"
click node_findings "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py"
click node_graphdb "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/db.py"
click node_seeding "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/seed.py"
click node_benchmark "https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.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_fastapi,node_dashboard,node_mcp toneBlue
class node_agent,node_entity,node_memorygate,node_lineage,node_traversal,node_topology,node_lexical,node_benchmark toneAmber
class node_checks,node_verifier,node_findings toneMint
class node_graphdb,node_seeding toneRose
class node_engineer toneIndigo
```

## Components

### Interfaces

- [REST API](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/main.py): `backend/main.py`
- [Operations Dashboard](https://github.com/mahesh-mettireddy/falkortrace/blob/main/frontend/index.html): `frontend/index.html`
- [MCP Server](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/mcp_server.py): `backend/mcp_server.py`

### Investigation

- [Triage Orchestrator](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py): `backend/agent.py`
- [Service Resolution](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Memory Applicability](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Ticket And PRD Scope](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Dependency And Patch Analysis](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Topology Algorithms](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Lexical Baseline](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py): `backend/agent.py`
- [Ablation Benchmark](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/agent.py): `backend/agent.py`

### Verification And Memory

- [Approved Checks](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`
- [Sandbox Verifier](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/verifier.py): `backend/verifier.py`
- [Finding Memory](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/tools.py): `backend/tools.py`

### Graph Data

- [Tenant Graph Store](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/db.py): `backend/db.py`
- [Tenant Graph Seeding](https://github.com/mahesh-mettireddy/falkortrace/blob/main/backend/seed.py): `backend/seed.py`

### Other components

- **Engineer**

## Connections

- Engineer → Operations Dashboard: uses (evidence: `README.md`)
- Operations Dashboard → REST API: requests triage (evidence: `README.md`)
- Engineer → REST API: calls REST (evidence: `README.md`)
- REST API → Triage Orchestrator: runs triage (evidence: `backend/main.py`)
- REST API → Tenant Graph Store: reads graph (evidence: `backend/main.py`)
- REST API → Tenant Graph Seeding: seeds tenant (evidence: `backend/main.py`)
- Triage Orchestrator → Service Resolution: resolves service (evidence: `backend/agent.py`)
- Triage Orchestrator → Memory Applicability: checks reuse (evidence: `backend/agent.py`)
- Triage Orchestrator → Ticket And PRD Scope: inspects scope (evidence: `backend/agent.py`)
- Triage Orchestrator → Dependency And Patch Analysis: traces dependencies (evidence: `backend/agent.py`)
- Triage Orchestrator → Topology Algorithms: analyzes islands (evidence: `backend/agent.py`)
- Triage Orchestrator → Approved Checks: lists checks (evidence: `backend/agent.py`)
- Triage Orchestrator → Sandbox Verifier: verifies outputs (evidence: `backend/agent.py`)
- Triage Orchestrator → Finding Memory: records findings (evidence: `backend/agent.py`)
- Triage Orchestrator → Lexical Baseline: compares retrieval (evidence: `backend/agent.py`)
- Triage Orchestrator → Tenant Graph Store: queries graph (evidence: `backend/agent.py`)
- Triage Orchestrator → Tenant Graph Seeding: loads dataset (evidence: `backend/agent.py`)
- Triage Orchestrator → Ablation Benchmark: runs scenarios (evidence: `backend/agent.py`)
- MCP Server → Engineer: serves tools (evidence: `README.md`)
- MCP Server → Service Resolution: dispatches tools (evidence: `backend/mcp_server.py`)
- MCP Server → Memory Applicability: evaluates applicability (evidence: `backend/mcp_server.py`)
- MCP Server → Ticket And PRD Scope: dispatches inspection (evidence: `backend/mcp_server.py`)
- MCP Server → Dependency And Patch Analysis: dispatches traversal (evidence: `backend/mcp_server.py`)
- MCP Server → Topology Algorithms: dispatches analysis (evidence: `backend/mcp_server.py`)
- MCP Server → Approved Checks: dispatches checks (evidence: `backend/mcp_server.py`)
- MCP Server → Finding Memory: dispatches recording (evidence: `backend/mcp_server.py`)
- MCP Server → Sandbox Verifier: computes fingerprints (evidence: `backend/mcp_server.py`)
- MCP Server → Tenant Graph Store: selects graph (evidence: `backend/mcp_server.py`)
- MCP Server → Tenant Graph Seeding: validates tenant (evidence: `backend/mcp_server.py`)
- Tenant Graph Store → Tenant Graph Seeding: seeds graph (evidence: `backend/db.py`)
- Finding Memory → Tenant Graph Store: stores findings
- Approved Checks → Sandbox Verifier: executes fixtures
- REST API → Ablation Benchmark: exposes benchmark (evidence: `README.md`)
- REST API → Tenant Graph Store: remediates graph (evidence: `backend/main.py`)
