# mohangattu/technova_ai architecture

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

- Interactive diagram: https://gitdiagram.com/mohangattu/technova_ai
- Repository: https://github.com/mohangattu/technova_ai

## Overview

TechNova AI is a company-knowledge assistant with a browser UI and FastAPI API. A user submits a question; the service runs local BM25 passage search or, in Groq mode, a LangGraph workflow that routes or rewrites the query, retrieves and reranks passages, expands parent context, and generates and verifies a grounded answer. The service returns answer text and accessible source excerpts; users can also browse and inspect documents. Graph and direct-pipeline excerpts show orchestration details, but not every subsystem implementation was sampled.

Main entry points: [`app/services/knowledge.py`](https://github.com/mohangattu/technova_ai/blob/main/app/services/knowledge.py) (Knowledge service), [`app/graph/nodes.py`](https://github.com/mohangattu/technova_ai/blob/main/app/graph/nodes.py) (Workflow nodes), [`app/query/query_pipeline.py`](https://github.com/mohangattu/technova_ai/blob/main/app/query/query_pipeline.py) (Query processing), [`app/evaluation/grounded_rag.py`](https://github.com/mohangattu/technova_ai/blob/main/app/evaluation/grounded_rag.py) (Grounded generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface and API"]
  node_browser["Browser app<br/>[app.js]"]
  node_browser_api["API client<br/>[api.js]"]
  node_api["FastAPI endpoints<br/>[main.py]"]
end

subgraph group_knowledge["Knowledge library"]
  node_knowledge_service["Knowledge service<br/>[knowledge.py]"]
  node_document_parser["Document parser<br/>[parser.py]"]
  node_document_chunks["Document chunking<br/>[chunker.py]"]
end

subgraph group_retrieval["Query and retrieval"]
  node_local_search["BM25 search<br/>[bm25.py]"]
  node_query_router["Query routing<br/>[router.py]"]
  node_query_rewriter["Query rewriting<br/>[rewriter.py]"]
  node_query_pipeline["Query processing<br/>[query_pipeline.py]"]
  node_hybrid_search["Hybrid retrieval<br/>[hybrid.py]"]
  node_dense_search["Dense retrieval<br/>[dense.py]"]
  node_reranker["Result reranking<br/>[reranker.py]"]
  node_parent_expansion["Parent expansion"]
  node_context_processor["Context processing<br/>[context_process.py]"]
end

subgraph group_answer["Answer and verification"]
  node_grounded_rag["Grounded generation<br/>[grounded_rag.py]"]
  node_generator["Answer generation<br/>[generator.py]"]
  node_verifier["Grounding verification"]
end

subgraph group_runtime["Runtime services"]
  node_access_control["Access control<br/>[access_control.py]"]
  node_rag_graph["LangGraph workflow<br/>[graph.py]"]
  node_rag_nodes["Workflow nodes<br/>[nodes.py]"]
  node_trace_logger["Trace logging<br/>[trace_logger.py]"]
end

node_user(("Workspace user"))
node_groq{{"Groq model service"}}

node_user -->|"asks or browses"| node_browser
node_browser -->|"uses"| node_browser_api
node_browser_api -->|"calls"| node_api
node_api -->|"delegates"| node_knowledge_service
node_knowledge_service -->|"parses documents"| node_document_parser
node_knowledge_service -->|"creates chunks"| node_document_chunks
node_knowledge_service -->|"checks access"| node_access_control
node_knowledge_service -->|"searches locally"| node_local_search
node_local_search -->|"filters results"| node_access_control
node_knowledge_service -->|"expands local hits"| node_parent_expansion
node_parent_expansion -->|"checks parents"| node_access_control
node_knowledge_service -->|"processes local context"| node_context_processor
node_knowledge_service -->|"initializes AI workflow"| node_rag_graph
node_rag_graph -->|"dispatches"| node_rag_nodes
node_rag_nodes -->|"processes query"| node_query_pipeline
node_query_pipeline -->|"routes"| node_query_router
node_query_pipeline -->|"rewrites when needed"| node_query_rewriter
node_query_router -->|"requests route"| node_groq
node_rag_nodes -->|"retrieves candidates"| node_hybrid_search
node_hybrid_search -->|"combines retrieval"| node_dense_search
node_rag_nodes -->|"reranks results"| node_reranker
node_rag_nodes -->|"expands results"| node_parent_expansion
node_rag_nodes -->|"builds contexts"| node_context_processor
node_rag_nodes -->|"generates and verifies"| node_grounded_rag
node_grounded_rag -->|"generates answer"| node_generator
node_grounded_rag -->|"verifies answer"| node_verifier
node_generator -->|"requests completion"| node_groq
node_rag_graph -->|"records traces"| node_trace_logger

click node_browser "https://github.com/mohangattu/technova_ai/blob/main/frontend/app.js"
click node_browser_api "https://github.com/mohangattu/technova_ai/blob/main/frontend/api.js"
click node_api "https://github.com/mohangattu/technova_ai/blob/main/app/main.py"
click node_knowledge_service "https://github.com/mohangattu/technova_ai/blob/main/app/services/knowledge.py"
click node_document_parser "https://github.com/mohangattu/technova_ai/blob/main/app/ingestion/parser.py"
click node_document_chunks "https://github.com/mohangattu/technova_ai/blob/main/app/ingestion/chunker.py"
click node_access_control "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/access_control.py"
click node_local_search "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/bm25.py"
click node_query_router "https://github.com/mohangattu/technova_ai/blob/main/app/query/router.py"
click node_query_rewriter "https://github.com/mohangattu/technova_ai/blob/main/app/query/rewriter.py"
click node_query_pipeline "https://github.com/mohangattu/technova_ai/blob/main/app/query/query_pipeline.py"
click node_hybrid_search "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/hybrid.py"
click node_dense_search "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/dense.py"
click node_reranker "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/reranker.py"
click node_parent_expansion "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/parent_expansion.py"
click node_context_processor "https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/context_process.py"
click node_rag_graph "https://github.com/mohangattu/technova_ai/blob/main/app/graph/graph.py"
click node_rag_nodes "https://github.com/mohangattu/technova_ai/blob/main/app/graph/nodes.py"
click node_grounded_rag "https://github.com/mohangattu/technova_ai/blob/main/app/evaluation/grounded_rag.py"
click node_generator "https://github.com/mohangattu/technova_ai/blob/main/app/generation/generator.py"
click node_verifier "https://github.com/mohangattu/technova_ai/blob/main/app/evaluation/grounding_verifier.py"
click node_trace_logger "https://github.com/mohangattu/technova_ai/blob/main/app/services/trace_logger.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_browser,node_browser_api,node_api,node_user toneBlue
class node_knowledge_service,node_document_parser,node_document_chunks toneAmber
class node_local_search,node_query_router,node_query_rewriter,node_query_pipeline,node_hybrid_search,node_dense_search,node_reranker,node_parent_expansion,node_context_processor toneMint
class node_grounded_rag,node_generator,node_verifier toneRose
class node_access_control,node_rag_graph,node_rag_nodes,node_trace_logger,node_groq toneIndigo
```

## Components

### User interface and API

- [Browser app](https://github.com/mohangattu/technova_ai/blob/main/frontend/app.js): `frontend/app.js`
- [API client](https://github.com/mohangattu/technova_ai/blob/main/frontend/api.js): `frontend/api.js`
- [FastAPI endpoints](https://github.com/mohangattu/technova_ai/blob/main/app/main.py): `app/main.py`

### Knowledge library

- [Knowledge service](https://github.com/mohangattu/technova_ai/blob/main/app/services/knowledge.py): `app/services/knowledge.py`
- [Document parser](https://github.com/mohangattu/technova_ai/blob/main/app/ingestion/parser.py): `app/ingestion/parser.py`
- [Document chunking](https://github.com/mohangattu/technova_ai/blob/main/app/ingestion/chunker.py): `app/ingestion/chunker.py`

### Query and retrieval

- [BM25 search](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/bm25.py): `app/retrieval/bm25.py`
- [Query routing](https://github.com/mohangattu/technova_ai/blob/main/app/query/router.py): `app/query/router.py`
- [Query rewriting](https://github.com/mohangattu/technova_ai/blob/main/app/query/rewriter.py): `app/query/rewriter.py`
- [Query processing](https://github.com/mohangattu/technova_ai/blob/main/app/query/query_pipeline.py): `app/query/query_pipeline.py`
- [Hybrid retrieval](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/hybrid.py): `app/retrieval/hybrid.py`
- [Dense retrieval](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/dense.py): `app/retrieval/dense.py`
- [Result reranking](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/reranker.py): `app/retrieval/reranker.py`
- [Parent expansion](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/parent_expansion.py): `app/retrieval/parent_expansion.py`
- [Context processing](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/context_process.py): `app/retrieval/context_process.py`

### Answer and verification

- [Grounded generation](https://github.com/mohangattu/technova_ai/blob/main/app/evaluation/grounded_rag.py): `app/evaluation/grounded_rag.py`
- [Answer generation](https://github.com/mohangattu/technova_ai/blob/main/app/generation/generator.py): `app/generation/generator.py`
- [Grounding verification](https://github.com/mohangattu/technova_ai/blob/main/app/evaluation/grounding_verifier.py): `app/evaluation/grounding_verifier.py`

### Runtime services

- [Access control](https://github.com/mohangattu/technova_ai/blob/main/app/retrieval/access_control.py): `app/retrieval/access_control.py`
- [LangGraph workflow](https://github.com/mohangattu/technova_ai/blob/main/app/graph/graph.py): `app/graph/graph.py`
- [Workflow nodes](https://github.com/mohangattu/technova_ai/blob/main/app/graph/nodes.py): `app/graph/nodes.py`
- [Trace logging](https://github.com/mohangattu/technova_ai/blob/main/app/services/trace_logger.py): `app/services/trace_logger.py`

### Other components

- **Workspace user**
- **Groq model service**

## Connections

- Workspace user → Browser app: asks or browses (evidence: `README.md`)
- Browser app → API client: uses (evidence: `frontend/app.js`)
- API client → FastAPI endpoints: calls (evidence: `README.md`)
- FastAPI endpoints → Knowledge service: delegates (evidence: `app/main.py`)
- Knowledge service → Document parser: parses documents (evidence: `app/services/knowledge.py`)
- Knowledge service → Document chunking: creates chunks (evidence: `app/services/knowledge.py`)
- Knowledge service → Access control: checks access (evidence: `app/services/knowledge.py`)
- Knowledge service → BM25 search: searches locally (evidence: `app/services/knowledge.py`)
- BM25 search → Access control: filters results (evidence: `app/retrieval/bm25.py`)
- Knowledge service → Parent expansion: expands local hits (evidence: `app/services/knowledge.py`)
- Parent expansion → Access control: checks parents (evidence: `app/retrieval/parent_expansion.py`)
- Knowledge service → Context processing: processes local context (evidence: `app/services/knowledge.py`)
- Knowledge service → LangGraph workflow: initializes AI workflow (evidence: `app/services/knowledge.py`)
- LangGraph workflow → Workflow nodes: dispatches (evidence: `app/graph/graph.py`)
- Workflow nodes → Query processing: processes query (evidence: `app/graph/nodes.py`)
- Query processing → Query routing: routes (evidence: `app/query/query_pipeline.py`)
- Query processing → Query rewriting: rewrites when needed (evidence: `app/query/query_pipeline.py`)
- Query routing → Groq model service: requests route (evidence: `app/query/router.py`)
- Workflow nodes → Hybrid retrieval: retrieves candidates (evidence: `app/graph/nodes.py`)
- Hybrid retrieval → Dense retrieval: combines retrieval (evidence: `app/retrieval/hybrid.py`)
- Workflow nodes → Result reranking: reranks results (evidence: `app/graph/nodes.py`)
- Workflow nodes → Parent expansion: expands results (evidence: `app/graph/nodes.py`)
- Workflow nodes → Context processing: builds contexts (evidence: `app/graph/nodes.py`)
- Workflow nodes → Grounded generation: generates and verifies (evidence: `app/graph/nodes.py`)
- Grounded generation → Answer generation: generates answer (evidence: `app/evaluation/grounded_rag.py`)
- Grounded generation → Grounding verification: verifies answer (evidence: `app/evaluation/grounded_rag.py`)
- Answer generation → Groq model service: requests completion (evidence: `app/generation/generator.py`)
- LangGraph workflow → Trace logging: records traces (evidence: `app/graph/graph.py`)
