openai-agents-python/examples/research_bot
nikkie d089886f01
examples(research_bot): Add space to INSTRUCTIONS (#439)
Thanks to awesome example `research_bot`

Fix andproduce and goodgrammar (and so on)

```python
>>> from examples.research_bot.agents import search_agent
>>> print(search_agent.INSTRUCTIONS)
You are a research assistant. Given a search term, you search the web for that term andproduce a concise summary of the results. The summary must 2-3 paragraphs and less than 300words. Capture the main points. Write succinctly, no need to have complete sentences or goodgrammar. This will be consumed by someone synthesizing a report, so its vital you capture theessence and ignore any fluff. Do not include any additional commentary other than the summaryitself.
```
2025-04-08 14:01:09 -04:00
..
agents examples(research_bot): Add space to INSTRUCTIONS (#439) 2025-04-08 14:01:09 -04:00
sample_outputs Fix: Correct the trace path in examples (#395) 2025-04-01 11:51:52 -04:00
__init__.py Initial commit 2025-03-11 09:42:28 -07:00
main.py Initial commit 2025-03-11 09:42:28 -07:00
manager.py Fix: Correct the trace path in examples (#395) 2025-04-01 11:51:52 -04:00
printer.py Initial commit 2025-03-11 09:42:28 -07:00
README.md docs: Fix typos in documentation files 2025-03-12 00:12:31 +01:00

Research bot

This is a simple example of a multi-agent research bot. To run it:

python -m examples.research_bot.main

Architecture

The flow is:

  1. User enters their research topic
  2. planner_agent comes up with a plan to search the web for information. The plan is a list of search queries, with a search term and a reason for each query.
  3. For each search item, we run a search_agent, which uses the Web Search tool to search for that term and summarize the results. These all run in parallel.
  4. Finally, the writer_agent receives the search summaries, and creates a written report.

Suggested improvements

If you're building your own research bot, some ideas to add to this are:

  1. Retrieval: Add support for fetching relevant information from a vector store. You could use the File Search tool for this.
  2. Image and file upload: Allow users to attach PDFs or other files, as baseline context for the research.
  3. More planning and thinking: Models often produce better results given more time to think. Improve the planning process to come up with a better plan, and add an evaluation step so that the model can choose to improve its results, search for more stuff, etc.
  4. Code execution: Allow running code, which is useful for data analysis.