# lucifer516-sudoer/revolvo_api_deprecated architecture

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

- Interactive diagram: https://gitdiagram.com/lucifer516-sudoer/revolvo_api_deprecated
- Repository: https://github.com/lucifer516-sudoer/revolvo_api_deprecated

## Overview

Revolvo is a legacy backend for asking LLMs questions about PDF books, with a separate watched-folder ingestion workflow and a Streamlit proof of concept. In the documented runtime path, FastAPI serves book records and streamed PDF answers; the answer handler prepares a book’s documents and constructs a chat API with an LLM and Chroma store. The watcher also sends new PDFs to the document maker. Several source modules are only indexed, not excerpted, so their internal behavior and unshown links are intentionally omitted.

Main entry points: [`revolvo_api/main.py`](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/main.py) (FastAPI service), [`revolvo_api/automation/maker.py`](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/maker.py) (Document maker), [`revolvo_api/db/_db.py`](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/_db.py) (Batched embedding loader), [`revolvo_api/automation/registry.py`](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/registry.py) (Book registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_fastapi["FastAPI service<br/>[main.py]"]
  node_chat_api["Chat API<br/>[api.py]"]
  node_streamlit["Streamlit POC<br/>[ui_v2.py]"]
  node_helper["Embedder helper<br/>[helper_funcs.py]"]
end

subgraph group_ingestion["PDF ingestion"]
  node_watcher["PDF watcher"]
  node_pdf_folder["PDF folder"]
  node_maker["Document maker<br/>[maker.py]"]
  node_pdf_processor["PDF processor<br/>[from_pdf.py]"]
end

subgraph group_retrieval["Retrieval and storage"]
  node_embedding_manager["Embedding manager<br/>[manager.py]"]
  node_batch_loader["Batched embedding loader<br/>[_db.py]"]
  node_chroma[("Chroma vector store")]
  node_llm["Ollama chat model"]
end

subgraph group_operations["Records and logging"]
  node_registry["Book registry<br/>[registry.py]"]
  node_csv_access["CSV data access<br/>[_csv_db.py]"]
  node_pdf_record["PDF record model<br/>[_models.py]"]
  node_books_csv[("Books CSV")]
  node_logger["Logger configuration<br/>[logger.py]"]
  node_log_handler["Rich log handlers<br/>[_custom_handler.py]"]
end

node_user(("User"))

node_user -->|"requests"| node_fastapi
node_fastapi -->|"reads records"| node_registry
node_fastapi -->|"adds documents"| node_maker
node_fastapi -->|"creates and queries"| node_chat_api
node_fastapi -->|"configures model"| node_llm
node_fastapi -->|"configures store"| node_chroma
node_user -->|"uses POC"| node_streamlit
node_streamlit -->|"uses embedder"| node_helper
node_pdf_folder -->|"notifies of PDFs"| node_watcher
node_watcher -->|"submits PDF"| node_maker
node_maker -->|"loads and splits"| node_pdf_processor
node_maker -->|"adds documents"| node_batch_loader
node_batch_loader -->|"gets embedder"| node_embedding_manager
node_batch_loader -->|"writes embeddings"| node_chroma
node_registry -->|"reads and writes"| node_csv_access
node_registry -->|"constructs records"| node_pdf_record
node_csv_access -->|"reads and writes"| node_books_csv
node_logger -->|"configures handlers"| node_log_handler

click node_fastapi "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/main.py"
click node_chat_api "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/api.py"
click node_streamlit "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/ui_v2.py"
click node_helper "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/helper_funcs.py"
click node_watcher "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/observe_and_react.py"
click node_maker "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/maker.py"
click node_pdf_processor "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/processor/from_pdf.py"
click node_embedding_manager "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/embed/manager.py"
click node_batch_loader "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/_db.py"
click node_registry "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/registry.py"
click node_csv_access "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/csv_db/_csv_db.py"
click node_pdf_record "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/csv_db/_models.py"
click node_logger "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/utils/logging/logger.py"
click node_log_handler "https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/utils/logging/_custom_handler.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_fastapi,node_chat_api,node_streamlit,node_helper,node_user toneBlue
class node_watcher,node_pdf_folder,node_maker,node_pdf_processor toneAmber
class node_embedding_manager,node_batch_loader,node_chroma,node_llm toneMint
class node_registry,node_csv_access,node_pdf_record,node_books_csv,node_logger,node_log_handler toneRose
```

## Components

### User interfaces

- [FastAPI service](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/main.py): `revolvo_api/main.py`
- [Chat API](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/api.py): `revolvo_api/api.py`
- [Streamlit POC](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/ui_v2.py): `revolvo_api/ui_v2.py`
- [Embedder helper](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/helper_funcs.py): `revolvo_api/helper_funcs.py`

### PDF ingestion

- [PDF watcher](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/observe_and_react.py): `revolvo_api/automation/observe_and_react.py`
- **PDF folder**
- [Document maker](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/maker.py): `revolvo_api/automation/maker.py`
- [PDF processor](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/processor/from_pdf.py): `revolvo_api/processor/from_pdf.py`

### Retrieval and storage

- [Embedding manager](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/embed/manager.py): `revolvo_api/embed/manager.py`
- [Batched embedding loader](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/_db.py): `revolvo_api/db/_db.py`
- **Chroma vector store**
- **Ollama chat model**

### Records and logging

- [Book registry](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/automation/registry.py): `revolvo_api/automation/registry.py`
- [CSV data access](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/csv_db/_csv_db.py): `revolvo_api/db/csv_db/_csv_db.py`
- [PDF record model](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/db/csv_db/_models.py): `revolvo_api/db/csv_db/_models.py`
- **Books CSV**
- [Logger configuration](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/utils/logging/logger.py): `revolvo_api/utils/logging/logger.py`
- [Rich log handlers](https://github.com/lucifer516-sudoer/revolvo_api_deprecated/blob/main/revolvo_api/utils/logging/_custom_handler.py): `revolvo_api/utils/logging/_custom_handler.py`

### Other components

- **User**

## Connections

- User → FastAPI service: requests (evidence: `README.md`)
- FastAPI service → Book registry: reads records (evidence: `revolvo_api/main.py`)
- FastAPI service → Document maker: adds documents (evidence: `revolvo_api/main.py`)
- FastAPI service → Chat API: creates and queries (evidence: `revolvo_api/main.py`)
- FastAPI service → Ollama chat model: configures model (evidence: `revolvo_api/main.py`)
- FastAPI service → Chroma vector store: configures store (evidence: `revolvo_api/main.py`)
- User → Streamlit POC: uses POC (evidence: `README.md`)
- Streamlit POC → Embedder helper: uses embedder (evidence: `revolvo_api/ui_v2.py`)
- PDF folder → PDF watcher: notifies of PDFs (evidence: `revolvo_api/automation/observe_and_react.py`)
- PDF watcher → Document maker: submits PDF (evidence: `revolvo_api/automation/observe_and_react.py`)
- Document maker → PDF processor: loads and splits (evidence: `revolvo_api/automation/maker.py`)
- Document maker → Batched embedding loader: adds documents (evidence: `revolvo_api/automation/maker.py`)
- Batched embedding loader → Embedding manager: gets embedder (evidence: `revolvo_api/db/_db.py`)
- Batched embedding loader → Chroma vector store: writes embeddings (evidence: `revolvo_api/db/_db.py`)
- Book registry → CSV data access: reads and writes (evidence: `revolvo_api/automation/registry.py`)
- Book registry → PDF record model: constructs records (evidence: `revolvo_api/automation/registry.py`)
- CSV data access → Books CSV: reads and writes (evidence: `revolvo_api/db/csv_db/_csv_db.py`)
- Logger configuration → Rich log handlers: configures handlers (evidence: `revolvo_api/utils/logging/logger.py`)
