Skip to main content

Module search_api

Module search_api 

Source
Expand description

Search API endpoints — hybrid semantic + keyword search across conversations.

When a query comes in:

  1. Generate an embedding for the query via llama-server /v1/embeddings
  2. Search HNSW index for semantically similar messages (cosine similarity)
  3. Fall back to keyword search if embeddings are unavailable
  4. Merge and rank results by combined relevance score

Structs§

SearchRequest
Search request payload
SearchResponse
Search response
SearchResult
Individual search result

Functions§

search
Search endpoint handler — hybrid semantic + keyword search