Prerequisites
- Sign up for a Relace account.
- Create an API key.
- Install the Relace TypeScript SDK:
npm install @relace-ai/relace
1
Transfer Existing Source to Relace
Start by transferring your existing repositories to Relace.Keep track of the Relace
repo_id in your database for future reference. You can optionally include a metadata parameter to add any properties of repos you want to maintain.If you have a lot of repos to transfer, you’ll have to perform this step in batches. See the policies section for information on rate limits.2
Create New Relace Repos
For creating new repositories, we recommend using Relace Templates to minimize repo creation latency. However, you can also use the same functions above.
3
Integrate Repos with Your Agent
Now that your repositories live in Relace, you can integrate them with your agent’s local file system. You can fetch the stored files directly from our API without needing to setup git on your host:After your agent modifies files, push the changes back to Relace. You can either update specific files or overwrite all repository content.The update operation will return a response with the new head of the repo:
4
Use Built-In Agentic Search
Repositories stored in Relace can be searched with our fast agentic search agent, which always runs on the current state of the code. Use the search endpoint as an agent tool to find files based on relevance to a user query.The response will be a stream of Server-Sent Events with real-time updates as the agent explores the repo. The final For more details, see our search guide.
report_back event provides an explanation of the findings and the relevant files with line ranges.