Skip to content

Agent Query

Use idx.agent.query(...) when users ask natural-language questions over an index. EigenLake inspects the index schema, chooses safe tools, builds filters, and returns grounded results.

result = idx.agent.query(
    "Find clusters of critical technical issue support tickets and show the main patterns.",
    limit=500,
    allowed_tools=["get_schema", "cluster", "filter_records"],
)

print(result["backend"])
print(result["result"])

For simpler requests, let the agent choose the tools:

result = idx.agent.query("show me recent battery failures")
print(result["result"])

Field Inference

The agent uses the index schema to infer fields. If your schema has fields such as priority, category, status, created_at, subject, and description, a query like:

show me recent critical technical failures

can map to filters similar to:

{
    "priority": {"$eq": "Critical"},
    "category": {"$eq": "Technical issue"},
}

Only fields declared in the schema are used. Clear field names and descriptions make agent results better.

Tool Control

By default, the agent may use all safe EigenLake tools. You can restrict tools for predictable workflows:

result = idx.agent.query(
    "Find the main patterns in recent failures.",
    allowed_tools=["get_schema", "cluster", "filter_records"],
    limit=1000,
)

Available tools include schema inspection, filtered record retrieval, clustering, anomaly detection, topic modeling, and temporal-shift analysis.

Output

The response includes the backend and model used by the server plus the agent's grounded result:

{
    "backend": "codex",
    "model": "gpt-5.5",
    "task": "...",
    "result": {
        "summary": "...",
        "findings": [],
        "tools_used": [],
        "next_steps": [],
    },
}