Open-source deep research agent implemented with Letta.
This code will set up the Exa MCP server + add a Letta agent with deep research capbilities.
You'll need to add your agent to your Letta server. You can do this two ways:
- Using the agent development environment (ADE). This is the recommended option.
- Using the code in this repository. This may be out of date, so you could get an old version of Deep Thought.
To talk to your agent, you should go to https://app.letta.com and select your agent.
The deep-research.af
agentfile is included in this repo. Letta supports easy imports of agentfiles,
see the documentation here for
more information on how to import the agent file.
You will have to set up the Exa MCP server. Sign up at exa.ai and get an API key.
After importing the agentfile, go to the Letta ADE and add the Exa MCP server.
While viewing your agent in the ADE, click Tool Manager > Add MCP Server > Exa. Paste in your Exa key.
Go wild!
- Go to https://app.letta.com
- Sign in or create an account
- Skip or follow the onboarding
- Click your profile in the top right of the ADE
- Click "API Keys"
- Click "Create API Key" in the top right, and provide a name for the key (this is only for you to remember the key)
- Copy the key to a new
.env
file in this folder and assign it to the environment variableLETTA_API_KEY
After step 7, your .env
file should look like this:
LETTA_API_KEY="sk-let-1235402450-923459....."
Optional: You can also self-host a Letta server. To do so, see the documentation.
If you are using a self-hosted Letta server, uncomment and set the LETTA_BASE_URL
variable in your .env
file:
LETTA_BASE_URL="http://localhost:8283" # Replace with your self-hosted server URL
This example uses Exa for web search and crawling.
Steps:
- Go to Exa and create an account
- Create an API key by clicking "API Keys" on the left side of the Exa dashboard
- Copy the API key to
.env
using the environment variableEXA_API_KEY
Your .env
file should look like this:
LETTA_API_KEY="sk-let-1235402450-923459....."
EXA_API_KEY="blah-blah-blah"
# LETTA_BASE_URL="http://localhost:8283" # Only uncomment if using self-hosted Letta
We recommend using uv
to manage Python dependencies. You can install uv here.
uv pip install -r requirements.txt
Or, if you prefer to use pip
and ruin your life, you can use:
pip install -r requirements.txt
python research.py
To use the agent,