const deepResult = await exa.search("Who is the CEO of OpenAI?", { type: "deep", systemPrompt: "Prefer official sources and avoid duplicate results", outputSchema: { type: "object", properties: { leader: { type: "string" }, title: { type: "string" }, sourceCount: { type: "number" } }, required: ["leader", "title"] }, contents: { highlights: { maxCharacters: 4000 } }});console.log(deepResult.output?.content);
For deep search, keep outputSchema focused on output.content.
Use systemPrompt to guide both the search process and the final returned result.
Do not include citations/confidence in your schema; Exa returns grounding automatically in output.grounding.
Including citation/confidence fields in outputSchema duplicates data, reduces structure quality, and is usually less reliable.