Saguaro is designed to be the "Cortex" for other AI Agents. This guide explains how to integrate Saguaro into your agentic workflow.
All Saguaro commands support structured output, making them easy to parse.
saguaro query "database connection pool" --jsonOutput:
{
"matches": [
{
"file": "src/db/pool.py",
"score": 0.89,
"type": "class",
"line": 45
}
]
}Use the Standard Agent Interface (SSAI) to read code.
- Get Context:
saguaro agent skeleton path/to/file.py - Read Function:
saguaro agent slice ClassName.function
Saguaro exposes an MCP-compatible server.
saguaro serveThis starts a stdio or SSE server that exposing resources:
saguaro://query?q=...saguaro://file/...
For deep integration, import the saguaro package directly.
from saguaro.indexing.engine import IndexEngine
# Load existing index
engine = IndexEngine(repo_path=".")
# Vector Search
results = engine.search("authentication", k=5)
for res in results:
print(f"{res.file}: {res.score}")