How umr-se/knowflow works
KnowFlow is a local document-chat application: users upload supported files, ask questions, and receive answers grounded in retrieved passages with citations, or a general local-model response when retrieval finds no useful context. The graph follows the visible frontend-to-API workflow through ingestion and RAG, and includes conversation history and document management. README capabilities such as health/model status and broad file-format support are represented; implementation wiring beyond the supplied excerpts is omitted where uncertain.
Main entry points: db.py Database access · main.py API application · documents.py Document endpoints · chat.py Chat endpoint
Components 16
User interface
- Knowledge dashboard
frontend/components/Dashboard.tsx - App page
frontend/app/page.tsx
FastAPI endpoints
- API application
backend/app/main.py - Document endpoints
backend/app/api/documents.py - Chat endpoint
backend/app/api/chat.py - Conversation endpoints
backend/app/api/conversations.py
Document and RAG services
- File extraction
backend/app/services/ingestion.py - Text chunking
backend/app/services/chunking.py - Embedding generation
backend/app/services/embeddings.py - Vector retrieval
backend/app/services/retrieval.py - Answer generation
backend/app/services/llm.py
Persistence and models
- Database access
backend/app/db.py - PostgreSQL pgvector
- Ollama local model
- MiniLM model
Other components
- User
Connections 22
- User → Knowledge dashboard: uses
- App page → Knowledge dashboard: renders
- Knowledge dashboard → Document endpoints: uploads, lists, deletes
- Knowledge dashboard → Chat endpoint: asks questions
- API application → Document endpoints: registers
- API application → Chat endpoint: registers
- API application → Conversation endpoints: registers
- API application → Database access: initializes schema
- Document endpoints → File extraction: extracts and chunks
- File extraction → Text chunking: splits text
- Document endpoints → Embedding generation: embeds chunks
- Document endpoints → Database access: stores and manages
- Chat endpoint → Database access: loads and saves history
- Chat endpoint → Vector retrieval: retrieves context
- Vector retrieval → Embedding generation: embeds query
- Vector retrieval → Database access: queries chunks
- Chat endpoint → Answer generation: generates answer
- Answer generation → Ollama local model: sends prompt
- Embedding generation → MiniLM model: encodes text
- Database access → PostgreSQL pgvector: reads and writes
- Conversation endpoints → Database access: reads conversations
- API application → Answer generation: checks model health