# vishalm342/agentic-research-assistant architecture

> Architecture diagram of the GitHub repository vishalm342/agentic-research-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishalm342/agentic-research-assistant
- Repository: https://github.com/vishalm342/agentic-research-assistant

## Overview

Arbor is a signed-in research application: users submit a constrained question, receive streamed progress and a citation-grounded knowledge tree, inspect sources/evidence, and expand a selected branch. The graph includes the main workflow, account/session lifecycle, retrieval/indexing, and frontend exploration. Several backend subsystems are represented from README capabilities and source-index references rather than inspected implementation; uncertain links are omitted.

Main entry points: [`backend/app/api/routes/research.py`](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/api/routes/research.py) (Research API), [`frontend/src/state/workspace.tsx`](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/state/workspace.tsx) (Workspace state), [`backend/app/workflow/graph.py`](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/graph.py) (LangGraph workflow), [`frontend/src/api/client.ts`](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/api/client.ts) (API and SSE client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Research workspace"]
  node_workspace["Workspace state<br/>[workspace.tsx]"]
  node_composer["Question composer<br/>[Composer.tsx]"]
  node_sessionview["Tree and citations<br/>[SessionView.tsx]"]
  node_inspector["Evidence inspector<br/>[Inspector.tsx]"]
  node_sidebar["Session history<br/>[Sidebar.tsx]"]
  node_tree["Tree grounding<br/>[tree.ts]"]
  node_api_client["API and SSE client<br/>[client.ts]"]
end

subgraph group_api["API and identity"]
  node_firebase_client["Firebase sign-in<br/>[firebase.ts]"]
  node_routes["Research API<br/>[research.py]"]
  node_auth_verify["Token verification<br/>[firebase.py]"]
  node_contracts["Research contracts<br/>[contracts.py]"]
end

subgraph group_research["Research workflow"]
  node_workflow["LangGraph workflow<br/>[graph.py]"]
  node_budget["Research budget<br/>[research_budget.py]"]
  node_model["Synthesis and critique<br/>[model.py]"]
  node_organizer["Tree organizer<br/>[expansion.py]"]
  node_branch["Branch expansion"]
  node_progress["Progress events<br/>[progress.py]"]
end

subgraph group_evidence["Evidence retrieval"]
  node_retrieval_service["Search and extraction<br/>[service.py]"]
  node_search_providers["Search providers<br/>[providers.py]"]
  node_embed["Voyage embeddings<br/>[embeddings.py]"]
  node_index[("Chroma evidence index<br/>[chroma.py]")]
  node_chroma[("ChromaDB")]
end

subgraph group_storage["Session and index"]
  node_mongo_repo["Session repository<br/>[repository.py]"]
  node_session_models["Session records<br/>[models.py]"]
  node_mongodb[("MongoDB")]
end

node_user(("Researcher"))
node_firebase(("Firebase Auth"))
node_chat_provider(("Chat model API"))
node_web(("Web sources"))

node_user -->|"uses"| node_workspace
node_workspace -->|"renders"| node_composer
node_workspace -->|"renders"| node_sessionview
node_workspace -->|"renders"| node_inspector
node_workspace -.->|"renders"| node_sidebar
node_workspace -->|"requests"| node_api_client
node_firebase_client -->|"authenticates"| node_firebase
node_user -->|"signs in"| node_firebase_client
node_api_client -->|"sends requests"| node_routes
node_routes -->|"verifies token"| node_auth_verify
node_auth_verify -->|"verifies identity"| node_firebase
node_routes -->|"starts research"| node_workflow
node_routes -->|"loads and saves"| node_mongo_repo
node_workflow -->|"retrieves sources"| node_retrieval_service
node_retrieval_service -.->|"searches with"| node_search_providers
node_search_providers -.->|"searches"| node_web
node_retrieval_service -.->|"chunks for indexing"| node_embed
node_workflow -->|"queries evidence"| node_index
node_index -->|"embeds queries"| node_embed
node_index -.->|"reads and writes"| node_chroma
node_workflow -->|"bounds passes"| node_budget
node_workflow -->|"synthesizes and critiques"| node_model
node_model -.->|"calls model"| node_chat_provider
node_workflow -.->|"builds knowledge tree"| node_organizer
node_routes -->|"expands selected node"| node_branch
node_branch -->|"runs focused research"| node_workflow
node_routes -->|"streams progress"| node_progress
node_progress -->|"streams events"| node_api_client
node_routes -->|"returns sessions"| node_api_client
node_api_client -->|"updates state"| node_workspace
node_sessionview -->|"uses tree data"| node_tree
node_inspector -->|"resolves grounding"| node_tree
node_mongo_repo -->|"serializes records"| node_session_models
node_mongo_repo -.->|"persists sessions"| node_mongodb

click node_workspace "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/state/workspace.tsx"
click node_composer "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Composer.tsx"
click node_sessionview "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/SessionView.tsx"
click node_inspector "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Inspector.tsx"
click node_sidebar "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Sidebar.tsx"
click node_tree "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/lib/tree.ts"
click node_api_client "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/api/client.ts"
click node_firebase_client "https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/auth/firebase.ts"
click node_routes "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/api/routes/research.py"
click node_auth_verify "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/auth/firebase.py"
click node_contracts "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/contracts.py"
click node_retrieval_service "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/service.py"
click node_search_providers "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/providers.py"
click node_embed "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/embeddings.py"
click node_index "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/chroma.py"
click node_workflow "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/graph.py"
click node_budget "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/core/research_budget.py"
click node_model "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/services/model.py"
click node_organizer "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/expansion.py"
click node_branch "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/services/branch_expansion.py"
click node_progress "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/progress.py"
click node_mongo_repo "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/persistence/repository.py"
click node_session_models "https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/persistence/models.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_workspace,node_composer,node_sessionview,node_inspector,node_sidebar,node_tree,node_api_client toneBlue
class node_firebase_client,node_routes,node_auth_verify,node_contracts toneAmber
class node_workflow,node_budget,node_model,node_organizer,node_branch,node_progress,node_chat_provider toneMint
class node_retrieval_service,node_search_providers,node_embed,node_index,node_chroma toneRose
class node_mongo_repo,node_session_models,node_mongodb,node_user,node_firebase,node_web toneIndigo
```

## Components

### Research workspace

- [Workspace state](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/state/workspace.tsx): `frontend/src/state/workspace.tsx`
- [Question composer](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Composer.tsx): `frontend/src/components/Composer.tsx`
- [Tree and citations](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/SessionView.tsx): `frontend/src/components/SessionView.tsx`
- [Evidence inspector](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Inspector.tsx): `frontend/src/components/Inspector.tsx`
- [Session history](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/components/Sidebar.tsx): `frontend/src/components/Sidebar.tsx`
- [Tree grounding](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/lib/tree.ts): `frontend/src/lib/tree.ts`
- [API and SSE client](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API and identity

- [Firebase sign-in](https://github.com/vishalm342/agentic-research-assistant/blob/main/frontend/src/auth/firebase.ts): `frontend/src/auth/firebase.ts`
- [Research API](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/api/routes/research.py): `backend/app/api/routes/research.py`
- [Token verification](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/auth/firebase.py): `backend/app/auth/firebase.py`
- [Research contracts](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/contracts.py): `backend/app/contracts.py`

### Research workflow

- [LangGraph workflow](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/graph.py): `backend/app/workflow/graph.py`
- [Research budget](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/core/research_budget.py): `backend/app/core/research_budget.py`
- [Synthesis and critique](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/services/model.py): `backend/app/services/model.py`
- [Tree organizer](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/expansion.py): `backend/app/workflow/expansion.py`
- [Branch expansion](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/services/branch_expansion.py): `backend/app/services/branch_expansion.py`
- [Progress events](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/workflow/progress.py): `backend/app/workflow/progress.py`

### Evidence retrieval

- [Search and extraction](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/service.py): `backend/app/retrieval/service.py`
- [Search providers](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/providers.py): `backend/app/retrieval/providers.py`
- [Voyage embeddings](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/embeddings.py): `backend/app/retrieval/embeddings.py`
- [Chroma evidence index](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/retrieval/chroma.py): `backend/app/retrieval/chroma.py`
- **ChromaDB**

### Session and index

- [Session repository](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/persistence/repository.py): `backend/app/persistence/repository.py`
- [Session records](https://github.com/vishalm342/agentic-research-assistant/blob/main/backend/app/persistence/models.py): `backend/app/persistence/models.py`
- **MongoDB**

### Other components

- **Researcher**
- **Firebase Auth**
- **Chat model API**
- **Web sources**

## Connections

- Researcher → Workspace state: uses (evidence: `README.md`)
- Workspace state → Question composer: renders (evidence: `frontend/src/App.tsx`)
- Workspace state → Tree and citations: renders (evidence: `frontend/src/App.tsx`)
- Workspace state → Evidence inspector: renders (evidence: `frontend/src/App.tsx`)
- Workspace state → Session history: renders
- Workspace state → API and SSE client: requests (evidence: `frontend/src/state/workspace.tsx`)
- Firebase sign-in → Firebase Auth: authenticates (evidence: `README.md`)
- Researcher → Firebase sign-in: signs in (evidence: `README.md`)
- API and SSE client → Research API: sends requests (evidence: `README.md`)
- Research API → Token verification: verifies token (evidence: `backend/app/api/routes/research.py`)
- Token verification → Firebase Auth: verifies identity (evidence: `README.md`)
- Research API → LangGraph workflow: starts research (evidence: `backend/app/api/routes/research.py`)
- Research API → Session repository: loads and saves (evidence: `backend/app/api/routes/research.py`)
- LangGraph workflow → Search and extraction: retrieves sources (evidence: `backend/app/workflow/graph.py`)
- Search and extraction → Search providers: searches with
- Search providers → Web sources: searches
- Search and extraction → Voyage embeddings: chunks for indexing
- LangGraph workflow → Chroma evidence index: queries evidence (evidence: `backend/app/workflow/graph.py`)
- Chroma evidence index → Voyage embeddings: embeds queries (evidence: `backend/app/retrieval/chroma.py`)
- Chroma evidence index → ChromaDB: reads and writes
- LangGraph workflow → Research budget: bounds passes (evidence: `backend/app/workflow/graph.py`)
- LangGraph workflow → Synthesis and critique: synthesizes and critiques (evidence: `backend/app/workflow/graph.py`)
- Synthesis and critique → Chat model API: calls model
- LangGraph workflow → Tree organizer: builds knowledge tree (evidence: `backend/app/workflow/graph.py`)
- Research API → Branch expansion: expands selected node (evidence: `backend/app/api/routes/research.py`)
- Branch expansion → LangGraph workflow: runs focused research (evidence: `backend/app/services/branch_expansion.py`)
- Research API → Progress events: streams progress (evidence: `backend/app/api/routes/research.py`)
- Progress events → API and SSE client: streams events (evidence: `README.md`)
- Research API → API and SSE client: returns sessions (evidence: `README.md`)
- API and SSE client → Workspace state: updates state (evidence: `frontend/src/state/workspace.tsx`)
- Tree and citations → Tree grounding: uses tree data (evidence: `frontend/src/components/SessionView.tsx`)
- Evidence inspector → Tree grounding: resolves grounding (evidence: `frontend/src/components/Inspector.tsx`)
- Session repository → Session records: serializes records (evidence: `backend/app/persistence/repository.py`)
- Session repository → MongoDB: persists sessions
