Deep research agent
Plans web searches, runs them in parallel, writes a report and emails it from a Gradio app.
What it does
A planner agent with Pydantic structured output turns a query into a list of searches, and search agents run them concurrently with asyncio using OpenAI's hosted WebSearchTool. A writer agent produces a markdown report and an email agent sends it as HTML through SendGrid. Runs are inspected in OpenAI traces, exposed through a Gradio app and deployed to Hugging Face Spaces.
What was built
- 01
Planner agent returns a structured list of search items with reasons, set by a configurable search count.
- 02
Search agents run in parallel with asyncio and summarise results from the hosted web search tool.
- 03
Writer agent assembles a detailed markdown report from the summaries.
- 04
Email agent converts the report to HTML and sends it with a SendGrid tool.
- 05
Gradio app streams progress and the final report; the app is deployed to Hugging Face Spaces.
The pipeline, layer by layer
Five layers, one pipeline.
L1Input
- Gradio query box
L2Planning
- Planner agent
L3Research
- Parallel search agents
- Hosted web search
L4Output
- Writer agent report
- Email agent via SendGrid
L5Deploy
- Hugging Face Spaces