# mekalakarthik05/organisational-bank architecture

> Architecture diagram of the GitHub repository mekalakarthik05/organisational-bank, 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/mekalakarthik05/organisational-bank
- Repository: https://github.com/mekalakarthik05/organisational-bank

## Overview

Organizational Brain is a team memory and problem-solving application: users ask a question, the backend combines current organizational state, reference knowledge, and historical experience, then produces grounded guidance. The intended learning loop records outcomes as new Hindsight memories for later retrieval. The README documents this overall workflow; sampled source confirms frontend routing, document upload, current-knowledge search, LLM answering, and Hindsight storage/search. Some backend route wiring and outcome handling are not shown, so those connections follow documented architecture rather than inspected route implementations.

Main entry points: [`backend/app/main.py`](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/App.tsx`](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/App.tsx) (Application shell), [`backend/app/api/chat.py`](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/chat.py) (Chat API), [`backend/app/services/hindsight_rag.py`](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_rag.py) (Current knowledge search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Problem solving"]
  node_learning["Outcome learning<br/>[memory_learning.py]"]
  node_reasoning["Cross-project reasoning<br/>[hindsight_rag.py]"]
end

subgraph group_knowledge["Knowledge layers"]
  node_canonical[("Canonical state<br/>[canonical_org.py]")]
  node_ragservice["Current knowledge search<br/>[hindsight_rag.py]"]
  node_ragstore[("RAG document store<br/>[rag_knowledge.py]")]
  node_hindsight["Historical experience"]
end

subgraph group_backend["Backend services"]
  node_api["FastAPI application<br/>[main.py]"]
  node_chatapi["Chat API<br/>[chat.py]"]
  node_documentsapi["Documents API<br/>[documents.py]"]
  node_memoryapi["Memory API<br/>[memory.py]"]
  node_organizationapi["Organization API<br/>[organization.py]"]
  node_llm["LLM service<br/>[llm.py]"]
end

subgraph group_frontend["User application"]
  node_app["Application shell<br/>[App.tsx]"]
  node_ask["Ask Brain<br/>[AskBrain.tsx]"]
  node_memorylab["Memory Lab<br/>[MemoryLab.tsx]"]
  node_ingest["Knowledge ingest"]
  node_knowledgeui["Knowledge explorer"]
  node_projectsui["Projects and decisions<br/>[ProjectsView.tsx]"]
  node_expertsui["Expert review<br/>[ExpertReview.tsx]"]
end

node_user(("Team member"))
node_hindsightservice[("Hindsight service")]
node_groq["Groq inference"]

node_user -->|"uses"| node_app
node_app -->|"routes questions"| node_ask
node_app -->|"opens memory lab"| node_memorylab
node_app -->|"routes ingestion"| node_ingest
node_app -->|"routes browsing"| node_knowledgeui
node_app -->|"routes projects"| node_projectsui
node_app -->|"routes review"| node_expertsui
node_ask -->|"sends questions"| node_api
node_memorylab -->|"sends queries"| node_api
node_ingest -->|"uploads documents"| node_documentsapi
node_knowledgeui -->|"requests knowledge"| node_api
node_projectsui -->|"requests organization data"| node_organizationapi
node_expertsui -->|"submits review actions"| node_api
node_api -->|"dispatches"| node_chatapi
node_api -->|"dispatches"| node_documentsapi
node_api -->|"dispatches"| node_memoryapi
node_api -->|"dispatches"| node_organizationapi
node_chatapi -->|"reads current state"| node_canonical
node_chatapi -->|"requests retrieval"| node_ragservice
node_chatapi -->|"retrieves experience"| node_hindsight
node_chatapi -->|"coordinates reasoning"| node_reasoning
node_reasoning -->|"requests generation"| node_llm
node_ragservice -->|"searches documents"| node_ragstore
node_ragservice -->|"generates answer"| node_llm
node_llm -.->|"calls inference"| node_groq
node_documentsapi -->|"ingests references"| node_ragservice
node_memoryapi -->|"reads and writes memories"| node_hindsight
node_hindsight -.->|"searches and stores"| node_hindsightservice
node_chatapi -->|"records outcomes"| node_learning
node_learning -->|"stores lessons"| node_hindsight
node_organizationapi -->|"reads organization state"| node_canonical
node_documentsapi -->|"lists documents"| node_ragstore

click node_app "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/App.tsx"
click node_ask "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/AskBrain.tsx"
click node_memorylab "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/MemoryLab.tsx"
click node_ingest "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/KnowledgeIngestLive.tsx"
click node_knowledgeui "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/KnowledgeExplorer.tsx"
click node_projectsui "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/ProjectsView.tsx"
click node_expertsui "https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/ExpertReview.tsx"
click node_api "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/main.py"
click node_chatapi "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/chat.py"
click node_documentsapi "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/documents.py"
click node_memoryapi "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/memory.py"
click node_organizationapi "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/organization.py"
click node_canonical "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/canonical_org.py"
click node_ragservice "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_rag.py"
click node_ragstore "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/rag_knowledge.py"
click node_hindsight "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_client.py"
click node_learning "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/memory_learning.py"
click node_reasoning "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_rag.py"
click node_llm "https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/llm.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_learning,node_reasoning toneBlue
class node_canonical,node_ragservice,node_ragstore,node_hindsight,node_hindsightservice toneAmber
class node_api,node_chatapi,node_documentsapi,node_memoryapi,node_organizationapi,node_llm toneMint
class node_app,node_ask,node_memorylab,node_ingest,node_knowledgeui,node_projectsui,node_expertsui toneRose
class node_user,node_groq toneIndigo
```

## Components

### Problem solving

- [Outcome learning](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/memory_learning.py): `backend/app/services/memory_learning.py`
- [Cross-project reasoning](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_rag.py): `backend/app/services/hindsight_rag.py`

### Knowledge layers

- [Canonical state](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/canonical_org.py): `backend/app/services/canonical_org.py`
- [Current knowledge search](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_rag.py): `backend/app/services/hindsight_rag.py`
- [RAG document store](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/rag_knowledge.py): `backend/app/services/rag_knowledge.py`
- [Historical experience](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/hindsight_client.py): `backend/app/services/hindsight_client.py`

### Backend services

- [FastAPI application](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/main.py): `backend/app/main.py`
- [Chat API](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Documents API](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Memory API](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/memory.py): `backend/app/api/memory.py`
- [Organization API](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/api/organization.py): `backend/app/api/organization.py`
- [LLM service](https://github.com/mekalakarthik05/organisational-bank/blob/main/backend/app/services/llm.py): `backend/app/services/llm.py`

### User application

- [Application shell](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Ask Brain](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/AskBrain.tsx): `frontend/src/views/AskBrain.tsx`
- [Memory Lab](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/MemoryLab.tsx): `frontend/src/views/MemoryLab.tsx`
- [Knowledge ingest](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/KnowledgeIngestLive.tsx): `frontend/src/views/KnowledgeIngestLive.tsx`
- [Knowledge explorer](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/KnowledgeExplorer.tsx): `frontend/src/views/KnowledgeExplorer.tsx`
- [Projects and decisions](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/ProjectsView.tsx): `frontend/src/views/ProjectsView.tsx`
- [Expert review](https://github.com/mekalakarthik05/organisational-bank/blob/main/frontend/src/views/ExpertReview.tsx): `frontend/src/views/ExpertReview.tsx`

### Other components

- **Team member**
- **Hindsight service**
- **Groq inference**

## Connections

- Team member → Application shell: uses
- Application shell → Ask Brain: routes questions
- Application shell → Memory Lab: opens memory lab
- Application shell → Knowledge ingest: routes ingestion
- Application shell → Knowledge explorer: routes browsing
- Application shell → Projects and decisions: routes projects
- Application shell → Expert review: routes review
- Ask Brain → FastAPI application: sends questions
- Memory Lab → FastAPI application: sends queries
- Knowledge ingest → Documents API: uploads documents
- Knowledge explorer → FastAPI application: requests knowledge
- Projects and decisions → Organization API: requests organization data
- Expert review → FastAPI application: submits review actions
- FastAPI application → Chat API: dispatches
- FastAPI application → Documents API: dispatches
- FastAPI application → Memory API: dispatches
- FastAPI application → Organization API: dispatches
- Chat API → Canonical state: reads current state
- Chat API → Current knowledge search: requests retrieval
- Chat API → Historical experience: retrieves experience
- Chat API → Cross-project reasoning: coordinates reasoning
- Cross-project reasoning → LLM service: requests generation
- Current knowledge search → RAG document store: searches documents
- Current knowledge search → LLM service: generates answer
- LLM service → Groq inference: calls inference
- Documents API → Current knowledge search: ingests references
- Memory API → Historical experience: reads and writes memories
- Historical experience → Hindsight service: searches and stores
- Chat API → Outcome learning: records outcomes
- Outcome learning → Historical experience: stores lessons
- Organization API → Canonical state: reads organization state
- Documents API → RAG document store: lists documents
