# parmeshg-17/notebooklm-lite architecture

> Architecture diagram of the GitHub repository parmeshg-17/notebooklm-lite, 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/parmeshg-17/notebooklm-lite
- Repository: https://github.com/parmeshg-17/notebooklm-lite

## Overview

NotebookLM Lite is a citation-first document research workspace. Users create notebooks, upload documents, and ask questions grounded in the notebook corpus; answers stream with citations that lead to source pages and quoted evidence. Ingestion preserves page context while parsing and chunking, then embeds and indexes content. At query time, hybrid retrieval feeds answer generation and citation validation, with an explicit refusal for unsupported questions. The map also includes document reading and golden-set evaluation capabilities. Some router and UI wiring is inferred from the README because their implementation was not sampled.

Main entry points: [`backend/app/ingestion/pipeline.py`](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/pipeline.py) (Ingestion pipeline), [`backend/app/api/chat.py`](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/chat.py) (Chat API), [`backend/app/main.py`](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/services/document_service.py`](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/document_service.py) (Document service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Research workspace"]
  node_workspace["Research UI<br/>[page.tsx]"]
  node_notebook_view["Notebook view<br/>[NotebookView.tsx]"]
  node_citation_panel["Evidence inspector"]
  node_document_reader["Document reader"]
end

subgraph group_api["API and services"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_notebook_api["Notebook API<br/>[notebooks.py]"]
  node_document_api["Document API<br/>[documents.py]"]
  node_chat_api["Chat API<br/>[chat.py]"]
  node_eval_api["Evaluation API<br/>[evals.py]"]
  node_notebook_service["Notebook service"]
  node_document_service["Document service"]
  node_storage_service["Object storage<br/>[storage.py]"]
end

subgraph group_ingestion["Document ingestion"]
  node_ingest_pipeline["Ingestion pipeline<br/>[pipeline.py]"]
  node_parser["Page parser<br/>[parser.py]"]
  node_chunker["Page chunker<br/>[chunker.py]"]
  node_embedder["Embedding provider<br/>[embeddings.py]"]
  node_worker["Ingestion task<br/>[tasks.py]"]
end

subgraph group_qa["Grounded Q&amp;A"]
  node_retriever["Hybrid retrieval<br/>[retrieval.py]"]
  node_generator["Answer generator<br/>[generator.py]"]
  node_validator["Citation validator<br/>[citations.py]"]
  node_citation_builder["Citation formatting<br/>[citations.py]"]
end

subgraph group_state["Data and evaluation"]
  node_postgres[("PostgreSQL corpus<br/>[models.py]")]
  node_document_repo["Document repository<br/>[document_repo.py]"]
  node_notebook_repo["Notebook repository<br/>[notebook_repo.py]"]
  node_evaluation["Evaluation runner<br/>[eval_service.py]"]
end

node_researcher(("Researcher"))
node_object_store[("S3 or local files")]
node_llm["LLM provider"]
node_redis["Redis broker"]

node_researcher -->|"uses"| node_workspace
node_workspace -->|"HTTP and SSE"| node_api_app
node_api_app -->|"dispatches"| node_notebook_api
node_api_app -->|"dispatches"| node_document_api
node_api_app -->|"dispatches"| node_chat_api
node_api_app -->|"dispatches"| node_eval_api
node_notebook_api -->|"calls"| node_notebook_service
node_notebook_service -->|"calls"| node_notebook_repo
node_notebook_repo -->|"reads and writes"| node_postgres
node_document_api -->|"calls"| node_document_service
node_document_service -->|"calls"| node_document_repo
node_document_repo -->|"reads and writes"| node_postgres
node_document_service -->|"stores files"| node_storage_service
node_storage_service -->|"reads and writes"| node_object_store
node_document_service -->|"starts ingestion"| node_ingest_pipeline
node_worker -->|"runs"| node_ingest_pipeline
node_worker -.->|"broker access"| node_redis
node_ingest_pipeline -->|"downloads source"| node_storage_service
node_ingest_pipeline -->|"parses pages"| node_parser
node_ingest_pipeline -->|"chunks pages"| node_chunker
node_ingest_pipeline -->|"embeds chunks"| node_embedder
node_ingest_pipeline -->|"stores indexed chunks"| node_postgres
node_chat_api -->|"retrieves evidence"| node_retriever
node_retriever -->|"embeds query"| node_embedder
node_retriever -->|"searches corpus"| node_postgres
node_chat_api -->|"generates answer"| node_generator
node_generator -.->|"requests completion"| node_llm
node_chat_api -->|"validates answer"| node_validator
node_chat_api -->|"formats citations"| node_citation_builder
node_chat_api -->|"streams answer"| node_workspace
node_workspace -->|"shows notebook"| node_notebook_view
node_notebook_view -->|"opens evidence"| node_citation_panel
node_citation_panel -->|"jumps to page"| node_document_reader
node_document_reader -->|"fetches page"| node_document_api
node_eval_api -->|"runs benchmark"| node_evaluation
node_evaluation -->|"retrieves test evidence"| node_retriever
node_evaluation -->|"generates test answer"| node_generator
node_evaluation -->|"scores citations"| node_validator

click node_workspace "https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/app/page.tsx"
click node_notebook_view "https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/NotebookView.tsx"
click node_citation_panel "https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/CitationViewerPanel.tsx"
click node_document_reader "https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/FullDocumentReader.tsx"
click node_api_app "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/main.py"
click node_notebook_api "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/notebooks.py"
click node_document_api "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/documents.py"
click node_chat_api "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/chat.py"
click node_eval_api "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/evals.py"
click node_notebook_service "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/notebook_service.py"
click node_document_service "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/document_service.py"
click node_storage_service "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/storage.py"
click node_ingest_pipeline "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/pipeline.py"
click node_parser "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/parser.py"
click node_chunker "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/chunker.py"
click node_embedder "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/embeddings.py"
click node_worker "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/workers/tasks.py"
click node_retriever "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/retrieval.py"
click node_generator "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/generator.py"
click node_validator "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/citations.py"
click node_citation_builder "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/citations.py"
click node_postgres "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/models/models.py"
click node_document_repo "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/db/document_repo.py"
click node_notebook_repo "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/db/notebook_repo.py"
click node_evaluation "https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/evaluations/eval_service.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_notebook_view,node_citation_panel,node_document_reader toneBlue
class node_api_app,node_notebook_api,node_document_api,node_chat_api,node_eval_api,node_notebook_service,node_document_service,node_storage_service,node_object_store,node_redis toneAmber
class node_ingest_pipeline,node_parser,node_chunker,node_embedder,node_worker toneMint
class node_retriever,node_generator,node_validator,node_citation_builder toneRose
class node_postgres,node_document_repo,node_notebook_repo,node_evaluation,node_researcher,node_llm toneIndigo
```

## Components

### Research workspace

- [Research UI](https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Notebook view](https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/NotebookView.tsx): `frontend/components/NotebookView.tsx`
- [Evidence inspector](https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/CitationViewerPanel.tsx): `frontend/components/CitationViewerPanel.tsx`
- [Document reader](https://github.com/parmeshg-17/notebooklm-lite/blob/main/frontend/components/FullDocumentReader.tsx): `frontend/components/FullDocumentReader.tsx`

### API and services

- [FastAPI application](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/main.py): `backend/app/main.py`
- [Notebook API](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/notebooks.py): `backend/app/api/notebooks.py`
- [Document API](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Chat API](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/chat.py): `backend/app/api/chat.py`
- [Evaluation API](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/api/evals.py): `backend/app/api/evals.py`
- [Notebook service](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/notebook_service.py): `backend/app/services/notebook_service.py`
- [Document service](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/document_service.py): `backend/app/services/document_service.py`
- [Object storage](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/services/storage.py): `backend/app/services/storage.py`

### Document ingestion

- [Ingestion pipeline](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/pipeline.py): `backend/app/ingestion/pipeline.py`
- [Page parser](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/parser.py): `backend/app/ingestion/parser.py`
- [Page chunker](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/ingestion/chunker.py): `backend/app/ingestion/chunker.py`
- [Embedding provider](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/embeddings.py): `backend/app/rag/embeddings.py`
- [Ingestion task](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/workers/tasks.py): `backend/app/workers/tasks.py`

### Grounded Q&A

- [Hybrid retrieval](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/retrieval.py): `backend/app/rag/retrieval.py`
- [Answer generator](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/generator.py): `backend/app/rag/generator.py`
- [Citation validator](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/citations.py): `backend/app/rag/citations.py`
- [Citation formatting](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/rag/citations.py): `backend/app/rag/citations.py`

### Data and evaluation

- [PostgreSQL corpus](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/models/models.py): `backend/app/models/models.py`
- [Document repository](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/db/document_repo.py): `backend/app/db/document_repo.py`
- [Notebook repository](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/db/notebook_repo.py): `backend/app/db/notebook_repo.py`
- [Evaluation runner](https://github.com/parmeshg-17/notebooklm-lite/blob/main/backend/app/evaluations/eval_service.py): `backend/app/evaluations/eval_service.py`

### Other components

- **Researcher**
- **S3 or local files**
- **LLM provider**
- **Redis broker**

## Connections

- Researcher → Research UI: uses
- Research UI → FastAPI application: HTTP and SSE
- FastAPI application → Notebook API: dispatches
- FastAPI application → Document API: dispatches
- FastAPI application → Chat API: dispatches
- FastAPI application → Evaluation API: dispatches
- Notebook API → Notebook service: calls
- Notebook service → Notebook repository: calls
- Notebook repository → PostgreSQL corpus: reads and writes
- Document API → Document service: calls
- Document service → Document repository: calls
- Document repository → PostgreSQL corpus: reads and writes
- Document service → Object storage: stores files
- Object storage → S3 or local files: reads and writes
- Document service → Ingestion pipeline: starts ingestion
- Ingestion task → Ingestion pipeline: runs
- Ingestion task → Redis broker: broker access
- Ingestion pipeline → Object storage: downloads source
- Ingestion pipeline → Page parser: parses pages
- Ingestion pipeline → Page chunker: chunks pages
- Ingestion pipeline → Embedding provider: embeds chunks
- Ingestion pipeline → PostgreSQL corpus: stores indexed chunks
- Chat API → Hybrid retrieval: retrieves evidence
- Hybrid retrieval → Embedding provider: embeds query
- Hybrid retrieval → PostgreSQL corpus: searches corpus
- Chat API → Answer generator: generates answer
- Answer generator → LLM provider: requests completion
- Chat API → Citation validator: validates answer
- Chat API → Citation formatting: formats citations
- Chat API → Research UI: streams answer
- Research UI → Notebook view: shows notebook
- Notebook view → Evidence inspector: opens evidence
- Evidence inspector → Document reader: jumps to page
- Document reader → Document API: fetches page
- Evaluation API → Evaluation runner: runs benchmark
- Evaluation runner → Hybrid retrieval: retrieves test evidence
- Evaluation runner → Answer generator: generates test answer
- Evaluation runner → Citation validator: scores citations
