# youcef9997/documind architecture

> Architecture diagram of the GitHub repository youcef9997/documind, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youcef9997/documind
- Repository: https://github.com/youcef9997/documind

## Overview

DocuMind is a single-user document intelligence app: users upload a folder, index supported files, then ask questions and inspect retrieved passages alongside answers. Indexing orchestrates extraction, overlapping chunk creation, embedding and persistent storage; question answering retrieves passages before requesting hosted generation. The Streamlit interface owns both workflows and displays the result. The graph follows the sampled calls and README-documented capabilities; unsampled behavior is not inferred beyond those documented links.

Main entry points: [`app/ui.py`](https://github.com/youcef9997/documind/blob/main/app/ui.py) (Streamlit interface), [`app/vector_store.py`](https://github.com/youcef9997/documind/blob/main/app/vector_store.py) (Vector store), [`app/indexing.py`](https://github.com/youcef9997/documind/blob/main/app/indexing.py) (Indexing orchestrator), [`app/rag.py`](https://github.com/youcef9997/documind/blob/main/app/rag.py) (RAG orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit["Streamlit interface<br/>[ui.py]"]
end

subgraph group_indexing["Document indexing"]
  node_indexer["Indexing orchestrator<br/>[indexing.py]"]
  node_extractor["Document extraction<br/>[ingestion.py]"]
  node_chunker["Overlapping chunking<br/>[chunking.py]"]
end

subgraph group_retrieval["Semantic retrieval"]
  node_embedder["Local embeddings<br/>[embeddings.py]"]
  node_vectorstore["Vector store<br/>[vector_store.py]"]
  node_chromadb[("Persistent ChromaDB index<br/>[vector_store.py]")]
end

subgraph group_answering["Question answering"]
  node_rag["RAG orchestration<br/>[rag.py]"]
  node_groq["GroqCloud model"]
end

node_user(("User"))

node_user -->|"uploads and asks"| node_streamlit
node_streamlit -->|"indexes files"| node_indexer
node_indexer -->|"extracts text"| node_extractor
node_indexer -->|"creates chunks"| node_chunker
node_indexer -->|"stores chunks"| node_vectorstore
node_vectorstore -->|"encodes text"| node_embedder
node_vectorstore -->|"reads and writes"| node_chromadb
node_streamlit -->|"counts chunks"| node_vectorstore
node_streamlit -->|"asks question"| node_rag
node_rag -->|"searches passages"| node_vectorstore
node_rag -->|"requests generation"| node_groq
node_rag -->|"returns answer and sources"| node_streamlit

click node_streamlit "https://github.com/youcef9997/documind/blob/main/app/ui.py"
click node_indexer "https://github.com/youcef9997/documind/blob/main/app/indexing.py"
click node_extractor "https://github.com/youcef9997/documind/blob/main/app/ingestion.py"
click node_chunker "https://github.com/youcef9997/documind/blob/main/app/chunking.py"
click node_embedder "https://github.com/youcef9997/documind/blob/main/app/embeddings.py"
click node_vectorstore "https://github.com/youcef9997/documind/blob/main/app/vector_store.py"
click node_chromadb "https://github.com/youcef9997/documind/blob/main/app/vector_store.py"
click node_rag "https://github.com/youcef9997/documind/blob/main/app/rag.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_streamlit,node_user toneBlue
class node_indexer,node_extractor,node_chunker toneAmber
class node_embedder,node_vectorstore,node_chromadb toneMint
class node_rag,node_groq toneRose
```

## Components

### User interface

- [Streamlit interface](https://github.com/youcef9997/documind/blob/main/app/ui.py): `app/ui.py`

### Document indexing

- [Indexing orchestrator](https://github.com/youcef9997/documind/blob/main/app/indexing.py): `app/indexing.py`
- [Document extraction](https://github.com/youcef9997/documind/blob/main/app/ingestion.py): `app/ingestion.py`
- [Overlapping chunking](https://github.com/youcef9997/documind/blob/main/app/chunking.py): `app/chunking.py`

### Semantic retrieval

- [Local embeddings](https://github.com/youcef9997/documind/blob/main/app/embeddings.py): `app/embeddings.py`
- [Vector store](https://github.com/youcef9997/documind/blob/main/app/vector_store.py): `app/vector_store.py`
- [Persistent ChromaDB index](https://github.com/youcef9997/documind/blob/main/app/vector_store.py): `app/vector_store.py`

### Question answering

- [RAG orchestration](https://github.com/youcef9997/documind/blob/main/app/rag.py): `app/rag.py`
- **GroqCloud model**

### Other components

- **User**

## Connections

- User → Streamlit interface: uploads and asks (evidence: `README.md`)
- Streamlit interface → Indexing orchestrator: indexes files (evidence: `app/ui.py`)
- Indexing orchestrator → Document extraction: extracts text (evidence: `app/indexing.py`)
- Indexing orchestrator → Overlapping chunking: creates chunks (evidence: `app/indexing.py`)
- Indexing orchestrator → Vector store: stores chunks (evidence: `app/indexing.py`)
- Vector store → Local embeddings: encodes text (evidence: `app/vector_store.py`)
- Vector store → Persistent ChromaDB index: reads and writes (evidence: `app/vector_store.py`)
- Streamlit interface → Vector store: counts chunks (evidence: `app/ui.py`)
- Streamlit interface → RAG orchestration: asks question (evidence: `app/ui.py`)
- RAG orchestration → Vector store: searches passages (evidence: `app/rag.py`)
- RAG orchestration → GroqCloud model: requests generation (evidence: `app/rag.py`)
- RAG orchestration → Streamlit interface: returns answer and sources (evidence: `app/ui.py`)
