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
VerifiedRemoteResult
A verified remote result with its peer weight and origin.

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
merge_results
Merge local search results with verified remote results using cross-source Reciprocal Rank Fusion.
validate_response
Validate a response for potential hallucinations
verify_and_extract
Verify a remote SearchResponse and extract weighted results.