Basic search
A search request requires two fields:objective: a short sentence describing what you’re looking forcontext: a more detailed description of your query, including any relevant background
Response
| Field | Description |
|---|---|
session_id | Unique identifier for this search session. |
status | completed or failed. Multi-turn searches may also return clarification_needed. |
documents_scanned | Number of documents examined during the search. |
queries_executed | Number of search queries run internally. |
synthesis | A natural language summary that answers your query, citing the results. |
results | Array of findings, each with a finding summary, source id, and relevant excerpts. |
clarification_needed | Present when the search needs more information. See multi-turn search. |
Streaming
Setstream: true to receive server-sent events with real-time progress updates.
| Event | Description |
|---|---|
status | Progress update with a message field (e.g., "Searching documents...") |
session_result | Final result object, same shape as the non-streaming response |
error | Error with a code field |
Filters
Narrow search results using attribute filters. Only attributes marked asis_filterable in the namespace schema can be filtered on.
Including document attributes
Setinclude_attributes: true to include the full document attributes in each result:
attributes object containing all of the source document’s fields.
Multi-turn search
Setmultiturn: true to enable multi-turn mode. When Charcoal needs more information to answer your query, the response will have status: "clarification_needed" with a question and optional suggested answers.