# ramyagandi1116/ai-knowledge-workspace architecture

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

- Interactive diagram: https://gitdiagram.com/ramyagandi1116/ai-knowledge-workspace
- Repository: https://github.com/ramyagandi1116/ai-knowledge-workspace

## Overview

AI Knowledge Workspace is a local PDF question-answering application. Users upload research PDFs for page-aware extraction, chunking, embedding, and FAISS indexing; they can then ask grounded questions or explore semantic search results, with document/page citations shown in the interface. The sampled code confirms the main orchestration and module calls. The README describes the vector explorer and document manager, while implementation details beyond the provided excerpts are not inferred.

Main entry points: [`backend/rag_pipeline.py`](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/rag_pipeline.py) (RAG Orchestrator), [`app.py`](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py) (Streamlit Workspace), [`backend/retriever.py`](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/retriever.py) (Semantic Retriever), [`backend/vector_store.py`](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/vector_store.py) (FAISS Index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Workspace UI"]
  node_workspace["Streamlit Workspace<br/>[app.py]"]
  node_document_manager["Document Manager<br/>[app.py]"]
  node_search_explorer["Search Explorer<br/>[app.py]"]
  node_citation_format["Citation Formatting<br/>[helpers.py]"]
end

subgraph group_index["Document Indexing"]
  node_pdf_loader["PDF Loader<br/>[loader.py]"]
  node_chunker["Text Chunker<br/>[chunker.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
end

subgraph group_qa["Question Answering"]
  node_pipeline["RAG Orchestrator<br/>[rag_pipeline.py]"]
  node_retriever["Semantic Retriever<br/>[retriever.py]"]
  node_prompt_builder["Grounded Prompt<br/>[prompt.py]"]
  node_llm_client["Ollama Client<br/>[llm.py]"]
end

subgraph group_storage["Local Knowledge Store"]
  node_vector_store[("FAISS Index<br/>[vector_store.py]")]
end

node_user(("User"))
node_ollama["Local Ollama"]
node_local_files[("Local PDF Files")]

node_user -->|"uploads PDFs"| node_document_manager
node_document_manager -->|"processes uploads"| node_pipeline
node_pipeline -->|"saves and extracts"| node_pdf_loader
node_pdf_loader -->|"writes and reads"| node_local_files
node_pipeline -->|"chunks pages"| node_chunker
node_pipeline -->|"embeds chunks"| node_embeddings
node_pipeline -->|"persists vectors"| node_vector_store
node_user -->|"asks questions"| node_workspace
node_workspace -->|"submits query"| node_pipeline
node_pipeline -->|"retrieves chunks"| node_retriever
node_retriever -->|"embeds query"| node_embeddings
node_retriever -->|"loads and searches"| node_vector_store
node_pipeline -->|"builds prompt"| node_prompt_builder
node_pipeline -->|"generates response"| node_llm_client
node_llm_client -->|"sends prompt"| node_ollama
node_pipeline -->|"returns answer and citations"| node_workspace
node_workspace -->|"formats citations"| node_citation_format
node_user -->|"explores results"| node_search_explorer
node_search_explorer -->|"searches documents"| node_pipeline
node_document_manager -->|"summarizes and clears"| node_vector_store

click node_workspace "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py"
click node_document_manager "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py"
click node_search_explorer "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py"
click node_citation_format "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/utils/helpers.py"
click node_pipeline "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/rag_pipeline.py"
click node_pdf_loader "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/loader.py"
click node_chunker "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/chunker.py"
click node_embeddings "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/embeddings.py"
click node_retriever "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/retriever.py"
click node_prompt_builder "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/prompt.py"
click node_llm_client "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/llm.py"
click node_vector_store "https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/vector_store.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_document_manager,node_search_explorer,node_citation_format,node_user toneBlue
class node_pdf_loader,node_chunker,node_embeddings,node_local_files toneAmber
class node_pipeline,node_retriever,node_prompt_builder,node_llm_client toneMint
class node_vector_store toneRose
class node_ollama toneIndigo
```

## Components

### Workspace UI

- [Streamlit Workspace](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py): `app.py`
- [Document Manager](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py): `app.py`
- [Search Explorer](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/app.py): `app.py`
- [Citation Formatting](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/utils/helpers.py): `utils/helpers.py`

### Document Indexing

- [PDF Loader](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/loader.py): `backend/loader.py`
- [Text Chunker](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/chunker.py): `backend/chunker.py`
- [Embeddings](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/embeddings.py): `backend/embeddings.py`

### Question Answering

- [RAG Orchestrator](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/rag_pipeline.py): `backend/rag_pipeline.py`
- [Semantic Retriever](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/retriever.py): `backend/retriever.py`
- [Grounded Prompt](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/prompt.py): `backend/prompt.py`
- [Ollama Client](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/llm.py): `backend/llm.py`

### Local Knowledge Store

- [FAISS Index](https://github.com/ramyagandi1116/ai-knowledge-workspace/blob/main/backend/vector_store.py): `backend/vector_store.py`

### Other components

- **User**
- **Local Ollama**
- **Local PDF Files**

## Connections

- User → Document Manager: uploads PDFs (evidence: `README.md`)
- Document Manager → RAG Orchestrator: processes uploads (evidence: `app.py`)
- RAG Orchestrator → PDF Loader: saves and extracts (evidence: `backend/rag_pipeline.py`)
- PDF Loader → Local PDF Files: writes and reads (evidence: `backend/loader.py`)
- RAG Orchestrator → Text Chunker: chunks pages (evidence: `backend/rag_pipeline.py`)
- RAG Orchestrator → Embeddings: embeds chunks (evidence: `backend/rag_pipeline.py`)
- RAG Orchestrator → FAISS Index: persists vectors (evidence: `backend/rag_pipeline.py`)
- User → Streamlit Workspace: asks questions (evidence: `README.md`)
- Streamlit Workspace → RAG Orchestrator: submits query (evidence: `app.py`)
- RAG Orchestrator → Semantic Retriever: retrieves chunks (evidence: `backend/rag_pipeline.py`)
- Semantic Retriever → Embeddings: embeds query (evidence: `backend/retriever.py`)
- Semantic Retriever → FAISS Index: loads and searches (evidence: `backend/retriever.py`)
- RAG Orchestrator → Grounded Prompt: builds prompt (evidence: `backend/rag_pipeline.py`)
- RAG Orchestrator → Ollama Client: generates response (evidence: `backend/rag_pipeline.py`)
- Ollama Client → Local Ollama: sends prompt (evidence: `backend/llm.py`)
- RAG Orchestrator → Streamlit Workspace: returns answer and citations (evidence: `app.py`)
- Streamlit Workspace → Citation Formatting: formats citations (evidence: `app.py`)
- User → Search Explorer: explores results (evidence: `README.md`)
- Search Explorer → RAG Orchestrator: searches documents (evidence: `app.py`)
- Document Manager → FAISS Index: summarizes and clears (evidence: `app.py`)
