# tanmay7264/industrial-knowledge-intelligence architecture

> Architecture diagram of the GitHub repository tanmay7264/industrial-knowledge-intelligence, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tanmay7264/industrial-knowledge-intelligence
- Repository: https://github.com/tanmay7264/industrial-knowledge-intelligence

## Overview

Industrial Brain is an organizational-memory platform for industrial operations. Engineers add operational documents, which are parsed, chunked, enriched with entities, embedded, and indexed in vector and graph stores; they then ask questions or investigate failures and receive evidence-backed answers and action plans. Confirmed feedback can preserve operational knowledge for later use. The README also describes asset, alert, compliance, insight, and knowledge-risk capabilities; unsampled implementations are represented by their existing route or library directories. The excerpts do not establish every subsystem’s internal wiring, so uncertain links are omitted.

Main entry points: [`src/lib/ingest/pipeline.ts`](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/pipeline.ts) (Ingestion pipeline), [`src/app/api`](https://github.com/tanmay7264/industrial-knowledge-intelligence/tree/main/src/app/api) (Operations APIs), [`src/app/api/chat/route.ts`](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/chat/route.ts) (Chat API), [`src/lib/graph/retrieve.ts`](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/graph/retrieve.ts) (Graph retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Engineer experience"]
  node_query_ui["Ask Memory<br/>[query-page.tsx]"]
  node_ingest_ui["Document Intelligence<br/>[page.tsx]"]
  node_command_ui["Command Center<br/>[page.tsx]"]
  node_incident_ui["Failure investigations<br/>[page.tsx]"]
  node_graph_ui["AI reasoning graph<br/>[page.tsx]"]
end

subgraph group_ingestion["Document ingestion"]
  node_ingest_api["Ingestion API<br/>[route.ts]"]
  node_pipeline["Ingestion pipeline<br/>[pipeline.ts]"]
  node_loaders["Document loaders<br/>[index.ts]"]
  node_chunker["Semantic chunking<br/>[chunk.ts]"]
  node_entities["Entity extraction<br/>[entities.ts]"]
end

subgraph group_reasoning["AI reasoning"]
  node_embeddings["Embedding service<br/>[embeddings.ts]"]
  node_chat_api["Chat API<br/>[route.ts]"]
  node_rag_router["RAG routing<br/>[router.ts]"]
  node_rag_retrieve["Evidence retrieval<br/>[retrieve.ts]"]
  node_answer["Answer confidence<br/>[answer.ts]"]
end

subgraph group_operations["Operational intelligence"]
  node_rca["Root-cause analysis<br/>[rca.ts]"]
  node_playbook["Playbook generation<br/>[playbook.ts]"]
  node_feedback_api["Engineer feedback<br/>[route.ts]"]
  node_ops_routes["Operations APIs"]
  node_knowledge_risk["Knowledge risk<br/>[knowledge-risk.ts]"]
end

subgraph group_data["Knowledge stores"]
  node_qdrant_store[("Vector index<br/>[qdrant-store.ts]")]
  node_qdrant_client[("Qdrant<br/>[qdrant.ts]")]
  node_graph_build["Knowledge graph builder<br/>[build.ts]"]
  node_graph_retrieve["Graph retrieval<br/>[retrieve.ts]"]
  node_neo4j[("Neo4j graph<br/>[neo4j.ts]")]
  node_redis[("Redis cache<br/>[redis.ts]")]
end

node_engineer(("Plant engineer"))
node_llm{{"LLM provider"}}

node_engineer -->|"uploads documents"| node_ingest_ui
node_ingest_ui -->|"submits files"| node_ingest_api
node_ingest_api -->|"ingests files"| node_pipeline
node_pipeline -->|"loads documents"| node_loaders
node_pipeline -->|"chunks text"| node_chunker
node_pipeline -->|"extracts entities"| node_entities
node_pipeline -->|"embeds chunks"| node_embeddings
node_pipeline -->|"stores chunks"| node_qdrant_store
node_pipeline -->|"builds graph"| node_graph_build
node_qdrant_store -->|"writes vectors"| node_qdrant_client
node_graph_build -->|"writes graph"| node_neo4j
node_engineer -->|"asks questions"| node_query_ui
node_query_ui -->|"sends query"| node_chat_api
node_chat_api -->|"embeds query"| node_embeddings
node_chat_api -->|"routes query"| node_rag_router
node_chat_api -->|"computes confidence"| node_answer
node_chat_api -->|"generates answer"| node_llm
node_chat_api -->|"caches answers"| node_redis
node_rag_router -->|"retrieves evidence"| node_rag_retrieve
node_rag_retrieve -->|"uses graph search"| node_graph_retrieve
node_graph_retrieve -->|"queries graph"| node_neo4j
node_engineer -->|"opens incident"| node_incident_ui
node_incident_ui -->|"loads incident"| node_ops_routes
node_ops_routes -->|"generates RCA"| node_rca
node_ops_routes -->|"retrieves lessons"| node_graph_retrieve
node_engineer -.->|"requests playbook"| node_playbook
node_playbook -->|"generates steps"| node_llm
node_engineer -->|"confirms steps"| node_feedback_api
node_feedback_api -->|"stores feedback"| node_redis
node_engineer -->|"views plant status"| node_command_ui
node_command_ui -->|"loads operations data"| node_ops_routes
node_ops_routes -->|"builds risk report"| node_knowledge_risk
node_ops_routes -->|"queries incidents"| node_graph_retrieve
node_ops_routes -->|"counts documents"| node_qdrant_client
node_engineer -->|"explores evidence"| node_graph_ui

click node_query_ui "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/query/query-page.tsx"
click node_ingest_ui "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/ingest/page.tsx"
click node_command_ui "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/command/page.tsx"
click node_incident_ui "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/incidents/%5Bid%5D/page.tsx"
click node_graph_ui "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/graph/page.tsx"
click node_ingest_api "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/ingest/route.ts"
click node_pipeline "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/pipeline.ts"
click node_loaders "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/loaders/index.ts"
click node_chunker "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/chunk.ts"
click node_entities "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/entities.ts"
click node_embeddings "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ai/embeddings.ts"
click node_chat_api "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/chat/route.ts"
click node_rag_router "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/router.ts"
click node_rag_retrieve "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/retrieve.ts"
click node_answer "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/answer.ts"
click node_rca "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/rca.ts"
click node_playbook "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/playbook.ts"
click node_feedback_api "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/feedback/route.ts"
click node_ops_routes "https://github.com/tanmay7264/industrial-knowledge-intelligence/tree/main/src/app/api"
click node_knowledge_risk "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/knowledge-risk.ts"
click node_qdrant_store "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/qdrant-store.ts"
click node_qdrant_client "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/qdrant.ts"
click node_graph_build "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/graph/build.ts"
click node_graph_retrieve "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/graph/retrieve.ts"
click node_neo4j "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/neo4j.ts"
click node_redis "https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/redis.ts"

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_query_ui,node_ingest_ui,node_command_ui,node_incident_ui,node_graph_ui toneBlue
class node_ingest_api,node_pipeline,node_loaders,node_chunker,node_entities toneAmber
class node_embeddings,node_chat_api,node_rag_router,node_rag_retrieve,node_answer toneMint
class node_rca,node_playbook,node_feedback_api,node_ops_routes,node_knowledge_risk toneRose
class node_qdrant_store,node_qdrant_client,node_graph_build,node_graph_retrieve,node_neo4j,node_redis,node_engineer,node_llm toneIndigo
```

## Components

### Engineer experience

- [Ask Memory](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/query/query-page.tsx): `src/app/query/query-page.tsx`
- [Document Intelligence](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/ingest/page.tsx): `src/app/ingest/page.tsx`
- [Command Center](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/command/page.tsx): `src/app/command/page.tsx`
- [Failure investigations](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/incidents/%5Bid%5D/page.tsx): `src/app/incidents/[id]/page.tsx`
- [AI reasoning graph](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/graph/page.tsx): `src/app/graph/page.tsx`

### Document ingestion

- [Ingestion API](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/ingest/route.ts): `src/app/api/ingest/route.ts`
- [Ingestion pipeline](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/pipeline.ts): `src/lib/ingest/pipeline.ts`
- [Document loaders](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/loaders/index.ts): `src/lib/ingest/loaders/index.ts`
- [Semantic chunking](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/chunk.ts): `src/lib/ingest/chunk.ts`
- [Entity extraction](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/entities.ts): `src/lib/ingest/entities.ts`

### AI reasoning

- [Embedding service](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ai/embeddings.ts): `src/lib/ai/embeddings.ts`
- [Chat API](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`
- [RAG routing](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/router.ts): `src/lib/rag/router.ts`
- [Evidence retrieval](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/retrieve.ts): `src/lib/rag/retrieve.ts`
- [Answer confidence](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/rag/answer.ts): `src/lib/rag/answer.ts`

### Operational intelligence

- [Root-cause analysis](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/rca.ts): `src/lib/agents/rca.ts`
- [Playbook generation](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/playbook.ts): `src/lib/agents/playbook.ts`
- [Engineer feedback](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/app/api/feedback/route.ts): `src/app/api/feedback/route.ts`
- [Operations APIs](https://github.com/tanmay7264/industrial-knowledge-intelligence/tree/main/src/app/api): `src/app/api`
- [Knowledge risk](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/agents/knowledge-risk.ts): `src/lib/agents/knowledge-risk.ts`

### Knowledge stores

- [Vector index](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/ingest/qdrant-store.ts): `src/lib/ingest/qdrant-store.ts`
- [Qdrant](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/qdrant.ts): `src/lib/clients/qdrant.ts`
- [Knowledge graph builder](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/graph/build.ts): `src/lib/graph/build.ts`
- [Graph retrieval](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/graph/retrieve.ts): `src/lib/graph/retrieve.ts`
- [Neo4j graph](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/neo4j.ts): `src/lib/clients/neo4j.ts`
- [Redis cache](https://github.com/tanmay7264/industrial-knowledge-intelligence/blob/main/src/lib/clients/redis.ts): `src/lib/clients/redis.ts`

### Other components

- **Plant engineer**
- **LLM provider**

## Connections

- Plant engineer → Document Intelligence: uploads documents
- Document Intelligence → Ingestion API: submits files
- Ingestion API → Ingestion pipeline: ingests files
- Ingestion pipeline → Document loaders: loads documents
- Ingestion pipeline → Semantic chunking: chunks text
- Ingestion pipeline → Entity extraction: extracts entities
- Ingestion pipeline → Embedding service: embeds chunks
- Ingestion pipeline → Vector index: stores chunks
- Ingestion pipeline → Knowledge graph builder: builds graph
- Vector index → Qdrant: writes vectors
- Knowledge graph builder → Neo4j graph: writes graph
- Plant engineer → Ask Memory: asks questions
- Ask Memory → Chat API: sends query
- Chat API → Embedding service: embeds query
- Chat API → RAG routing: routes query
- Chat API → Answer confidence: computes confidence
- Chat API → LLM provider: generates answer
- Chat API → Redis cache: caches answers
- RAG routing → Evidence retrieval: retrieves evidence
- Evidence retrieval → Graph retrieval: uses graph search
- Graph retrieval → Neo4j graph: queries graph
- Plant engineer → Failure investigations: opens incident
- Failure investigations → Operations APIs: loads incident
- Operations APIs → Root-cause analysis: generates RCA
- Operations APIs → Graph retrieval: retrieves lessons
- Plant engineer → Playbook generation: requests playbook
- Playbook generation → LLM provider: generates steps
- Plant engineer → Engineer feedback: confirms steps
- Engineer feedback → Redis cache: stores feedback
- Plant engineer → Command Center: views plant status
- Command Center → Operations APIs: loads operations data
- Operations APIs → Knowledge risk: builds risk report
- Operations APIs → Graph retrieval: queries incidents
- Operations APIs → Qdrant: counts documents
- Plant engineer → AI reasoning graph: explores evidence
