Knowledge Base
save_to_knowledge_base
Persist a fact or note to the agent knowledge base for future retrieval. Writes to the agent-notes FAISS sub-index when FAISS is available, and falls back to a JSONL log when it is not.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
content | string | Yes | — | The fact, finding, or note to persist |
source | string | No | "agent" | Origin label for the entry |
tags | array[string] | No | [] | Optional topic tags to attach to the entry |
Returns: Confirmation string on success, or an error message
query_knowledge_base
Search the knowledge base for information from uploaded documents. Searches all available FAISS indexes — both the global CLI index (data/vectordb/faiss_index/) and per-document API indexes (data/api/uploads/{doc_id}/vectordb/faiss_index/).
Requires: Vector store built with python cogtrix.py --ingest or documents uploaded via the API
Auto-activation: When a knowledge base exists, this tool is automatically pinned as active at startup (no need to load it via request_tools). Its description dynamically shows the number of indexes and total size.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
question | string | Yes | The question or topic to search for |
k | int | No | Number of results to return (default: 4, max: 10) |
Returns: Relevant document chunks with sources
See RAG_GUIDE.md for setup instructions.
Delegation
delegate_task
Delegate a single task to another LLM model.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
task | string | Yes | — | Task description |
context | string | No | "" | Relevant context/data for the task |
response_format | string | No | "text" | Expected format: text, json, code, markdown |
json_schema | string | No | — | Expected JSON structure (if response_format="json") |
provider | string | No | — | Provider name or alias |
model | string | No | — | Model alias or model name |
timeout | int | No | 60 | Timeout in seconds (10-600) |
temperature | float | No | 0.7 | Model temperature (0.0-2.0) |
use_tools | bool | No | true | Give the delegate access to tools. Set false for LLM-only tasks. |
Model Resolution:
model: "fast" → Uses string alias from config
model: "deep" → Uses object alias (with context_window, temperature)
model: "ollama/qwen3:8b" → Direct provider/model
model: "openai/gpt-4.1" → Direct provider/model
Object entries can override context_window, temperature, and timeout per model. Note: context_window is forwarded to Ollama as num_ctx and silently ignored for other providers. See Configuration: Models section for model entry format details and Delegate section for allowed_models restrictions.
delegate_parallel
Run multiple tasks in parallel across LLM models.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
tasks | array | Yes | List of task objects |
timeout | int | No | Timeout per task |
Task Object:
{
"task": "Summarize this article",
"model": "fast",
"context": "Article text here...",
"provider": "ollama",
"temperature": 0.5,
"response_format": "text",
"use_tools": true
}
Only task is required; other fields are optional.
Returns: List of results from all tasks
Agent Task Management
spawn_agent
Spawn a sub-agent to run a task independently and return a result.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
task | string | Yes | Task description for the sub-agent |
context | string | No | Additional context passed to the sub-agent |
model | string | No | Model override (default: inherits parent model) |
tools | array[string] | No | Tool names to expose to the sub-agent |
Returns: Task ID and initial status; poll get_task_result for the outcome.
get_task_status
Check the status of a spawned sub-agent task.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Task ID returned by spawn_agent |
Returns: Status string (running, completed, failed, cancelled) and timestamp.
get_task_result
Retrieve the result of a completed sub-agent task.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Task ID returned by spawn_agent |
Returns: Task result (string or object), error message if failed, and completion timestamp.
list_tasks
List all active sub-agent tasks.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter: running, completed, failed, or all (default: all) |
Returns: Table of task IDs, descriptions, statuses, and creation times.
cancel_task
Cancel a running sub-agent task.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Task ID to cancel |
Returns: Confirmation or error if task already completed.
Agent Messaging
send_to_agent
Send a message to another agent’s inbox.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
target_agent | string | Yes | Name or ID of the target agent |
message | string | Yes | Message content |
priority | string | No | high, normal, or low (default: normal) |
Returns: Confirmation with delivery timestamp.
read_agent_inbox
Read messages from the current agent’s inbox.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
unread_only | bool | No | Return only unread messages (default: false) |
limit | int | No | Maximum messages to return (default: 10) |
Returns: List of messages with sender, timestamp, content, and read status.
Self-Improvement
self_improve
Analyze recent errors and automatically generate improvements to tool prompts or agent behavior.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
error_summary | string | Yes | Description of the error or behavior to improve |
context | string | No | Additional context about when the error occurred |
Returns: Summary of changes made and which files were updated.
Deep Reasoning
deep_think
Tree-of-Thought with Chain-of-Thought Reflection engine for complex problems.
Also available as: /think <task> slash command (invokes deep_think directly, bypassing agent tool selection).
How It Works:
The engine runs multiple iterations, each with three phases:
- Branch — Generate N fundamentally different approaches (1 LLM call)
- Develop — Full Chain-of-Thought for each approach in parallel: Plan → Execute → Observe → Reflect (N parallel LLM calls)
- Converge — Evaluate all solutions, cross-pollinate best ideas, synthesize an improved solution (1 LLM call)
Between iterations, the reflection output feeds into the next branching phase, progressively refining the solution. Stops when confidence is high or max iterations reached.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
task | string | Yes | — | Problem to solve through deep reasoning |
context | string | No | "" | Additional context or constraints |
max_iterations | int | No | 3 | Reflection-revision cycles (1-5) |
num_branches | int | No | 3 | Parallel approaches per iteration (2-5) |
beam_width | int | No | 2 | Best paths to keep between iterations (1-3) |
LLM calls per iteration: N + 2 (where N = num_branches)
Typical duration: 1-5 minutes depending on model speed and parameters.
Returns: Structured analysis report with:
- Scored approaches from each iteration
- Reflection insights
- Final synthesized solution with confidence rating
When the LLM uses this tool automatically:
The agent is guided to use deep_think when it encounters:
- Problems with multiple valid approaches or significant trade-offs
- Requests for thorough analysis, deep research, or “think step by step”
- Architecture/design decisions, strategy planning
- Complex debugging where the root cause is unclear
- Comparing or evaluating multiple options systematically
In reasoning mode (-M reasoning), the agent receives extra encouragement to use this tool for decisions with trade-offs.
Example:
deep_think(
task="Design a caching strategy for a microservices architecture
with 50 services and mixed read/write workloads",
context="Budget: moderate. Must handle 10K req/s. Latency < 50ms.",
max_iterations=3,
num_branches=3
)