Simple research agents

The original and default research agent: a plain tool-calling loop that searches the web, reads pages, uses your knowledge base and can run in Modal. Runs, states, agent definitions, the API, cost and isolation are shared with the investigative agents and described on the main page.

A plain tool-calling loop

This is the simple loop, the default (loop = "simple"); the investigative agents use another loop. No agent framework. An agent is a model, a system prompt, a list of tools and three limits (model, answer size, steps). Each step is one model call.

1. Ask

Send the conversation so far to the model (Anthropic's Messages API) with the tool list.

2. Run the tools

Run every tool the model asked for, one after the other, and send the results back in the next turn. A tool that fails (a page that cannot be read, a search that errors) is not a failed run: the error is sent to the model, which decides what to do.

3. Repeat or report

If the model asked for no tool, its text is the report. Otherwise go back to 1.

The last step cannot use tools: at step max_steps the request carries tool_choice: none, so a run always ends with a report (or an error). A narrow question usually ends well before; a broad topic uses every step. The conversation only grows: nothing is summarised or dropped, so later steps cost more input tokens than early ones. That is why the number of steps is capped (default 20, at most 40) and why the text of a page is cut. It needs an Anthropic API key (ANTHROPIC_API_KEY or anthropic_api_key in gligabao.toml); without it a research cannot start (503).

What it is told to do

The system prompt is all that steers it, besides max_steps. How many searches and pages it uses, and when it stops, is the model's decision.

Research

Search the web several times with different queries, read the most relevant pages with fetch_url, check claims against more than one source, and stop when it can answer well.

Write a report

A short summary first, then the details, then the list of source URLs used. It says what it could not find out and never guesses. The user turn is the topic as given.

Use the knowledge base

query it before searching the web and to check what it found against it; remember the important parts (short self-contained snippets, never whole pages) with the URL as the source.

Its tools

Two web tools, and, when the server has an LLM for the memory, two for the internal knowledge base.

ToolInputWhat it does
web_search{"query"}Not a bare search engine: a separate call to Anthropic's cloud web search tool (web_search_20250305), with at most 2 searches, 1024 output tokens and a summary of at most 300 words with the facts and dates. The agent sees only that briefing and the Sources: (one line per page: URL and title), never raw results. $0.01 per search on top of the tokens.
fetch_url{"url"}A plain GET (redirects followed, no cookies, no JavaScript) of an http:// or https:// URL. At most 1 MiB is downloaded and the HTML is turned into text crudely on purpose (scripts, styles and tags removed). The model gets the first 15,000 characters. A status other than 200 is an error the model is told about.
query{"question"}Asks the internal knowledge base of the user who started the run, in the run's dataset: the same pipeline as POST /v1/gb/query, run in process. Returns the answer and the facts it is based on (at most 15). A dataset that does not exist yet answers that the knowledge base is empty.
remember{"text", "source", "sync"}Submits a snippet (at most 20,000 characters, Source: <url> put in front) to the remember manager as the user. sync=false (default) returns as soon as the text is queued and the agent goes on; sync=true blocks until it is stored, for when the agent needs it right away to query for it.

fetch_url fetches whatever URL the model chooses, from the machine gligabao runs on, with no allow-list: a page on a private network is reachable if the server can reach it. Keep that in mind where the topic comes from untrusted users.

Sub-agents

The simple loop works alone. The model-driven sub-agents it had before (spawn_subagent, wait_subagents and the [spawn] roles of a definition) were removed in 0.189.0: a file that still has [spawn] does not load. An agent that needs parallel decomposition uses the investigative loop, which runs independent questions of its frontier in sub-agents (workers) that its code starts, so the model has no tool to start one. Runs made by the old sub-agents stay readable (their parent_id, name and reason, and their old states) and show in the list and the admin UI like any run.

The prompts are Markdown files in internal/agent/prompts/, embedded in the binary: the base, the knowledge base and the prompt of a worker of the investigative loop.

In the server or in Modal

A research has a runner, chosen when it is started (runner in the REST body, --runner in the CLI, research_start, or the choice in the admin UI). local (the default) runs the agent as a goroutine of the server. modal runs the gligabao_agent binary in a Modal container, started through the sidecar the way training jobs are. The run is recorded the same way, and REST, MCP, the CLI and the admin UI see the same run and states; only runner differs. A bad value is a 400.

Followed like a local run

The server follows the job's event stream and writes what the container reports: the states every agent enters (the simple loop has no sub-agents any more, and the investigative loop is not supported by this runner), the usage (live) and the report. Stopping it from the admin UI cancels the job in Modal.

Its own keys and knowledge base

The container uses the keys of a Modal secret (SIDECAR_AGENT_SECRET: ANTHROPIC_API_KEY and OPENAI_API_KEY), so the server needs no Anthropic key to start it. While the agent works its knowledge base is the container's own (empty at the start, not a copy of yours).

What comes back

When the job ends (also if it failed or was stopped) the agent hands its state over as one archive, and the server loads it into its own databases as the state importing, before the run ends. Entities and time series are merged into those the dataset already has; artifacts, facts, images, model calls with their costs and the remember and query runs are added with new IDs and every reference remapped; the embeddings go to the server's vector store. Provenance and the temporal plot work as for a local run.

Setting it up

A static Linux x86-64 gligabao_agent is needed (the build produces it, and the sidecar image has it too); create the Modal secret, set SIDECAR_AGENT_SECRET, and deploy the Modal app again so the binary is baked in. Without it a modal research answers 503.

Not followed again after a restart of the server: such a job runs on until it ends or times out (SIDECAR_AGENT_TIMEOUT_S, 30 minutes by default), and what it learned is lost.