curl --request POST \
--url https://app.codealive.ai/api/tools/semantic_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "How does task execution work?",
"data_sources": [
"CodeAlive-AI/agent-framework"
]
}
'import requests
url = "https://app.codealive.ai/api/tools/semantic_search"
payload = {
"question": "How does task execution work?",
"data_sources": ["CodeAlive-AI/agent-framework"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: 'How does task execution work?',
data_sources: ['CodeAlive-AI/agent-framework']
})
};
fetch('https://app.codealive.ai/api/tools/semantic_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.codealive.ai/api/tools/semantic_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question' => 'How does task execution work?',
'data_sources' => [
'CodeAlive-AI/agent-framework'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.codealive.ai/api/tools/semantic_search"
payload := strings.NewReader("{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.codealive.ai/api/tools/semantic_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/semantic_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"results": [
{
"kind": "method",
"dataSource": {
"type": "Repository",
"id": "665f1c2ab3e77d0c9a1b4d21",
"name": "agent-framework"
},
"identifier": "CodeAlive-AI/agent-framework::src/executor.py::TaskExecutor.run",
"location": {
"path": "src/executor.py",
"range": {
"start": {
"line": 42,
"character": 0
},
"end": {
"line": 88,
"character": 0
}
}
},
"score": 0.91,
"description": "Executes a queued task through retry and telemetry wrappers.",
"contentByteSize": 2048
}
]
},
"rendered": "<semantic_search_results count=\"1\">\n <result identifier=\"CodeAlive-AI/agent-framework::src/executor.py::TaskExecutor.run\" kind=\"method\" path=\"src/executor.py\" source=\"agent-framework\">Executes a queued task through retry and telemetry wrappers.</result>\n</semantic_search_results>\nFetch relevant identifiers with fetch_artifacts or read local files before drawing conclusions."
}Semantic search
Searches indexed code by meaning rather than by exact text. This is the default first tool for behaviour, intent, mechanism, and architecture questions. Phrase question as a full natural-language English sentence — “How does task execution work?”, “Where is retry handling implemented?” — not as bare keywords; keyword strings sharply degrade recall. Keep identifiers and codebase-specific terms verbatim inside the sentence. For acronyms, exact names, error text, routes, or config keys, run grep_search alongside. Results carry stable artifact identifier values — pass them to fetch_artifacts to read the code, or to get_artifact_relationships to map callers and callees, before drawing conclusions from snippets.
curl --request POST \
--url https://app.codealive.ai/api/tools/semantic_search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question": "How does task execution work?",
"data_sources": [
"CodeAlive-AI/agent-framework"
]
}
'import requests
url = "https://app.codealive.ai/api/tools/semantic_search"
payload = {
"question": "How does task execution work?",
"data_sources": ["CodeAlive-AI/agent-framework"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question: 'How does task execution work?',
data_sources: ['CodeAlive-AI/agent-framework']
})
};
fetch('https://app.codealive.ai/api/tools/semantic_search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.codealive.ai/api/tools/semantic_search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'question' => 'How does task execution work?',
'data_sources' => [
'CodeAlive-AI/agent-framework'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.codealive.ai/api/tools/semantic_search"
payload := strings.NewReader("{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.codealive.ai/api/tools/semantic_search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.codealive.ai/api/tools/semantic_search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"question\": \"How does task execution work?\",\n \"data_sources\": [\n \"CodeAlive-AI/agent-framework\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"obj": {
"results": [
{
"kind": "method",
"dataSource": {
"type": "Repository",
"id": "665f1c2ab3e77d0c9a1b4d21",
"name": "agent-framework"
},
"identifier": "CodeAlive-AI/agent-framework::src/executor.py::TaskExecutor.run",
"location": {
"path": "src/executor.py",
"range": {
"start": {
"line": 42,
"character": 0
},
"end": {
"line": 88,
"character": 0
}
}
},
"score": 0.91,
"description": "Executes a queued task through retry and telemetry wrappers.",
"contentByteSize": 2048
}
]
},
"rendered": "<semantic_search_results count=\"1\">\n <result identifier=\"CodeAlive-AI/agent-framework::src/executor.py::TaskExecutor.run\" kind=\"method\" path=\"src/executor.py\" source=\"agent-framework\">Executes a queued task through retry and telemetry wrappers.</result>\n</semantic_search_results>\nFetch relevant identifiers with fetch_artifacts or read local files before drawing conclusions."
}Authorizations
Body
Response
Success envelope. obj is the result set: results[] with identifier, kind, dataSource, location.path plus line range, relevance score, and a short description/snippet; rendered is a <semantic_search_results> XML block with a follow-up hint. Repairable failures (missing or invalid arguments, ambiguous or unknown data sources) also return HTTP 200 with obj.error = { code, message, retry, try } and a rendered <tool_error> block; repair the arguments and retry.
Was this page helpful?