Enhance OmniSearch for LLMs with limits and include_body flags

This commit is contained in:
Riz Ashraf committed 2026-09-27 09:31:58 +01:00
1 parent b7d1ae78db
commit 1ea635cdcc
2 files changed
+88 -2

No files matched your search

+22 -1
View File
@@ -69,6 +69,10 @@ pub struct SearchNodesTool {
pub query: String,
/// Optional namespace to restrict the search to.
pub namespace: Option<String>,
/// Limit the number of results to avoid context limit overflow. Defaults to 10.
pub limit: Option<usize>,
/// Include the full observations of the matched items. If false, returns only IDs and types (recommended for LLMs to prevent context bloat). Defaults to false.
pub include_body: Option<bool>,
}
/// Open and retrieve full details of specific nodes in the knowledge graph.
@@ -192,6 +196,10 @@ pub struct StoreSnippetTool {
pub struct SearchSnippetsTool {
/// The search query.
pub query: String,
/// Limit the number of results to avoid context limit overflow. Defaults to 5.
pub limit: Option<usize>,
/// Include the full code content of the matched items. If false, returns only IDs and descriptions (recommended for LLMs to prevent context bloat). Defaults to false.
pub include_body: Option<bool>,
}
/// Delete a stored code snippet.
@@ -219,6 +227,10 @@ pub struct LogDecisionTool {
pub struct QueryDecisionsTool {
/// Optional search query.
pub query: Option<String>,
/// Limit the number of results to avoid context limit overflow. Defaults to 5.
pub limit: Option<usize>,
/// Include the full body/content of the matched ADRs. If false, returns only titles and IDs (recommended for LLMs to prevent context bloat). Defaults to false.
pub include_body: Option<bool>,
}
/// Merge two entities in the knowledge graph into one.
@@ -265,6 +277,10 @@ pub struct LogErrorFixTool {
pub struct SearchErrorFixesTool {
/// The search query.
pub query: String,
/// Limit the number of results to avoid context limit overflow. Defaults to 5.
pub limit: Option<usize>,
/// Include the full solution details. If false, returns only error signatures (recommended for LLMs to prevent context bloat). Defaults to false.
pub include_body: Option<bool>,
}
/// Pin a file to keep it explicitly in the context workspace.
@@ -523,12 +539,17 @@ pub struct ListContextWorkspacesTool {
}
/// Search across all memory stores (Graph, Tasks, Snippets, ADRs, etc.).
/// Highly recommended for discovery. Supports Lucene query syntax.
#[derive(Debug, Deserialize, Serialize, JsonSchema)]
pub struct OmniSearchTool {
/// The search query.
/// The search query. Supports Lucene syntax (e.g., 'title:"auth" AND status:open').
pub query: String,
/// Optional namespace to restrict the search to.
pub namespace: Option<String>,
/// Limit the number of results per category to avoid context limit overflow. Defaults to 5.
pub limit: Option<usize>,
/// Include the full body/content of the matched items. If false, returns only IDs and titles (recommended for LLMs to prevent context bloat). Defaults to false.
pub include_body: Option<bool>,
}
/// Get a health digest of the project.