Skip to content

Agent Engine

Ghost includes a full agent engine that can reason, plan, and execute multi-step tasks using local AI models.

The agent follows a Reason + Act cycle:

User request
LLM reasons about the task
LLM selects a tool to call
Tool executes and returns results
LLM reasons about results
(repeat up to 10 iterations)
Final answer to user
ToolDescriptionSafety Tier
search_filesHybrid search across indexed documentsSafe
read_fileRead file contentsModerate
list_directoryList files in a directorySafe
get_system_infoHardware and platform infoSafe
get_index_statsDatabase statisticsSafe
web_searchWeb search via MCP serverModerate

Plus unlimited external tools via connected MCP servers.

Ghost uses a 3-tier risk classification:

  • Read-only operations
  • Search, list, stats queries
  • No user confirmation needed
  • File reads, especially sensitive paths
  • External API calls via MCP
  • Logged for transparency
  • File writes, deletes, or moves
  • Command execution
  • System modifications
  • Always asks for user confirmation

All conversations are persisted in SQLite:

  • Full message history with timestamps
  • FTS5 search across past conversations
  • CASCADE deletes for clean conversation management
  • Conversation summaries for context continuity

The agent automatically selects the best Qwen3 model for your hardware:

RAM → Model Tier
━━━━━━━━━━━━━━━━
2 GB → Qwen3-0.6B
4 GB → Qwen3-1.7B
6 GB → Qwen3-4B
10 GB → Qwen3-8B
18 GB → Qwen3-14B
36 GB → Qwen3-32B

All models support native tool calling — no prompt injection or regex parsing needed.