Search & Retrieval
How ragistry finds the most relevant content for your queries
How It Works
The retrieval process combines semantic search with intelligent filtering:
- User query is converted to a vector (embedded)
- Vector similarity search finds top-K most relevant chunks
- Chunks are filtered by relevance and context
- Best results are passed to the LLM for answer generation
Vector Search
ragistry uses pgvector for high-performance similarity searches. Cosine similarity between the query and stored chunks determines relevance, with higher values indicating better matches.
Relevance Ranking
Multiple factors influence the final ranking:
- Vector Similarity: Semantic proximity to the query
- Recency: Newer content is preferred
- Source Priority: Certain sources can be prioritized