Search & Retrieval

How ragistry finds the most relevant content for your queries

How It Works

The retrieval process combines semantic search with intelligent filtering:

  1. User query is converted to a vector (embedded)
  2. Vector similarity search finds top-K most relevant chunks
  3. Chunks are filtered by relevance and context
  4. 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