Build a research agent that cites its sources
A good research agent doesn't just answer. It shows where the answer came from. In this tutorial we'll build one with Quotient search and any LLM that supports tool calls.
The loop
- Search the web for the user's question
- Scrape the top results as Markdown
- Ask the model to answer using only that content, citing each URL
- If the model asks for more, search again with its follow-up query
const results = await q.search(question, {
limit: 5,
scrapeOptions: { formats: ["markdown"] },
});Because search can return scraped content in the same call, step two is often free. Keep the context small by trimming each page to its most relevant sections.
Sam Rivera
Developer Relations, Quotient