Skip to main content

Web research agent

An agent that searches the live web and reads pages before it answers.

This example: a research assistant for questions about recent events. It searches the web, reads the best pages, and answers with sources.

Example (replies vary)
You: What changed in the latest OpenAI API release?
Agent: The latest release adds ... and deprecates ... Key changes:
1. ...
2. ...
Sources: platform.openai.com/docs/changelog, openai.com/blog/...

research_sources:
[{"title": "API changelog", "url": "https://platform.openai.com/docs/changelog", ...}]
from custodian_labs import Custodian

app = Custodian(
model="gpt-6-luna",
system_prompt="You are a research assistant. Search the web when the answer depends "
"on recent events, read the most relevant pages, and cite your sources.",
tools=["web_search", "scrape_url"],
).deploy()

reply = app.chat("What changed in the latest OpenAI API release?")
print(reply.response)
print(reply.research_sources) # URLs the agent used, when it searched
Learn more
  • Built-in tools: how tool use works, every available tool and when the agent uses them.