# sriganesh-123/kairix-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/sriganesh-123/kairix-v2
- Repository: https://github.com/sriganesh-123/kairix-v2

## Overview

KAIRIX turns legacy COBOL, SQL, and SSIS artifacts into evidence-backed knowledge packages, indexes them in Neo4j and Qdrant, and supports analyst investigation through a Streamlit workbench. The graph preserves the documented seven-stage extraction workflow and the separate graph, vector, and query branches. Some subsystem relationships are based on the README rather than sampled implementation; those evidence limits are reflected in the cited paths.

Main entry points: [`knowledge_engineering_agent/services/reconciliation_engine.py`](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/reconciliation_engine.py) (Reconciliation), [`vector_layer/vector_ingestion.py`](https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/vector_ingestion.py) (Vector ingestion), [`parsers`](https://github.com/sriganesh-123/kairix-v2/tree/main/parsers) (Deterministic parsers), [`knowledge_engineering_agent/services/artifact_reviewer.py`](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/artifact_reviewer.py) (Artifact review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Legacy inputs"]
  node_legacy["Legacy artifacts"]
end

subgraph group_engineering["Knowledge engineering"]
  node_classify["Source classification"]
  node_parse["Deterministic parsers"]
  node_evidence["Line evidence<br/>[parser_evidence.py]"]
  node_review["Artifact review"]
  node_extract["Knowledge extraction"]
  node_reconcile["Reconciliation"]
  node_canonical["Canonical packages"]
  node_llm["LLM provider<br/>[base.py]"]
end

subgraph group_knowledge["Knowledge stores"]
  node_graphloader["Graph loader<br/>[graph_loader.py]"]
  node_discovery["Relationship discovery"]
  node_neo4j[("Neo4j graph<br/>[neo4j_client.py]")]
  node_ingestion["Vector ingestion"]
  node_embedder["Embedding model<br/>[embedder.py]"]
  node_qdrant[("Qdrant index")]
end

subgraph group_investigation["Investigation"]
  node_agent["Investigation agent<br/>[agent.py]"]
  node_structured["Structured extraction"]
end

subgraph group_workbench["Analyst workbench"]
  node_app["Streamlit app<br/>[app.py]"]
  node_investigation_ui["Investigation view<br/>[investigation.py]"]
  node_investigation_service["Investigation service"]
  node_pipeline_ui["Pipeline view<br/>[pipeline.py]"]
  node_pipeline_service["Pipeline service"]
  node_source_service["Source service<br/>[source_service.py]"]
end

node_analyst(("Analyst"))

node_legacy -->|"classifies"| node_classify
node_classify -->|"routes to"| node_parse
node_parse -->|"builds evidence"| node_evidence
node_evidence -->|"supports review"| node_review
node_review -->|"informs"| node_extract
node_extract -->|"reconciles with"| node_reconcile
node_parse -->|"supplies parser facts"| node_reconcile
node_reconcile -->|"builds package"| node_canonical
node_review -->|"uses"| node_llm
node_extract -->|"uses"| node_llm
node_reconcile -->|"requests completion"| node_llm
node_canonical -->|"loads package"| node_graphloader
node_graphloader -->|"writes graph"| node_neo4j
node_graphloader -->|"precedes matching"| node_discovery
node_canonical -->|"indexes package"| node_ingestion
node_legacy -->|"chunks source"| node_ingestion
node_ingestion -->|"creates embeddings"| node_embedder
node_ingestion -->|"upserts vectors"| node_qdrant
node_analyst -->|"asks question"| node_investigation_ui
node_app -->|"routes to"| node_investigation_ui
node_app -->|"routes to"| node_pipeline_ui
node_investigation_ui -->|"calls"| node_investigation_service
node_investigation_service -->|"queries"| node_agent
node_investigation_service -->|"extracts sections"| node_structured
node_agent -->|"traverses graph"| node_neo4j
node_agent -->|"searches vectors"| node_qdrant
node_pipeline_ui -->|"starts pipelines"| node_pipeline_service
node_pipeline_ui -->|"lists source files"| node_source_service

click node_classify "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/source_classifier.py"
click node_parse "https://github.com/sriganesh-123/kairix-v2/tree/main/parsers"
click node_evidence "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/parser_evidence.py"
click node_review "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/artifact_reviewer.py"
click node_extract "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/knowledge_extractor.py"
click node_reconcile "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/reconciliation_engine.py"
click node_canonical "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/canonical_builder.py"
click node_llm "https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/llm/base.py"
click node_graphloader "https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/graph_loader.py"
click node_discovery "https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/relationship_discovery_agent.py"
click node_neo4j "https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/neo4j_client.py"
click node_ingestion "https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/vector_ingestion.py"
click node_embedder "https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/embedder.py"
click node_qdrant "https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/qdrant_client_wrapper.py"
click node_agent "https://github.com/sriganesh-123/kairix-v2/blob/main/investigation_agent/agent.py"
click node_structured "https://github.com/sriganesh-123/kairix-v2/blob/main/investigation_agent/structured_extractor.py"
click node_app "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/app.py"
click node_investigation_ui "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/views/investigation.py"
click node_investigation_service "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/investigation_service.py"
click node_pipeline_ui "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/views/pipeline.py"
click node_pipeline_service "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/pipeline_service.py"
click node_source_service "https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/source_service.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_legacy toneBlue
class node_classify,node_parse,node_evidence,node_review,node_extract,node_reconcile,node_canonical,node_llm toneAmber
class node_graphloader,node_discovery,node_neo4j,node_ingestion,node_embedder,node_qdrant toneMint
class node_agent,node_structured toneRose
class node_app,node_investigation_ui,node_investigation_service,node_pipeline_ui,node_pipeline_service,node_source_service,node_analyst toneIndigo
```

## Components

### Legacy inputs

- **Legacy artifacts**

### Knowledge engineering

- [Source classification](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/source_classifier.py): `knowledge_engineering_agent/services/source_classifier.py`
- [Deterministic parsers](https://github.com/sriganesh-123/kairix-v2/tree/main/parsers): `parsers`
- [Line evidence](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/parser_evidence.py): `knowledge_engineering_agent/services/parser_evidence.py`
- [Artifact review](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/artifact_reviewer.py): `knowledge_engineering_agent/services/artifact_reviewer.py`
- [Knowledge extraction](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/knowledge_extractor.py): `knowledge_engineering_agent/services/knowledge_extractor.py`
- [Reconciliation](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/reconciliation_engine.py): `knowledge_engineering_agent/services/reconciliation_engine.py`
- [Canonical packages](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/services/canonical_builder.py): `knowledge_engineering_agent/services/canonical_builder.py`
- [LLM provider](https://github.com/sriganesh-123/kairix-v2/blob/main/knowledge_engineering_agent/llm/base.py): `knowledge_engineering_agent/llm/base.py`

### Knowledge stores

- [Graph loader](https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/graph_loader.py): `graph_layer/graph_loader.py`
- [Relationship discovery](https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/relationship_discovery_agent.py): `graph_layer/relationship_discovery_agent.py`
- [Neo4j graph](https://github.com/sriganesh-123/kairix-v2/blob/main/graph_layer/neo4j_client.py): `graph_layer/neo4j_client.py`
- [Vector ingestion](https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/vector_ingestion.py): `vector_layer/vector_ingestion.py`
- [Embedding model](https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/embedder.py): `vector_layer/embedder.py`
- [Qdrant index](https://github.com/sriganesh-123/kairix-v2/blob/main/vector_layer/qdrant_client_wrapper.py): `vector_layer/qdrant_client_wrapper.py`

### Investigation

- [Investigation agent](https://github.com/sriganesh-123/kairix-v2/blob/main/investigation_agent/agent.py): `investigation_agent/agent.py`
- [Structured extraction](https://github.com/sriganesh-123/kairix-v2/blob/main/investigation_agent/structured_extractor.py): `investigation_agent/structured_extractor.py`

### Analyst workbench

- [Streamlit app](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/app.py): `ui/app.py`
- [Investigation view](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/views/investigation.py): `ui/views/investigation.py`
- [Investigation service](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/investigation_service.py): `ui/services/investigation_service.py`
- [Pipeline view](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/views/pipeline.py): `ui/views/pipeline.py`
- [Pipeline service](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/pipeline_service.py): `ui/services/pipeline_service.py`
- [Source service](https://github.com/sriganesh-123/kairix-v2/blob/main/ui/services/source_service.py): `ui/services/source_service.py`

### Other components

- **Analyst**

## Connections

- Legacy artifacts → Source classification: classifies
- Source classification → Deterministic parsers: routes to
- Deterministic parsers → Line evidence: builds evidence
- Line evidence → Artifact review: supports review
- Artifact review → Knowledge extraction: informs
- Knowledge extraction → Reconciliation: reconciles with
- Deterministic parsers → Reconciliation: supplies parser facts (evidence: `knowledge_engineering_agent/services/reconciliation_engine.py`)
- Reconciliation → Canonical packages: builds package
- Artifact review → LLM provider: uses (evidence: `knowledge_engineering_agent/services/artifact_reviewer.py`)
- Knowledge extraction → LLM provider: uses (evidence: `knowledge_engineering_agent/services/knowledge_extractor.py`)
- Reconciliation → LLM provider: requests completion (evidence: `knowledge_engineering_agent/services/reconciliation_engine.py`)
- Canonical packages → Graph loader: loads package
- Graph loader → Neo4j graph: writes graph
- Graph loader → Relationship discovery: precedes matching
- Canonical packages → Vector ingestion: indexes package
- Legacy artifacts → Vector ingestion: chunks source
- Vector ingestion → Embedding model: creates embeddings (evidence: `vector_layer/vector_ingestion.py`)
- Vector ingestion → Qdrant index: upserts vectors (evidence: `vector_layer/vector_ingestion.py`)
- Analyst → Investigation view: asks question
- Streamlit app → Investigation view: routes to (evidence: `ui/app.py`)
- Streamlit app → Pipeline view: routes to (evidence: `ui/app.py`)
- Investigation view → Investigation service: calls (evidence: `ui/views/investigation.py`)
- Investigation service → Investigation agent: queries (evidence: `ui/services/investigation_service.py`)
- Investigation service → Structured extraction: extracts sections (evidence: `ui/services/investigation_service.py`)
- Investigation agent → Neo4j graph: traverses graph
- Investigation agent → Qdrant index: searches vectors
- Pipeline view → Pipeline service: starts pipelines (evidence: `ui/views/pipeline.py`)
- Pipeline view → Source service: lists source files (evidence: `ui/views/pipeline.py`)
