Skip to main content
POST
/
agents
/
search
Genai Search
curl --request POST \
  --url https://api.example.com/agents/search \
  --header 'Content-Type: application/json' \
  --data '
{
  "project_id": "<string>",
  "query": "",
  "trace_id": "<string>",
  "roles": [],
  "conversation_id": "<string>",
  "agent_name": "<string>",
  "provider_name": "<string>",
  "request_model": "<string>",
  "truncate_content": true,
  "started_after": "2023-11-07T05:31:56Z",
  "started_before": "2023-11-07T05:31:56Z",
  "limit": 20,
  "offset": 0
}
'
{
  "results": [
    {
      "conversation_id": "<string>",
      "conversation_name": "<string>",
      "agent_name": "<string>",
      "matched_messages": [
        {
          "span_id": "<string>",
          "trace_id": "<string>",
          "content_preview": "<string>",
          "content_digest": "<string>",
          "started_at": "2023-11-07T05:31:56Z"
        }
      ],
      "last_activity": "2023-11-07T05:31:56Z"
    }
  ],
  "total_conversations": 0
}

Body

application/json

Query the messages table by content and/or span-level filters.

Scans the messages table (one row per message occurrence, populated by an MV from spans) and returns matching span-level hits. Full-text search sets query; structured retrieval (e.g. all messages in a trace) leaves query empty and uses the filters below. The caller groups by conversation for the response shape.

project_id
string
required
query
string
default:""
trace_id
string | null
roles
enum<string>[] | null
Available options:
,
user,
assistant,
system,
tool,
tool_call,
tool_result
conversation_id
string | null
agent_name
string | null
provider_name
string | null
request_model
string | null
truncate_content
boolean
default:true
started_after
string<date-time> | null
started_before
string<date-time> | null
limit
integer
default:20
Required range: 0 <= x <= 1000
offset
integer
default:0
Required range: x >= 0

Response

Successful Response

Response from a full-text search across agent messages.

results
AgentSearchConversationResult · object[]
required
total_conversations
integer
default:0