Skip to main content
The source’s search agent registers only Firecrawl scraping, while its finance agent registers only current-price lookup. Enable the tools promised by their roles before running. Also disable auto-reload so the MCP connection can keep one application lifespan.
run.py
The example imports these helper modules from the same directory:
agents.py
db.py
teams.py
workflows.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your API keys

4

Run SurrealDB

5

Enable the promised research tools

When saving workflows.py, replace FirecrawlTools() with FirecrawlTools(enable_search=True). When saving teams.py, replace YFinanceTools() with YFinanceTools(all=True).
6

Keep one MCP lifespan

When saving run.py, replace agent_os.serve(app="run:app", reload=True) with agent_os.serve(app="run:app").
7

Run the example

Save the code blocks above as run.py, agents.py, db.py, teams.py, workflows.py in the same directory, then run:
Full source: cookbook/05_agent_os/dbs/surreal_db/run.py