Skip to main content

Crate cp_query

Crate cp_query 

Source
Expand description

CP Query - RAG query engine

Provides semantic search and chat over the knowledge graph.

Per CP-012/CP-020: Supports filtered retrieval and query caching.

Structs§

Citation
A citation linking response text to source chunks
GenerationResult
Result of an LLM generation
Message
A chat message
OllamaGenerator
Ollama-based LLM generator (for desktop/server use)
QueryCache
Query cache for storing search results
QueryEngine
Query engine for semantic search
SearchResult
Search result with relevance score
ValidationResult
Result of response validation

Enums§

Filter
Filter for search queries
Role
Chat message role

Traits§

IntelligenceEngine
Trait for the CP Intelligence Module (IM)

Functions§

extract_citations
Extract citations by finding n-gram overlaps between response and context
validate_response
Validate a response for potential hallucinations