AI Search
Reasoning Search
Multi-turn AI agent that builds and runs the best possible search for you
POST
An AI agent reasons about your query, probes the database in real time, asks clarifying questions when needed, then runs the best final search. Unlike a one-shot search, Reasoning Search is conversational: you can answer questions and refine results across turns using the same
Clarification turns (
The three
A real stream looks like this:
session_id.
Credit Cost
| Item | Credits |
|---|---|
| Agent fee (per completed search) | 2 credits |
Result (enrich_live: false) | 0.75 credits per result |
Result (enrich_live: true) | 1.5 credits per result |
status: "needs_input") are free — the agent fee is only charged when a search actually runs.
Request Body
Natural language query (max 3000 characters). Required on the first call. On follow-up calls with a
session_id, use it to refine the previous search (e.g. "now only in San Francisco").Session identifier returned by a previous call. Send it back to answer questions or refine the same search.
Answers to the questions of a
needs_input turn, as {question_id: answer}.What to search:
"people" or "companies".Number of results for the final search (1–100).
If
true, results are enriched with fresh live data (1.5 credits per result instead of 0.75).Pagination: this endpoint always returns the first
max_results results. To get the next pages, take the applied_filters from the response and call /search/people or /search/companies with them, setting offset (e.g. offset: 25, offset: 50, …). You only pay the agent fee once — pagination is billed at the standard per-result rate.Flow
Send your query
POST /search/reasoning with query. The response is either complete (results) or needs_input (questions).Answer questions (if asked)
Send back
session_id + answers. The agent continues and returns results.Show the agent’s reasoning live (recommended)
POST /search/reasoning/stream takes the exact same body but returns Server-Sent Events, so your users see the agent think, probe the database and build the search in real time — instead of staring at a spinner for 20–60 seconds.
Events arrive in this order:
| Event | Payload | When |
|---|---|---|
step | {type: "thought" | "action" | "observation", ...} | Each reasoning step, live |
questions | {session_id, reasoning, questions} | The agent needs clarification |
result | {session_id, reasoning, applied_filters, category, total, count, has_next_page, credits_used, results} | Final results |
error | {message} | Something went wrong |
done | {} | Always last — close the stream |
step types map naturally to UI elements:
thought—{type, text}: the agent’s narration. Render as a status line.action—{type, tool, filters?, resolve?}: a database probe about to run (resolve_value,find_companies,probe_count,preview_results, then a finalsearch).filtersshows the exact filters being tested.observation—{type, tool, result}: the probe’s outcome, e.g.{"count": 183}for aprobe_count.
POST isn’t supported by EventSource, consume the stream with fetch:
Python
Response
"complete" (results below) or "needs_input" (answer the questions).Send it back to answer questions or refine the search.
Summary of what the agent searched for and why.
Only when
status is needs_input. Each question has id, text and optional suggestions (display them as choice chips in your UI).Only when
status is complete. The final filters built by the agent. You can reuse them directly on /search/people or /search/companies to paginate.Total number of matching results.
Number of results returned.
Total credits charged (agent fee + results).
Profiles or companies, same structure as
/search/people / /search/companies.
