# divyanshgarg25/symantix architecture

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

- Interactive diagram: https://gitdiagram.com/divyanshgarg25/symantix
- Repository: https://github.com/divyanshgarg25/symantix

## Overview

Symantix is an outage-diagnosis service: logs enter through RabbitMQ, are validated and sanitized, then indexed semantically and as service topology. An authenticated engineer request queries vector matches, uses their trace IDs for graph traversal, and streams a diagnosis response. Training utilities prepare triplets and fine-tune embeddings, but they are separate from the runtime ingestion and diagnosis path. The request handler currently streams a simulated model response; the README describes local model inference as the intended capability. Edges cite excerpts or explicit README statements; unsampled model-training subsystems are included without speculative runtime connections.

Main entry points: [`backend/worker.py`](https://github.com/divyanshgarg25/symantix/blob/main/backend/worker.py) (Log worker), [`backend/api.py`](https://github.com/divyanshgarg25/symantix/blob/main/backend/api.py) (Diagnosis router), [`backend/vector_store.py`](https://github.com/divyanshgarg25/symantix/blob/main/backend/vector_store.py) (Vector store), [`backend/graph_store.py`](https://github.com/divyanshgarg25/symantix/blob/main/backend/graph_store.py) (Topology store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Log ingestion"]
  node_simulator["Log simulator"]
  node_broker["RabbitMQ"]
  node_worker["Log worker<br/>[worker.py]"]
  node_event["Log event model<br/>[models.py]"]
  node_extractor["Entity extraction<br/>[graph_extractor.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_retrieval["Hybrid retrieval"]
  node_vector[("Vector store<br/>[vector_store.py]")]
  node_graph[("Topology store<br/>[graph_store.py]")]
  node_errors["Infrastructure errors<br/>[exceptions.py]"]
end

subgraph group_diagnosis["Diagnosis API"]
  node_api["Diagnosis router<br/>[api.py]"]
  node_response["Diagnosis stream<br/>[api.py]"]
end

subgraph group_ml["Embedding training"]
  node_instructions["SRE instruction data"]
  node_triplets["Triplet generator"]
  node_trainer["Embedding trainer<br/>[train.py]"]
  node_qlora["QLoRA fine-tuning<br/>[qlora_finetune.py]"]
end

node_log_source(("Log producers"))
node_engineer(("SRE engineer"))

node_log_source -->|"sends logs"| node_broker
node_simulator -->|"publishes events"| node_broker
node_simulator -->|"creates events"| node_event
node_broker -->|"delivers messages"| node_worker
node_worker -->|"validates payload"| node_event
node_worker -->|"extracts entities"| node_extractor
node_worker -->|"indexes logs"| node_vector
node_worker -->|"stores topology"| node_graph
node_engineer -->|"requests diagnosis"| node_api
node_api -->|"searches semantics"| node_vector
node_api -->|"traverses topology"| node_graph
node_api -->|"streams response"| node_response
node_response -->|"returns diagnosis"| node_engineer
node_trainer -->|"generates training data"| node_triplets
node_worker -->|"reads settings"| node_config
node_api -->|"handles failures"| node_errors
node_vector -->|"raises errors"| node_errors
node_graph -->|"raises errors"| node_errors
node_api -.->|"local model inference"| node_response

click node_simulator "https://github.com/divyanshgarg25/symantix/blob/main/backend/logger_simulator.py"
click node_worker "https://github.com/divyanshgarg25/symantix/blob/main/backend/worker.py"
click node_event "https://github.com/divyanshgarg25/symantix/blob/main/backend/models.py"
click node_extractor "https://github.com/divyanshgarg25/symantix/blob/main/backend/graph_extractor.py"
click node_vector "https://github.com/divyanshgarg25/symantix/blob/main/backend/vector_store.py"
click node_graph "https://github.com/divyanshgarg25/symantix/blob/main/backend/graph_store.py"
click node_api "https://github.com/divyanshgarg25/symantix/blob/main/backend/api.py"
click node_response "https://github.com/divyanshgarg25/symantix/blob/main/backend/api.py"
click node_instructions "https://github.com/divyanshgarg25/symantix/blob/main/core-ml/sre_instructions_generator.py"
click node_triplets "https://github.com/divyanshgarg25/symantix/blob/main/core-ml/dataset_generator.py"
click node_trainer "https://github.com/divyanshgarg25/symantix/blob/main/core-ml/train.py"
click node_qlora "https://github.com/divyanshgarg25/symantix/blob/main/core-ml/qlora_finetune.py"
click node_config "https://github.com/divyanshgarg25/symantix/blob/main/backend/config.py"
click node_errors "https://github.com/divyanshgarg25/symantix/blob/main/backend/exceptions.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_simulator,node_broker,node_worker,node_event,node_extractor,node_config toneBlue
class node_vector,node_graph,node_errors toneAmber
class node_api,node_response toneMint
class node_instructions,node_triplets,node_trainer,node_qlora toneRose
class node_log_source,node_engineer toneIndigo
```

## Components

### Log ingestion

- [Log simulator](https://github.com/divyanshgarg25/symantix/blob/main/backend/logger_simulator.py): `backend/logger_simulator.py`
- **RabbitMQ**
- [Log worker](https://github.com/divyanshgarg25/symantix/blob/main/backend/worker.py): `backend/worker.py`
- [Log event model](https://github.com/divyanshgarg25/symantix/blob/main/backend/models.py): `backend/models.py`
- [Entity extraction](https://github.com/divyanshgarg25/symantix/blob/main/backend/graph_extractor.py): `backend/graph_extractor.py`
- [Runtime settings](https://github.com/divyanshgarg25/symantix/blob/main/backend/config.py): `backend/config.py`

### Hybrid retrieval

- [Vector store](https://github.com/divyanshgarg25/symantix/blob/main/backend/vector_store.py): `backend/vector_store.py`
- [Topology store](https://github.com/divyanshgarg25/symantix/blob/main/backend/graph_store.py): `backend/graph_store.py`
- [Infrastructure errors](https://github.com/divyanshgarg25/symantix/blob/main/backend/exceptions.py): `backend/exceptions.py`

### Diagnosis API

- [Diagnosis router](https://github.com/divyanshgarg25/symantix/blob/main/backend/api.py): `backend/api.py`
- [Diagnosis stream](https://github.com/divyanshgarg25/symantix/blob/main/backend/api.py): `backend/api.py`

### Embedding training

- [SRE instruction data](https://github.com/divyanshgarg25/symantix/blob/main/core-ml/sre_instructions_generator.py): `core-ml/sre_instructions_generator.py`
- [Triplet generator](https://github.com/divyanshgarg25/symantix/blob/main/core-ml/dataset_generator.py): `core-ml/dataset_generator.py`
- [Embedding trainer](https://github.com/divyanshgarg25/symantix/blob/main/core-ml/train.py): `core-ml/train.py`
- [QLoRA fine-tuning](https://github.com/divyanshgarg25/symantix/blob/main/core-ml/qlora_finetune.py): `core-ml/qlora_finetune.py`

### Other components

- **Log producers**
- **SRE engineer**

## Connections

- Log producers → RabbitMQ: sends logs (evidence: `README.md`)
- Log simulator → RabbitMQ: publishes events (evidence: `backend/logger_simulator.py`)
- Log simulator → Log event model: creates events (evidence: `backend/logger_simulator.py`)
- RabbitMQ → Log worker: delivers messages (evidence: `README.md`)
- Log worker → Log event model: validates payload (evidence: `backend/worker.py`)
- Log worker → Entity extraction: extracts entities (evidence: `backend/worker.py`)
- Log worker → Vector store: indexes logs (evidence: `backend/worker.py`)
- Log worker → Topology store: stores topology (evidence: `backend/worker.py`)
- SRE engineer → Diagnosis router: requests diagnosis (evidence: `README.md`)
- Diagnosis router → Vector store: searches semantics (evidence: `backend/api.py`)
- Diagnosis router → Topology store: traverses topology (evidence: `backend/api.py`)
- Diagnosis router → Diagnosis stream: streams response (evidence: `backend/api.py`)
- Diagnosis stream → SRE engineer: returns diagnosis (evidence: `README.md`)
- Embedding trainer → Triplet generator: generates training data (evidence: `core-ml/train.py`)
- Log worker → Runtime settings: reads settings (evidence: `backend/worker.py`)
- Diagnosis router → Infrastructure errors: handles failures (evidence: `backend/api.py`)
- Vector store → Infrastructure errors: raises errors (evidence: `backend/vector_store.py`)
- Topology store → Infrastructure errors: raises errors (evidence: `backend/graph_store.py`)
- Diagnosis router → Diagnosis stream: local model inference (evidence: `backend/api.py`)
