# z3phyru5646/qna-assistant-from-scratch-using-langchain architecture

> Architecture diagram of the GitHub repository z3phyru5646/qna-assistant-from-scratch-using-langchain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/z3phyru5646/qna-assistant-from-scratch-using-langchain
- Repository: https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain

## Overview

1. **Project shape**
   - This is a **Streamlit-based hybrid RAG application** named `hybrid_rag`.
   - The repo is organized into a small number of clear layers: **UI**, **RAG/core services**, **document ingestion and processing**, **configuration**, and **utility wrappers for external APIs**.

2. **Runtime entrypoint**
   - `app.py` is the top-level application entrypoint.
   - It likely wires together authentication, sidebar/navigation, chat, notebook, dashboard, and monitoring views from the `ui/` package.

3. **User interface layer**
   - The `ui/` directory contains the presentation layer for the Streamlit app:
     - `chat_interface.py` for conversational interaction
     - `citation_panel.py` for source attribution
     - `notebook_panel.py` for note-taking / saved context
     - `sidebar.py`, `filter_buttons.py`, and `dashboard_metrics.py` for controls and status views
     - `login_page.py` for authentication UI
     - `system_monitor.py` for runtime/health visibility
     - `styles.py` for shared visual styling
   - This layer does not appear to own retrieval logic; it consumes services from `core/`.

4. **Document ingestion boundary**
   - `ingest.py` is the ingestion entrypoint.
   - The `core/` processors split input by file type and modality:
     - `pdf_processor.py`, `docx_processor.py`, `txt_processor.py`
     - `text_pipeline.py`, `image_pipeline.py`, `table_pipeline.py`
   - This suggests the system can ingest **mixed content types** and normalize them into a common retrieval-ready representation.

5. **Hybrid content processing**
   - The presence of separate pipelines for **text, images, and tables** indicates a hybrid retrieval design, not just plain text RAG.
   - `utils/google_lens_api.py` and `utils/google_ai_mode_api.py` imply external AI services are used to enrich or interpret non-text content, especially images.
   - `core/autocorrect_engine.py` likely cleans or standardizes extracted text before indexing or querying.

6. **Embedding and vector storage**
   - `core/embedding_manager.py` handles embedding generation.
   - `core/vectorstore_manager.py` manages persistence and access to the vector store.
   - These form the indexing backbone: extracted content is transformed into embeddings and stored for similarity search.

7. **Retrieval and answer generation**
   - `core/retriever.py` performs retrieval over the indexed corpus.
   - `core/rag_chain.py` orchestrates the end-to-end retrieval-augmented generation flow.
   - `core/llm_manager.py` abstracts LLM access, so the generation layer is isolated from the rest of the app.
   - `core/summarizer.py` suggests an additional response mode for compressing retrieved content or producing concise outputs.

8. **Safety, visibility, and control**
   - `core/guardrails.py` appears to enforce query or response constraints.
   - `core/query_visibility.py` likely controls whether internal retrieval context or reasoning artifacts are exposed in the UI.
   - `core/question_suggester.py` can generate follow-up questions or prompt suggestions to guide the user.

9. **Memory and notebook features**
   - `core/memory_manager.py` and `core/notebook_manager.py` imply the app preserves conversation state and user-created notes.
   - These are separate from the vector store: one supports conversational continuity, the other supports explicit user curation.

10. **Authentication and access**
   - `core/auth_manager.py` and `ui/login_page.py` define the auth boundary.
   - This likely gates access to the chat, notebook, and document features, and may influence what content or sessions a user can see.

11. **Shared configuration and localization**
   - `config/settings.py` holds application settings, while `config/translations.py` suggests multilingual or localized UI strings.
   - `.streamlit/config.toml` contains Streamlit-specific runtime/configuration settings.

12. **External service integration**
   - `utils/google_ai_mode_api.py` and `utils/google_lens_api.py` are explicit integration points to Google services.
   - The rest of the code appears to depend on these wrappers rather than calling external APIs directly, which keeps the core architecture decoupled from vendor-specific details.

13. **Likely data flow for the main use case**
   - A user uploads or ingests documents.
   - File-specific processors extract text, tables, and image-derived content.
   - The content is normalized, embedded, and stored in the vector store.
   - During chat, the retriever pulls relevant chunks.
   - The RAG chain combines retrieved context with the LLM.
   - The UI displays the answer, citations, suggested questions, and any notebook/memory state.

14. **What to draw in an architecture diagram**
   - Show three main zones:
     - **UI / Streamlit frontend**
     - **Core RAG services**
     - **Ingestion + external AI/API integrations**
   - Connect ingestion into processors, then embeddings/vector store, then retriever, then RAG chain, then LLM, then back to the UI with citations and monitoring.
   - Treat auth, memory, notebook, guardrails, and query visibility as cross-cutting services around the main retrieval loop.

Main entry points: [`core/rag_chain.py`](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/rag_chain.py) (RAG chain), [`app.py`](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/app.py) (App), [`ui/chat_interface.py`](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/chat_interface.py) (Chat), [`core/text_pipeline.py`](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/text_pipeline.py) (Text pipe)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["UI"]
  node_app["App<br/>streamlit entrypoint<br/>[app.py]"]
  node_login_page["Login<br/>auth UI<br/>[login_page.py]"]
  node_sidebar["Sidebar<br/>nav controls<br/>[sidebar.py]"]
  node_chat_interface["Chat<br/>conversation UI<br/>[chat_interface.py]"]
  node_citation_panel["Citations<br/>attribution UI<br/>[citation_panel.py]"]
  node_notebook_panel["Notebook<br/>notes UI<br/>[notebook_panel.py]"]
  node_system_monitor["Monitor<br/>status UI<br/>[system_monitor.py]"]
end

subgraph group_core["Core RAG"]
  node_autocorrect_engine["Autocorrect<br/>text normalization"]
  node_embedding_manager["Embeddings<br/>embedding service"]
  node_vectorstore_manager[("Vector store<br/>index storage")]
  node_retriever["Retriever<br/>search service<br/>[retriever.py]"]
  node_rag_chain["RAG chain<br/>orchestrator<br/>[rag_chain.py]"]
  node_llm_manager["LLM<br/>model adapter<br/>[llm_manager.py]"]
  node_guardrails["Guardrails<br/>policy control<br/>[guardrails.py]"]
  node_memory_manager["Memory<br/>conversation state<br/>[memory_manager.py]"]
  node_notebook_manager["Notebook svc<br/>user notes"]
  node_query_visibility["Visibility<br/>context control"]
  node_question_suggester["Suggester<br/>prompt helper"]
  node_summarizer["Summarizer<br/>response mode<br/>[summarizer.py]"]
  node_auth_manager["Auth<br/>access control<br/>[auth_manager.py]"]
end

subgraph group_ingestion["Ingestion"]
  node_ingest["Ingest<br/>[ingest.py]"]
  node_pdf_processor["PDF<br/>document parser<br/>[pdf_processor.py]"]
  node_docx_processor["DOCX<br/>document parser<br/>[docx_processor.py]"]
  node_txt_processor["Text<br/>document parser<br/>[txt_processor.py]"]
  node_text_pipeline["Text pipe<br/>content pipeline<br/>[text_pipeline.py]"]
  node_image_pipeline["Image pipe<br/>content pipeline<br/>[image_pipeline.py]"]
  node_table_pipeline["Table pipe<br/>content pipeline<br/>[table_pipeline.py]"]
end

subgraph group_config["Config"]
  node_settings["Settings<br/>config<br/>[settings.py]"]
  node_translations["Translations<br/>localization<br/>[translations.py]"]
end

subgraph group_utils["External APIs"]
  node_google_ai_mode_api["Google AI<br/>external api"]
  node_google_lens_api["Google Lens<br/>external api<br/>[google_lens_api.py]"]
end

node_app -->|"auth flow"| node_login_page
node_app -->|"navigation"| node_sidebar
node_app -->|"main view"| node_chat_interface
node_app -->|"evidence view"| node_citation_panel
node_app -->|"notes view"| node_notebook_panel
node_app -->|"status view"| node_system_monitor
node_app -->|"config"| node_settings
node_app -->|"localization"| node_translations
node_login_page -->|"verify"| node_auth_manager
node_chat_interface -->|"ask"| node_rag_chain
node_chat_interface -->|"session state"| node_memory_manager
node_chat_interface -->|"suggest"| node_question_suggester
node_chat_interface -->|"context toggle"| node_query_visibility
node_chat_interface -->|"policy"| node_guardrails
node_chat_interface -->|"summarize"| node_summarizer
node_chat_interface -->|"save note"| node_notebook_manager
node_notebook_panel -->|"sync"| node_notebook_manager
node_ingest -->|"parse"| node_pdf_processor
node_ingest -->|"parse"| node_docx_processor
node_ingest -->|"parse"| node_txt_processor
node_pdf_processor -->|"normalize"| node_text_pipeline
node_docx_processor -->|"normalize"| node_text_pipeline
node_txt_processor -->|"normalize"| node_text_pipeline
node_text_pipeline -->|"clean"| node_autocorrect_engine
node_text_pipeline -->|"embed"| node_embedding_manager
node_image_pipeline -->|"vision api"| node_google_lens_api
node_image_pipeline -->|"enrich"| node_google_ai_mode_api
node_image_pipeline -->|"embed"| node_embedding_manager
node_table_pipeline -->|"normalize"| node_text_pipeline
node_embedding_manager -->|"store"| node_vectorstore_manager
node_rag_chain -->|"retrieve"| node_retriever
node_retriever -->|"search"| node_vectorstore_manager
node_rag_chain -->|"check"| node_guardrails
node_rag_chain -->|"generate"| node_llm_manager
node_rag_chain -->|"prepare context"| node_query_visibility
node_rag_chain -->|"compress"| node_summarizer
node_rag_chain -->|"follow-ups"| node_question_suggester
node_rag_chain -->|"persist state"| node_memory_manager
node_rag_chain -->|"store notes"| node_notebook_manager
node_sidebar -->|"session gate"| node_auth_manager

click node_app "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/app.py"
click node_login_page "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/login_page.py"
click node_sidebar "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/sidebar.py"
click node_chat_interface "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/chat_interface.py"
click node_citation_panel "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/citation_panel.py"
click node_notebook_panel "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/notebook_panel.py"
click node_system_monitor "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/system_monitor.py"
click node_settings "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/config/settings.py"
click node_translations "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/config/translations.py"
click node_ingest "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ingest.py"
click node_pdf_processor "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/pdf_processor.py"
click node_docx_processor "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/docx_processor.py"
click node_txt_processor "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/txt_processor.py"
click node_text_pipeline "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/text_pipeline.py"
click node_image_pipeline "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/image_pipeline.py"
click node_table_pipeline "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/table_pipeline.py"
click node_autocorrect_engine "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/autocorrect_engine.py"
click node_embedding_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/embedding_manager.py"
click node_vectorstore_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/vectorstore_manager.py"
click node_retriever "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/retriever.py"
click node_rag_chain "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/rag_chain.py"
click node_llm_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/llm_manager.py"
click node_guardrails "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/guardrails.py"
click node_memory_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/memory_manager.py"
click node_notebook_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/notebook_manager.py"
click node_query_visibility "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/query_visibility.py"
click node_question_suggester "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/question_suggester.py"
click node_summarizer "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/summarizer.py"
click node_auth_manager "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/auth_manager.py"
click node_google_ai_mode_api "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/utils/google_ai_mode_api.py"
click node_google_lens_api "https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/utils/google_lens_api.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_app,node_login_page,node_sidebar,node_chat_interface,node_citation_panel,node_notebook_panel,node_system_monitor toneBlue
class node_autocorrect_engine,node_embedding_manager,node_vectorstore_manager,node_retriever,node_rag_chain,node_llm_manager,node_guardrails,node_memory_manager,node_notebook_manager,node_query_visibility,node_question_suggester,node_summarizer,node_auth_manager toneAmber
class node_ingest,node_pdf_processor,node_docx_processor,node_txt_processor,node_text_pipeline,node_image_pipeline,node_table_pipeline toneMint
class node_settings,node_translations toneRose
class node_google_ai_mode_api,node_google_lens_api toneIndigo
```

## Components

### UI

Streamlit presentation layer and app screens

- [App](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/app.py): streamlit entrypoint · Top-level application wiring and navigation · `app.py`
- [Login](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/login_page.py): auth UI · Authentication screen · `ui/login_page.py`
- [Sidebar](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/sidebar.py): nav controls · Primary app navigation and controls · `ui/sidebar.py`
- [Chat](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/chat_interface.py): conversation UI · Main user interaction surface for Q&A · `ui/chat_interface.py`
- [Citations](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/citation_panel.py): attribution UI · Source display and evidence panel · `ui/citation_panel.py`
- [Notebook](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/notebook_panel.py): notes UI · Saved notes and user-curated context · `ui/notebook_panel.py`
- [Monitor](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ui/system_monitor.py): status UI · Runtime and health visibility · `ui/system_monitor.py`

### Core RAG

Retrieval, generation, memory, and control services

- [Autocorrect](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/autocorrect_engine.py): text normalization · Cleanup and standardization of extracted text · `core/autocorrect_engine.py`
- [Embeddings](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/embedding_manager.py): embedding service · Embedding generation for indexed content · `core/embedding_manager.py`
- [Vector store](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/vectorstore_manager.py): index storage · Persistence and access to vector index · `core/vectorstore_manager.py`
- [Retriever](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/retriever.py): search service · Similarity search over indexed corpus · `core/retriever.py`
- [RAG chain](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/rag_chain.py): orchestrator · End-to-end retrieval augmented generation flow · `core/rag_chain.py`
- [LLM](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/llm_manager.py): model adapter · Language model access abstraction · `core/llm_manager.py`
- [Guardrails](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/guardrails.py): policy control · Query and response constraints · `core/guardrails.py`
- [Memory](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/memory_manager.py): conversation state · Conversation continuity and session memory · `core/memory_manager.py`
- [Notebook svc](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/notebook_manager.py): user notes · Persisted user notes and curation · `core/notebook_manager.py`
- [Visibility](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/query_visibility.py): context control · Controls exposure of internal retrieval context · `core/query_visibility.py`
- [Suggester](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/question_suggester.py): prompt helper · Follow-up question generation · `core/question_suggester.py`
- [Summarizer](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/summarizer.py): response mode · Concise summarization of retrieved content · `core/summarizer.py`
- [Auth](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/auth_manager.py): access control · Authentication and session authorization · `core/auth_manager.py`

### Ingestion

Document parsing and hybrid content pipelines

- [Ingest](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/ingest.py): ingestion entrypoint · Document ingestion orchestration · `ingest.py`
- [PDF](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/pdf_processor.py): document parser · PDF extraction and preparation · `core/pdf_processor.py`
- [DOCX](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/docx_processor.py): document parser · Word document extraction and preparation · `core/docx_processor.py`
- [Text](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/txt_processor.py): document parser · Plain-text extraction and preparation · `core/txt_processor.py`
- [Text pipe](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/text_pipeline.py): content pipeline · Normalization and chunking for text content · `core/text_pipeline.py`
- [Image pipe](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/image_pipeline.py): content pipeline · Image interpretation and enrichment pipeline · `core/image_pipeline.py`
- [Table pipe](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/core/table_pipeline.py): content pipeline · Table extraction and normalization pipeline · `core/table_pipeline.py`

### Config

Application settings and translations

- [Settings](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/config/settings.py): config · Application settings and environment values · `config/settings.py`
- [Translations](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/config/translations.py): localization · UI string and language resources · `config/translations.py`

### External APIs

Wrappers around vendor and shared helper utilities

- [Google AI](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/utils/google_ai_mode_api.py): external api · Wrapper for AI mode interactions · `utils/google_ai_mode_api.py`
- [Google Lens](https://github.com/z3phyru5646/qna-assistant-from-scratch-using-langchain/blob/main/utils/google_lens_api.py): external api · Wrapper for image understanding interactions · `utils/google_lens_api.py`

## Connections

- App → Login: auth flow · Routes unauthenticated users to login
- App → Sidebar: navigation · Builds global navigation and controls
- App → Chat: main view · Hosts the primary chat experience
- App → Citations: evidence view · Displays answer sources and citations
- App → Notebook: notes view · Shows saved notes and curated context
- App → Monitor: status view · Surfaces runtime and health information
- App → Settings: config · Loads runtime settings
- App → Translations: localization · Uses UI language resources
- Login → Auth: verify · Authenticates user sessions
- Chat → RAG chain: ask · Submits user queries to the RAG flow
- Chat → Memory: session state · Reads and writes conversation memory
- Chat → Suggester: suggest · Generates follow-up prompts
- Chat → Visibility: context toggle · Controls disclosure of internal context
- Chat → Guardrails: policy · Applies safety and query constraints
- Chat → Summarizer: summarize · Requests concise response variants
- Chat → Notebook svc: save note · Persists user-curated notes
- Notebook → Notebook svc: sync · Reads and updates notebook content
- Ingest → PDF: parse · Dispatches PDF documents
- Ingest → DOCX: parse · Dispatches DOCX documents
- Ingest → Text: parse · Dispatches text documents
- PDF → Text pipe: normalize · Feeds extracted text into the text pipeline
- DOCX → Text pipe: normalize · Feeds extracted text into the text pipeline
- Text → Text pipe: normalize · Feeds plain text into the text pipeline
- Text pipe → Autocorrect: clean · Standardizes extracted text before indexing
- Text pipe → Embeddings: embed · Creates embeddings for normalized chunks
- Image pipe → Google Lens: vision api · Uses external image understanding
- Image pipe → Google AI: enrich · Uses AI services to interpret visual content
- Image pipe → Embeddings: embed · Converts enriched image content to embeddings
- Table pipe → Text pipe: normalize · Reuses text normalization for table content
- Embeddings → Vector store: store · Persists embeddings in the vector index
- RAG chain → Retriever: retrieve · Pulls relevant chunks from the corpus
- Retriever → Vector store: search · Queries the vector store
- RAG chain → Guardrails: check · Validates retrieval and generation boundaries
- RAG chain → LLM: generate · Calls the model for answer synthesis
- RAG chain → Visibility: prepare context · Shapes what retrieval context is exposed
- RAG chain → Summarizer: compress · Produces concise answer or context summaries
- RAG chain → Suggester: follow-ups · Generates suggested next questions
- RAG chain → Memory: persist state · Updates conversational memory
- RAG chain → Notebook svc: store notes · Shares curated outputs with notebook storage
- Sidebar → Auth: session gate · Uses auth state to control access
