Skip to main content

Module smart

Module smart 

Source
Expand description

Smart context selection for LLM workflows.

This module provides intelligent file selection based on:

  • Semantic search using embeddings
  • Call graph expansion (callers and callees)
  • Token budget management

§Usage

let config = SmartConfig::default();
let result = smart_context(&db, &analytics, &provider, "add caching", config)?;
for file in result.selected_files {
    println!("{}: {} tokens", file.path, file.token_count);
}

Structs§

FileSelection
A selected file with relevance information.
SmartConfig
Configuration for smart context selection.
SmartContext
Result of smart context selection.

Enums§

SelectionReason
Reason why a file was selected.

Functions§

format_dry_run
Format the smart context result for dry-run mode.
format_explain
Format the smart context result for display.
smart_context
Select files relevant to a task using semantic search and call graph analysis.
smart_context_with_embedding
Select files relevant to a task using a pre-computed embedding.