How tedawf/tacos works
TACOS is a FastAPI backend for Obsidian/CouchDB content sync, a blog and image API, and RAG-based portfolio chat/search. Its main content path is CouchDB change listening, parsing and chunking documents, embedding them, then storing vectors in Postgres; its query path retrieves relevant content and streams an OpenAI response. The blog API separately reads posts and view counts from CouchDB and Postgres. The README documents these capabilities; some subsystem wiring is inferred from the documented behavior because its implementation was not sampled.
Main entry points: docs_ingester.py Document ingester · rag_service.py RAG service · posts_service.py Posts service · base.py Postgres pgvector
Components 24
Content Sync
- Change listener
app/services/couchdb_listener.py - Document ingester
app/services/docs_ingester.py - Content parser
app/services/content_parser.py - Content enhancer
app/services/content_enhancer.py - Text embedder
app/services/text_embedder.py
Blog API
- Posts endpoints
app/routers/posts.py - Posts service
app/services/posts_service.py - Couch posts repo
app/repos/posts_repo.py - Post view service
app/services/post_view_service.py - Image endpoint
app/routers/images.py - Image service
app/services/image_service.py
RAG Chat
- RAG endpoints
app/routers/rag.py - RAG service
app/services/rag_service.py - Query expander
app/services/query_expander.py - Chat logger
app/services/chat_logger.py
Persistence
- Postgres pgvector
app/db/postgres/base.py - Document model
app/models/doc.py - Chat history model
app/models/chat.py - Post views model
app/models/post_view.py
Other components
- Obsidian LiveSync
- CouchDB
- FastAPI app
app/main.py - Site visitors
- OpenAI API
Connections 30
- Obsidian LiveSync → CouchDB: syncs content
- FastAPI app → Change listener: starts listener
- Change listener → CouchDB: reads changes
- Change listener → Document ingester: dispatches docs
- Document ingester → Content parser: parses markdown
- Document ingester → Content enhancer: enhances chunks
- Document ingester → Text embedder: embeds chunks
- Document ingester → Postgres pgvector: writes vectors
- Site visitors → Posts endpoints: requests posts
- Posts endpoints → Posts service: delegates
- Posts service → Couch posts repo: loads posts
- Couch posts repo → CouchDB: reads documents
- Posts service → Content parser: parses content
- Posts service → Post view service: loads counts
- Post view service → Postgres pgvector: reads counts
- Site visitors → Image endpoint: requests image
- Image endpoint → Image service: serves image
- Image service → CouchDB: reads image
- Site visitors → RAG endpoints: asks question
- RAG endpoints → RAG service: searches and streams
- RAG endpoints → Chat logger: records turns
- RAG service → Query expander: expands query
- RAG service → Text embedder: embeds query
- RAG service → Postgres pgvector: searches vectors
- RAG service → OpenAI API: streams answer
- Chat logger → Postgres pgvector: stores history
- Chat logger → Chat history model: persists messages
- Posts service → Post views model: counts views
- Document ingester → Document model: stores chunks
- RAG service → Document model: retrieves context