How sohan1625/own-your-ai works
Own Your Intelligence is a local PDF question-answering app. Users upload PDFs, choose documents, and ask questions through a web UI; the API extracts page text, chunks it, indexes it, retrieves and fuses passages, then generates a grounded answer and resolves citations. PostgreSQL stores documents, chunks, embeddings, and chat history; local Ollama supplies embeddings and generation. The retrieval and answer path is documented in the README, while several API internals are only partially excerpted, so uncertain call links are omitted or marked unverified.
Main entry points: api.py FastAPI · db.py Persistence access · retrieve.py Keyword and vector search · index.html Web UI
Components 14
Document indexing
- PDF extraction
src/ingest.py - Text chunking
src/chunk.py - BM25 and embeddings
src/index.py
Search and answers
- Keyword and vector search
src/retrieve.py - Rank fusion
src/fuse.py - Grounded generation
src/answer.py - Citation resolution
src/cite.py
Local persistence
- Persistence access
src/db.py - PostgreSQL pgvector
- Answer cache
src/cache.py
Other components
- User
- Local Ollama
Connections 18
- User → Web UI: uses
README.md - Web UI → FastAPI: requests
- FastAPI → Web UI: serves
src/api.py - FastAPI → PDF extraction: extracts PDFs
README.md - FastAPI → Text chunking: chunks pages
src/api.py - FastAPI → BM25 and embeddings: embeds chunks
src/api.py - FastAPI → Persistence access: stores documents
src/api.py - Persistence access → PostgreSQL pgvector: reads and writes
src/db.py - FastAPI → Keyword and vector search: retrieves passages
README.md - Keyword and vector search → BM25 and embeddings: uses BM25 and embeddings
src/retrieve.py - FastAPI → Rank fusion: fuses rankings
README.md - FastAPI → Grounded generation: generates answer
README.md - Grounded generation → Local Ollama: calls local model
README.md - FastAPI → Citation resolution: resolves citations
README.md - FastAPI → Answer cache: checks and updates
src/api.py - BM25 and embeddings → Local Ollama: embeds text
src/index.py - Keyword and vector search → Persistence access: searches stored vectors
- FastAPI → Persistence access: loads chat history
README.md