A production-ready Modular RAG (Retrieval-Augmented Generation) system built with NestJS and PostgreSQL.
- Vector-First Retrieval: Native integration with
pgvectorfor scalable semantic search. - Reliability Layer: Built-in confidence scoring engine to validate AI outputs and prevent hallucinations.
- Operator Handover Protocol: Standardized flag system for escalating low-confidence queries to human support (CRM/Chatwoot compatible).
- Background Processing: Decoupled document indexing and embedding generation via BullMQ/Redis.
- Knowledge Ingestion: Advanced pipeline for processing unstructured data (PDF, DOCX, TXT).
- Framework: NestJS & TypeScript
- Persistence: PostgreSQL + pgvector
- Workflow: BullMQ (Redis)
- Intelligence: OpenAI / Anthropic / Custom LLM Bridges
The system is designed as a standalone "Core Engine" that communicates with integration bridges. It focuses on the logic of retrieval, scoring, and response generation, ensuring high modularity and ease of maintenance.