Retrieval Pipeline

User Query → Auth API (optional) → Vector Search (FAISS/ChromaDB/External) → Context API (reranking) → LLM Inference → Response

The pipeline is fully pluggable: each stage can be configured independently via the RAG configuration hub.

Supported Providers

ProviderTypeDescription
FAISSLocalFacebook AI Similarity Search — fast in-memory vector retrieval
CHROMADBLocalChromaDB — persistent vector storage with metadata filtering
EXTERNAL_APIRemoteExternal RAG API provider for enterprise deployments

Core Services

ServiceKey ClassResponsibility
rag_service.pyRAGServiceUnified retrieval API across all providers
rag_access_service.pyRAGAccessServicePer-user access control for collections
rag_environment.pyget_rag_env()RAG virtual environment lifecycle
rag_environment_manager.pyRAGEnvironmentManagerPackage installation and readiness
rag_cluster_manager.pyRAGClusterManagerDistributed cluster orchestration
rag_cluster_environment.pyget_rag_cluster_env()Cluster environment management
rag_worker.pyRAG workerBackground processing for sync and indexing
rag_providers/Provider implementationsFAISS, ChromaDB, External API backends

RAG Sub-Routes (all under /rag)

The most comprehensive service in the platform with 30+ route modules:

Sub-routePurpose
overview_pagesPhased overview (A=setup, B=packages, C=databases list)
collection_pagesCollection CRUD, detail view, document listing
config_hubConfiguration hub for providers, embeddings, retrieval, pipeline
config_providerProvider selection (FAISS/ChromaDB/External)
config_embeddingEmbedding model configuration
config_retrievalRetrieval strategy configuration
config_pipelinePipeline orchestration configuration
chunk_templatesChunking strategy templates (medical, legal, financial, etc.)
collectionsCollection lifecycle management
documentsDocument upload, indexing, deletion
sync_jobsSync job scheduling and history
analyticsUsage metrics and analytics
evaluationRAG quality testing and validation

Distributed RAG Clustering

Topologies

ModeDescription
STANDALONESingle-node RAG instance
BACKUPRead-only replica for high availability
LOAD_DISTRIBUTIONMulti-node query load balancing

Cluster Routes

BlueprintURL PrefixPurpose
rag_cluster/rag-clusterCluster management overview
rag_cluster_discovery/api/rag/cluster/discoveryMulti-host discovery
rag_cluster_network/api/rag/cluster/syncInter-host network communication
rag_cluster_sync_mgmt/api/rag/cluster/sync-mgmtSync management and monitoring
rag_cluster_health/api/rag/cluster/healthHealth monitoring and alerts
rag_cluster_admin/admin/rag/clusterFailover controls, demotion, conflict resolution

Resilience Features

  • Network Partition Handling — Majority-wins resolution strategy
  • Health Monitoring — CPU, memory, and query performance metrics per node
  • Sync Tracking — DistributedSyncLog and ClusterInstanceSyncLog
  • Document Conflict Resolution — Majority-wins, manual, timestamp-based strategies

Graph Extraction

RAG supports knowledge graph extraction from documents with community detection:

  • Entities & Relationships — Automatic extraction from text
  • Text Unit Linking — Entities linked to source text units
  • Community Detection — Group-related entities and generate reports
  • Graph Profiles — Configurable extraction profiles for different domains