# luizcurti/crewai-local-docs-rag architecture

> Architecture diagram of the GitHub repository luizcurti/crewai-local-docs-rag, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/luizcurti/crewai-local-docs-rag
- Repository: https://github.com/luizcurti/crewai-local-docs-rag

## Overview

Local Docs RAG answers questions about JavaScript, Node.js, and Python APIs from indexed official documentation. The principal workflow runs from a user question through the Streamlit UI and answer cache into a CrewAI flow: understand or translate the question, search function records and examples, assemble context, then write and display an answer. A separate ingestion workflow parses documentation into records and stores them in a local vector database. Some flow steps and ingestion behavior are documented in the README but their full implementations were not sampled.

Main entry points: [`flow.py`](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py) (Answer entry), [`store.py`](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/store.py) (Vector store), [`ingest.py`](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/ingest.py) (Ingestion coordinator), [`app.py`](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/app.py) (Streamlit UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Question interface"]
  node_ui["Streamlit UI<br/>[app.py]"]
end

subgraph group_answering["Answer workflow"]
  node_flow_entry["Answer entry<br/>[flow.py]"]
  node_cache[("Answer cache<br/>[answer_cache.py]")]
  node_translate["Question translation<br/>[flow.py]"]
  node_understand["Question analysis<br/>[query.py]"]
  node_search["Function and example search<br/>[flow.py]"]
  node_context["Context assembly<br/>[flow.py]"]
  node_writer["Answer generation<br/>[flow.py]"]
  node_language_model["Language registry<br/>[languages.py]"]
end

subgraph group_indexing["Documentation indexing"]
  node_records["Entry and example records<br/>[entries.py]"]
  node_ingest["Ingestion coordinator<br/>[ingest.py]"]
  node_mdn["MDN parser<br/>[mdn.py]"]
  node_node["Node.js parser<br/>[node.py]"]
  node_python["Python parser<br/>[python.py]"]
end

subgraph group_runtime["Local runtime"]
  node_store[("Vector store<br/>[store.py]")]
  node_ollama["Local Ollama"]
  node_chromadb[("ChromaDB")]
  node_settings["Shared settings<br/>[config.py]"]
  node_preflight["Service checks<br/>[preflight.py]"]
end

node_user(("Questioner"))
node_docs["Official docs"]

node_user -->|"asks"| node_ui
node_ui -->|"calls"| node_flow_entry
node_flow_entry -->|"checks and stores"| node_cache
node_flow_entry -->|"translates if needed"| node_translate
node_flow_entry -->|"analyzes question"| node_understand
node_flow_entry -->|"searches records"| node_search
node_flow_entry -->|"assembles context"| node_context
node_flow_entry -->|"writes answer"| node_writer
node_search -->|"queries"| node_store
node_search -->|"embeds query"| node_ollama
node_context -->|"loads examples"| node_store
node_writer -->|"generates with"| node_ollama
node_ui -->|"checks readiness"| node_preflight
node_flow_entry -->|"checks services"| node_preflight
node_understand -->|"uses language definitions"| node_language_model
node_ui -->|"displays language labels"| node_language_model
node_ingest -->|"loads source"| node_mdn
node_ingest -->|"loads source"| node_node
node_ingest -->|"loads source"| node_python
node_mdn -->|"parses documentation"| node_docs
node_node -->|"parses documentation"| node_docs
node_python -->|"parses documentation"| node_docs
node_mdn -->|"produces entries"| node_records
node_node -->|"produces entries"| node_records
node_python -->|"produces entries"| node_records
node_ingest -->|"serializes records"| node_records
node_ingest -->|"writes index"| node_store
node_store -->|"persists vectors"| node_chromadb
node_preflight -->|"checks index"| node_store
node_store -->|"reads configuration"| node_settings
node_cache -->|"reads configuration"| node_settings
node_preflight -->|"reads model settings"| node_settings

click node_ui "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/app.py"
click node_flow_entry "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py"
click node_cache "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/answer_cache.py"
click node_translate "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py"
click node_understand "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/query.py"
click node_search "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py"
click node_context "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py"
click node_writer "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py"
click node_records "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/entries.py"
click node_ingest "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/ingest.py"
click node_mdn "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/mdn.py"
click node_node "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/node.py"
click node_python "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/python.py"
click node_store "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/store.py"
click node_settings "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/config.py"
click node_language_model "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/languages.py"
click node_preflight "https://github.com/luizcurti/crewai-local-docs-rag/blob/main/preflight.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_ui toneBlue
class node_flow_entry,node_cache,node_translate,node_understand,node_search,node_context,node_writer,node_language_model toneAmber
class node_records,node_ingest,node_mdn,node_node,node_python toneMint
class node_store,node_ollama,node_chromadb,node_settings,node_preflight toneRose
class node_user,node_docs toneIndigo
```

## Components

### Question interface

- [Streamlit UI](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/app.py): `app.py`

### Answer workflow

- [Answer entry](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py): `flow.py`
- [Answer cache](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/answer_cache.py): `answer_cache.py`
- [Question translation](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py): `flow.py`
- [Question analysis](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/query.py): `query.py`
- [Function and example search](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py): `flow.py`
- [Context assembly](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py): `flow.py`
- [Answer generation](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/flow.py): `flow.py`
- [Language registry](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/languages.py): `languages.py`

### Documentation indexing

- [Entry and example records](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/entries.py): `entries.py`
- [Ingestion coordinator](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/ingest.py): `ingest.py`
- [MDN parser](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/mdn.py): `sources/mdn.py`
- [Node.js parser](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/node.py): `sources/node.py`
- [Python parser](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/sources/python.py): `sources/python.py`

### Local runtime

- [Vector store](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/store.py): `store.py`
- **Local Ollama**
- **ChromaDB**
- [Shared settings](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/config.py): `config.py`
- [Service checks](https://github.com/luizcurti/crewai-local-docs-rag/blob/main/preflight.py): `preflight.py`

### Other components

- **Questioner**
- **Official docs**

## Connections

- Questioner → Streamlit UI: asks (evidence: `README.md`)
- Streamlit UI → Answer entry: calls (evidence: `app.py`)
- Answer entry → Answer cache: checks and stores (evidence: `flow.py`)
- Answer entry → Question translation: translates if needed (evidence: `README.md`)
- Answer entry → Question analysis: analyzes question (evidence: `README.md`)
- Answer entry → Function and example search: searches records (evidence: `README.md`)
- Answer entry → Context assembly: assembles context (evidence: `README.md`)
- Answer entry → Answer generation: writes answer (evidence: `README.md`)
- Function and example search → Vector store: queries (evidence: `flow.py`)
- Function and example search → Local Ollama: embeds query
- Context assembly → Vector store: loads examples (evidence: `store.py`)
- Answer generation → Local Ollama: generates with (evidence: `README.md`)
- Streamlit UI → Service checks: checks readiness (evidence: `app.py`)
- Answer entry → Service checks: checks services (evidence: `flow.py`)
- Question analysis → Language registry: uses language definitions (evidence: `query.py`)
- Streamlit UI → Language registry: displays language labels (evidence: `app.py`)
- Ingestion coordinator → MDN parser: loads source (evidence: `ingest.py`)
- Ingestion coordinator → Node.js parser: loads source (evidence: `ingest.py`)
- Ingestion coordinator → Python parser: loads source (evidence: `ingest.py`)
- MDN parser → Official docs: parses documentation (evidence: `sources/mdn.py`)
- Node.js parser → Official docs: parses documentation (evidence: `sources/node.py`)
- Python parser → Official docs: parses documentation (evidence: `sources/python.py`)
- MDN parser → Entry and example records: produces entries (evidence: `sources/mdn.py`)
- Node.js parser → Entry and example records: produces entries (evidence: `sources/node.py`)
- Python parser → Entry and example records: produces entries (evidence: `sources/python.py`)
- Ingestion coordinator → Entry and example records: serializes records (evidence: `ingest.py`)
- Ingestion coordinator → Vector store: writes index (evidence: `ingest.py`)
- Vector store → ChromaDB: persists vectors (evidence: `README.md`)
- Service checks → Vector store: checks index (evidence: `preflight.py`)
- Vector store → Shared settings: reads configuration (evidence: `store.py`)
- Answer cache → Shared settings: reads configuration (evidence: `answer_cache.py`)
- Service checks → Shared settings: reads model settings (evidence: `preflight.py`)
