How harsh-up3131/enterprise-rag-platform works
EKIP is a multi-tenant knowledge platform whose main workflow is document upload, background indexing, then permission-aware question answering with citations or abstention. Separate branches provide authentication and organization context, conversation history, evaluation, and tenant-security checks. The README documents capabilities beyond the sampled excerpts; those are represented where the tree supports a path, but their internal call relationships are omitted when not evidenced.
Main entry points: query_service.py Answer orchestration · retriever.py Hybrid retrieval · main.py FastAPI application · documents.py Document upload API
Components 30
User experience
- Web application
frontend/src/App.jsx - Chat and evidence
frontend/src/components/Chat.jsx - Frontend API client
frontend/src/api.js
API and tenancy
- FastAPI application
app/main.py - Authentication routes
app/api/routes/auth.py - Tenant request context
app/core/deps.py - JWT security
app/core/security.py - Relational and vector store
app/database.py
Document indexing
- Document upload API
app/api/routes/documents.py - Object storage
app/services/ingestion/storage.py - Background ingestion task
app/workers/tasks.py - Parse, chunk, embed
app/services/ingestion/pipeline.py
Grounded answering
- Question API
app/api/routes/query.py - Answer orchestration
app/services/query_service.py - Hybrid retrieval
app/services/retrieval/retriever.py - Keyword search
app/services/retrieval/lexical.py - Vector search
app/services/retrieval/dense.py - Rank fusion
app/services/retrieval/fusion.py - Reranking
app/services/retrieval/reranker.py - Prompt and LLM
app/services/generation/llm_client.py - Citation validation
app/services/generation/citation_validator.py - Input and output checks
app/services/generation/guardrails.py
Trust and evaluation
- Retrieval trace records
app/models/trace.py - Evaluation API
app/api/routes/eval.py - Evaluation runner
app/services/evaluation/runner.py - Security audit API
app/api/routes/security.py - Tenant isolation check
app/services/security/tenant_isolation_check.py
Other components
- User
- PostgreSQL with pgvector
- Ollama LLM
Connections 34
- User → Web application: uses
README.md - Web application → Frontend API client: requests
frontend/src/App.jsx - Web application → Chat and evidence: shows
- Frontend API client → FastAPI application: calls API
- FastAPI application → Authentication routes: registers
app/main.py - FastAPI application → Document upload API: registers
app/main.py - FastAPI application → Question API: registers
app/main.py - Authentication routes → JWT security: issues tokens
app/api/routes/auth.py - Tenant request context → JWT security: decodes tokens
app/core/deps.py - Document upload API → Tenant request context: resolves identity
app/api/routes/documents.py - Document upload API → Object storage: stores uploads
app/api/routes/documents.py - Document upload API → Background ingestion task: queues indexing
app/api/routes/documents.py - Background ingestion task → Parse, chunk, embed: runs task
app/workers/tasks.py - Parse, chunk, embed → Object storage: reads files
app/services/ingestion/pipeline.py - Parse, chunk, embed → Relational and vector store: writes chunks
app/services/ingestion/pipeline.py - Relational and vector store → PostgreSQL with pgvector: connects
app/database.py - Question API → Tenant request context: resolves identity
app/api/routes/query.py - Question API → Answer orchestration: answers question
app/api/routes/query.py - Answer orchestration → Input and output checks: checks input
app/services/query_service.py - Answer orchestration → Hybrid retrieval: retrieves evidence
app/services/query_service.py - Hybrid retrieval → Keyword search: searches terms
app/services/retrieval/retriever.py - Hybrid retrieval → Vector search: searches vectors
app/services/retrieval/retriever.py - Hybrid retrieval → Rank fusion: merges ranks
app/services/retrieval/retriever.py - Hybrid retrieval → Reranking: reranks candidates
app/services/retrieval/retriever.py - Vector search → Relational and vector store: queries vectors
app/services/retrieval/dense.py - Keyword search → Relational and vector store: queries text
app/services/retrieval/lexical.py - Answer orchestration → Prompt and LLM: generates answer
app/services/query_service.py - Prompt and LLM → Ollama LLM: sends prompts
- Answer orchestration → Citation validation: validates sources
app/services/query_service.py - Answer orchestration → Input and output checks: checks output
app/services/query_service.py - Answer orchestration → Retrieval trace records: persists trace
app/services/query_service.py - Evaluation API → Evaluation runner: runs evaluation
app/api/routes/eval.py - Security audit API → Tenant isolation check: runs check
app/api/routes/security.py - Tenant isolation check → Hybrid retrieval: tests isolation