deep_results = exa.search( "Who is the CEO of OpenAI?", type="deep", system_prompt="Prefer official sources and avoid duplicate results", output_schema={ "type": "object", "properties": { "leader": {"type": "string"}, "title": {"type": "string"}, "source_count": {"type": "number"} }, "required": ["leader", "title"] }, contents={"highlights": {"max_characters": 4000}})print(deep_results.output.content if deep_results.output else None)
For deep search, keep output_schema focused on the fields you want in output.content.
Use system_prompt to guide both the search process and the final returned result.
Do not add citations/confidence fields there; grounding is returned automatically in output.grounding.
Adding citation/confidence fields to output_schema creates duplicate data, weaker structure, and less reliable attribution.