curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "relace-search",
"agent_inputs": {
"query": "Where in the project are global styles and UI components defined?"
},
"continue": false
}'
import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const repoId = "123e4567-e89b-12d3-a456-426614174000";
const results = client.repo.search(repoId, {
query: "Where in the project are global styles and UI components defined?",
});
for await (const event of results) {
console.log(event);
}
from relace import Relace
client = Relace(api_key="YOUR_API_KEY")
repo_id = "123e4567-e89b-12d3-a456-426614174000"
results = client.repo.search(repo_id, query="Where in the project are global styles and UI components defined?")
for event in results:
print(event)
event: started
data: {"prompt_id":"123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"name":"relace-search","content":"I'll explore the codebase to understand where global styles and UI components are defined. Let me first get an overview of the project structure to identify relevant directories and files.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" -o -name \"*.less\" | head -20"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*component*\" -o -name \"*ui*\" -o -name \"*style*\" | head -20"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: tool
data: {"name":"bash","command":"grep -r \"ThemeProvider\\|GlobalStyle\\|styled\\.\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: agent
data: {"name":"relace-search","content":"Based on the initial exploration, I can see this appears to be a React project with a structured component system. Let me dive deeper into the key areas that would contain global styles and UI components.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components"}
event: tool
data: {"name":"view_file","path":"/repo/src/index.css"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components/ui"}
event: tool
data: {"name":"view_file","path":"/repo/src/main.tsx"}
event: tool
data: {"name":"bash","command":"find /repo/src -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" | xargs ls -la"}
event: agent
data: {"name":"relace-search","content":"Let me also check for any theme-related files and the main app structure to better understand how global styles and UI components are organized.\n\n"}
event: tool
data: {"name":"bash","command":"find /repo -name \"*theme*\" -type f"}
event: tool
data: {"name":"view_file","path":"/repo/src/hooks/use-theme.tsx"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\\|ThemeProvider\\|styled\\.\" /repo/src --include=\"*.tsx\" --include=\"*.ts\" | head -10"}
event: tool
data: {"name":"view_file","path":"/repo/src/App.tsx"}
event: tool
data: {"name":"bash","command":"ls -la /repo/src/components/"}
event: agent
data: {"name":"relace-search","content":"Based on my exploration of the codebase, I now have a clear understanding of where global styles and UI components are defined. Let me report back with my findings.\n\n"}
event: tool
data: {"name":"report_back","explanation":"Based on my exploration of the codebase, I've identified the key locations where global styles and UI components are defined:\n\n1. **Global Styles**: The global styles are defined in `/src/index.css`. ...","files":{"src/index.css":[[1,100]],"src/components/ui":[[1,100]],"src/hooks/use-theme.tsx":[[1,100]],"src/components/theme-toggle.tsx":[[1,50]],"src/App.tsx":[[1,20]]}}
event: done
data: {}
Fast Agentic Search
Run fast agentic search on a Relace Repo
POST
/
v1
/
repo
/
{repo_id}
/
agent
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "relace-search",
"agent_inputs": {
"query": "Where in the project are global styles and UI components defined?"
},
"continue": false
}'
import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const repoId = "123e4567-e89b-12d3-a456-426614174000";
const results = client.repo.search(repoId, {
query: "Where in the project are global styles and UI components defined?",
});
for await (const event of results) {
console.log(event);
}
from relace import Relace
client = Relace(api_key="YOUR_API_KEY")
repo_id = "123e4567-e89b-12d3-a456-426614174000"
results = client.repo.search(repo_id, query="Where in the project are global styles and UI components defined?")
for event in results:
print(event)
event: started
data: {"prompt_id":"123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"name":"relace-search","content":"I'll explore the codebase to understand where global styles and UI components are defined. Let me first get an overview of the project structure to identify relevant directories and files.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" -o -name \"*.less\" | head -20"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*component*\" -o -name \"*ui*\" -o -name \"*style*\" | head -20"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: tool
data: {"name":"bash","command":"grep -r \"ThemeProvider\\|GlobalStyle\\|styled\\.\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: agent
data: {"name":"relace-search","content":"Based on the initial exploration, I can see this appears to be a React project with a structured component system. Let me dive deeper into the key areas that would contain global styles and UI components.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components"}
event: tool
data: {"name":"view_file","path":"/repo/src/index.css"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components/ui"}
event: tool
data: {"name":"view_file","path":"/repo/src/main.tsx"}
event: tool
data: {"name":"bash","command":"find /repo/src -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" | xargs ls -la"}
event: agent
data: {"name":"relace-search","content":"Let me also check for any theme-related files and the main app structure to better understand how global styles and UI components are organized.\n\n"}
event: tool
data: {"name":"bash","command":"find /repo -name \"*theme*\" -type f"}
event: tool
data: {"name":"view_file","path":"/repo/src/hooks/use-theme.tsx"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\\|ThemeProvider\\|styled\\.\" /repo/src --include=\"*.tsx\" --include=\"*.ts\" | head -10"}
event: tool
data: {"name":"view_file","path":"/repo/src/App.tsx"}
event: tool
data: {"name":"bash","command":"ls -la /repo/src/components/"}
event: agent
data: {"name":"relace-search","content":"Based on my exploration of the codebase, I now have a clear understanding of where global styles and UI components are defined. Let me report back with my findings.\n\n"}
event: tool
data: {"name":"report_back","explanation":"Based on my exploration of the codebase, I've identified the key locations where global styles and UI components are defined:\n\n1. **Global Styles**: The global styles are defined in `/src/index.css`. ...","files":{"src/index.css":[[1,100]],"src/components/ui":[[1,100]],"src/hooks/use-theme.tsx":[[1,100]],"src/components/theme-toggle.tsx":[[1,50]],"src/App.tsx":[[1,20]]}}
event: done
data: {}
Path Parameters
string
required
Repo ID
Request Body
object
required
Input parameters for the agent
Show properties
Show properties
string
required
The query or question to process with the agent
Response
The agent returns a Server-Sent Events (SSE) stream with real-time updates as parallel tool calls execute.Event Types
event
Signals that the agent execution has begun
Show properties
Show properties
string
Unique identifier for this agent execution session
event
event
Reports tool usage and execution results. Tools can include file operations, bash commands, directory views, and specialized operations like
report_back.Show properties
Show properties
string
Name of the tool being used (e.g., “view_directory”, “bash”, “view_file”, “report_back”)
string
File or directory path (for file/directory operations)
string
Shell command being executed (for bash tool)
string
Detailed explanation of findings (for report_back tool)
object
Map of file paths to line ranges referenced in the explanation (for report_back tool)
event
Signals that the agent execution has completed successfully
curl -X POST https://api.relace.run/v1/repo/123e4567-e89b-12d3-a456-426614174000/agent \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "relace-search",
"agent_inputs": {
"query": "Where in the project are global styles and UI components defined?"
},
"continue": false
}'
import { Relace } from "@relace-ai/relace";
const client = new Relace({ apiKey: "YOUR_API_KEY" });
const repoId = "123e4567-e89b-12d3-a456-426614174000";
const results = client.repo.search(repoId, {
query: "Where in the project are global styles and UI components defined?",
});
for await (const event of results) {
console.log(event);
}
from relace import Relace
client = Relace(api_key="YOUR_API_KEY")
repo_id = "123e4567-e89b-12d3-a456-426614174000"
results = client.repo.search(repo_id, query="Where in the project are global styles and UI components defined?")
for event in results:
print(event)
event: started
data: {"prompt_id":"123e4567-e89b-12d3-a456-426614174000"}
event: agent
data: {"name":"relace-search","content":"I'll explore the codebase to understand where global styles and UI components are defined. Let me first get an overview of the project structure to identify relevant directories and files.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" -o -name \"*.less\" | head -20"}
event: tool
data: {"name":"bash","command":"find /repo -type f -name \"*component*\" -o -name \"*ui*\" -o -name \"*style*\" | head -20"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: tool
data: {"name":"bash","command":"grep -r \"ThemeProvider\\|GlobalStyle\\|styled\\.\" /repo --include=\"*.js\" --include=\"*.ts\" --include=\"*.jsx\" --include=\"*.tsx\" | head -10"}
event: agent
data: {"name":"relace-search","content":"Based on the initial exploration, I can see this appears to be a React project with a structured component system. Let me dive deeper into the key areas that would contain global styles and UI components.\n\n"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components"}
event: tool
data: {"name":"view_file","path":"/repo/src/index.css"}
event: tool
data: {"name":"view_directory","path":"/repo/src/components/ui"}
event: tool
data: {"name":"view_file","path":"/repo/src/main.tsx"}
event: tool
data: {"name":"bash","command":"find /repo/src -name \"*.css\" -o -name \"*.scss\" -o -name \"*.sass\" | xargs ls -la"}
event: agent
data: {"name":"relace-search","content":"Let me also check for any theme-related files and the main app structure to better understand how global styles and UI components are organized.\n\n"}
event: tool
data: {"name":"bash","command":"find /repo -name \"*theme*\" -type f"}
event: tool
data: {"name":"view_file","path":"/repo/src/hooks/use-theme.tsx"}
event: tool
data: {"name":"bash","command":"grep -r \"global.*style\\|style.*global\\|ThemeProvider\\|styled\\.\" /repo/src --include=\"*.tsx\" --include=\"*.ts\" | head -10"}
event: tool
data: {"name":"view_file","path":"/repo/src/App.tsx"}
event: tool
data: {"name":"bash","command":"ls -la /repo/src/components/"}
event: agent
data: {"name":"relace-search","content":"Based on my exploration of the codebase, I now have a clear understanding of where global styles and UI components are defined. Let me report back with my findings.\n\n"}
event: tool
data: {"name":"report_back","explanation":"Based on my exploration of the codebase, I've identified the key locations where global styles and UI components are defined:\n\n1. **Global Styles**: The global styles are defined in `/src/index.css`. ...","files":{"src/index.css":[[1,100]],"src/components/ui":[[1,100]],"src/hooks/use-theme.tsx":[[1,100]],"src/components/theme-toggle.tsx":[[1,50]],"src/App.tsx":[[1,20]]}}
event: done
data: {}
⌘I