Skip to main content
If you’re using Fast Agentic Search outside of Relace Repos, you’ll need to build an agent harness equipped with a specific set of tools the underlying model was trained to use.

Agent Flow

First let’s understand how the search agent operates:
  • The inputs are: a codebase and a user_prompt
  • The agent is initialized with five search tools: view_file, view_directory, grep_search, bash, report_back
  • The system prompt defines the search task and how to format parallel tool calls
  • Agent goes through 4-5 turns of parallel tool calls to quickly explore codebase
  • Agent returns its findings with the report_back tool
You’ll need to define the schema for the search tools that you pass to the model, and actually write the code that implements these tool calls. Here’s an example of what the flow would look like: Example

Model Endpoint

If you already have an agent harness and want to get started quickly, you can try this OpenAI compatible endpoint.
Deviating from the toolsets & schemas defined in this guide can lead to unexpected behavior. The fast agentic search model is reinforced to correctly format tool calls with these specific parameters.

System Prompt

Use the following system prompt to configure the Fast Agentic Search agent:
Expandable

User Prompt Template

Structure your user prompts using the following template:
Expandable
Replace {{prompt}} with the actual user query (e.g., “Where is the authentication logic implemented?”) and {{repo_root}} with the root of the file directory where the codebase is located.

Tool Schema Definition

Below are the individual tool schema definitions that you can use in your OpenAI-compatible implementation.

Code Example with OpenAI SDK

Here’s the basic setup showing how to configure the agent with the tools.
Expandable

Tool Implementations

You must also implement the actual execution logic on your backend for each of the tools defined above. Here are some example implementations:

Parallel Tool Calling

The agent harness must support parallel tool execution to achieve optimal performance. Since each tool call can take up to ~1-2 seconds depending on the repository size, and the model typically makes 4-12 tool calls per turn, parallel execution provides substantial speed improvements—potentially reducing response times from 12-24 seconds down to 1-2 seconds per turn.

Relace Repos

The agent harness within Relace Repos is specifically optimized for Fast Agentic Search performance. You can run it on any Relace Repo with:
To reduce overhead, we:
  • Optimized file system operations on large repositories
  • Overlapped sandbox creation with the first generation turn
  • Co-locate sandboxes, repos, and agent runtime container to minimize network I/O latency