Skip to main content
There are two main optons to integrate Fast Agentic Search (FAS) into your agentic coding system.
  1. Call FAS as a preliminary subagent that collects context for the central agent.
  2. Allow the central agent to call FAS as a file exploration tool at any point in its loop.
In both, it’s important to format FAS results in a way the central agent can make use of it.

Subagent Formatting

In this pattern, you run FAS before the main agent loop starts. This is useful for “one-shot” tasks where the user’s intent is clearly to find or modify code (e.g., “Fix the bug in the auth service”). By pre-filling the context window with relevant file locations, you save the main agent from having to spend a turn asking for them.

Workflow

  1. Receive User Query: “How is the user session duration calculated?”
  2. Run FAS: Call repo.search() immediately with the user’s query.
  3. Hydrate Context: Append the search results to the system prompt or user message.
  4. Run Main Agent: The agent now has the answer in its context immediately.
This approach reduces latency for the user, as they don’t have to wait for the agent to “think” about searching—the search happens automatically.

Context hand-off

In this pattern, you convert FAS’s streaming output into a compressed trace format for LLM consumption. Transforming the stream into this format reduces duplication of effort (viewing the same files over again). The compressed trace format condenses consecutive events into a compact structure:
  • Assistant messages combine multiple tool calls into a single message.
  • Tool messages reference their corresponding assistant message using a tool_call_id.
This makes it easier for your agent to consume results without processing every individual event, while still retaining full context.
Example output:

Tool Approach

In this pattern, you expose FAS as a tool that your main agent can choose to invoke. This gives the agent autonomy to decide when it needs to search the codebase. This is ideal for multi-turn conversations where the agent might need to look up information dynamically based on intermediate reasoning.

Tool Definition

Define a tool (e.g., search_codebase) that wraps the FAS API.

Merging the Output

When the tool returns, you should format the results into a concise string that the model can digest. This effectively simulates the report_back behavior of the search agent.
Example output: