How rhithor/obsidian-engine works
Obsidian Engine is a document-grounded Q&A application: users upload PDFs, which are chunked and indexed per document, then select a collection and receive streaming answers with source metadata. The graph follows the sampled endpoint ownership and calls. README-documented scrubbing and summary endpoints are included; their wiring is explicit in main.py, though model files beyond the sampled request schemas were not inspected.
Main entry points: main.py FastAPI endpoints · api.ts API client · ai_service.py RAG and summary chains · App.tsx Chat and sidebar
Components 18
Chat client
- Chat and sidebar
frontend/src/App.tsx - API client
frontend/src/api.ts - Chat results
frontend/src/App.tsx
API orchestration
- FastAPI endpoints
backend/main.py - Ingest schemas
backend/models/ingest.py - Query schema
backend/models/query.py - Health schema
backend/models/health.py - Privacy schemas
backend/models/privacy.py
Document indexing
- PDF chunking
backend/services/ingestion_service.py - Vector collections
backend/database/db.py - ChromaDB store
backend/chroma_data - Context retrieval
backend/database/db.py
Retrieval and AI
- RAG and summary chains
backend/services/ai_service.py - Configured LLM
Privacy tools
- PII scrubbing
backend/services/privacy_service.py - Presidio engines
Other components
- User
- PDF upload
Connections 22
- User → Chat and sidebar: uses
- Chat and sidebar → API client: requests
- API client → FastAPI endpoints: HTTP calls
- PDF upload → API client: uploads
- FastAPI endpoints → Ingest schemas: validates response
- FastAPI endpoints → Query schema: validates query
- FastAPI endpoints → Health schema: returns health
- FastAPI endpoints → Privacy schemas: returns privacy
- FastAPI endpoints → PDF chunking: dispatches indexing
- FastAPI endpoints → Vector collections: manages collections
- PDF chunking → Vector collections: adds chunks
- Vector collections → ChromaDB store: reads and writes
- FastAPI endpoints → Context retrieval: requests context
- Context retrieval → ChromaDB store: queries chunks
- FastAPI endpoints → RAG and summary chains: requests answers
- RAG and summary chains → Configured LLM: invokes chains
- FastAPI endpoints → PII scrubbing: scrubs text
- PII scrubbing → Presidio engines: analyzes and anonymizes
- PII scrubbing → RAG and summary chains: summary input
- FastAPI endpoints → RAG and summary chains: checks provider health
- API client → Chat results: streams tokens and sources
- Chat and sidebar → Chat results: updates