Skip to content

Query System

The query system provides standardized interfaces for agents to discover, retrieve, and rank knowledge from your kiln. It powers context enrichment — automatically providing relevant notes to agents during conversations.

Natural language queries that find conceptually related content:

"How does authentication work in this project?"
"Notes about deployment strategies"

Results ranked by semantic similarity using embeddings.

Precise filtering by tags, dates, or properties:

tag:#meeting AND created:2024-01
type:book AND rating:>4

Returns exact matches based on note metadata.

Combines semantic relevance with metadata constraints:

"authentication patterns" AND tag:#security

Prioritizes results satisfying both criteria.

Broad searches when investigating a topic:

  • Returns diverse results across related concepts
  • Includes unexpected but potentially relevant connections
  • Suggests follow-up queries and related topics

Specific information retrieval:

  • Prioritizes precision over recall
  • Supports exact matching
  • Includes confidence indicators

Time-based queries:

  • Filter by date ranges
  • Track concept evolution over time
  • Surface recent vs historical context

Results are ranked by multiple factors:

FactorDescription
RelevanceSemantic similarity to query
RecencyWhen the note was last modified
DiversityAvoiding topic concentration
ConnectionsLink density in knowledge graph

When you chat with an agent, the query system automatically:

  1. Analyzes conversation context
  2. Identifies relevant knowledge needs
  3. Retrieves and ranks matching notes
  4. Injects context into the agent’s prompt

This happens transparently — agents receive relevant knowledge without explicit queries.

When results exceed available context:

  • Most relevant results prioritized
  • Diversity maintained to cover different aspects
  • Summaries used for large documents

Agents automatically query your kiln during conversation. You can also explicitly request searches:

"Search my notes for React patterns"
"Find notes tagged #meeting from last week"

The semantic_search tool is available to agents:

{
"query": "authentication implementation",
"limit": 10,
"include_content": true
}
Terminal window
cru search "your query here"
cru search --tag meeting --since 2024-01-01
OperationTarget
Cached queries<100ms
Uncached queries<500ms
Large result setsStreamed progressively

Frequent query patterns are cached automatically.