forked from cardosofelipe/fast-next-template
[SPIKE-006] Knowledge Base with pgvector (RAG) #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Objective
Implement RAG-based knowledge base using PostgreSQL with pgvector extension.
Key Questions
Research Areas
Expected Deliverables
Acceptance Criteria
Labels
spike,architecture,knowledge-baseSPIKE-006 Completed: Knowledge Base with pgvector for RAG System
The comprehensive spike document has been created at
docs/spikes/SPIKE-006-knowledge-base-pgvector.md.Executive Summary
Recommendation: Use pgvector with hybrid search as the primary solution for Syndarix RAG:
Key Findings
1. Vector Database Comparison
2. Embedding Models Recommended
voyage/voyage-code-3(state-of-art for code retrieval)text-embedding-3-small(cost-effective, good quality)text-embedding-3-smallornomic-embed-text(local fallback)All integrated via LiteLLM for unified API.
3. Chunking Strategies
4. Hybrid Search Architecture
Research shows 2-3x reduction in hallucinations vs single-route retrieval.
5. Multi-Tenant Isolation
knowledge_chunkstable withproject_idandagent_idcolumns6. HNSW Index Configuration
Schema Design Included
knowledge_chunkstable with vector embedding, full-text searchknowledge_collectionsfor organizing chunksCode Examples Provided
KnowledgeBaseService- Main service with ingest/search methodsHybridSearchService- RRF-based hybrid searchPerformance Targets
Next Steps
Spike document:
docs/spikes/SPIKE-006-knowledge-base-pgvector.md