- Go to OpenAI Platform
- Sign up or log in
- Click "Create new secret key"
- Copy your API key
- Go to Tavily
- Sign up for a free account
- Navigate to API Keys section
- Copy your API key
# Copy the example environment file
cp .env.example .env
# Edit .env and add your API keys
nano .env # or use your preferred editornpm installnpm startEdit deep_agent.ts and modify the user message:
content: "Research about [YOUR TOPIC] and create a detailed report";In deep_agent.ts:
model: new ChatOpenAI({
modelName: "gpt-4o-mini", // Change to gpt-4, gpt-3.5-turbo, etc.
temperature: 0, // 0 = deterministic, 1 = creative
}),Customize file system operations:
backend: new FilesystemBackend({
rootDir: ".", // Change working directory
virtualMode: true, // Enable/disable safe mode
});Edit the researchInstructions variable in deep_agent.ts to change agent behavior.
FilesystemBackend provides these tools automatically:
ls- List files with metadataread_file- Read files with line numberswrite_file- Create new filesedit_file- Edit existing filesglob- Find files by patterngrep- Search file contents
- Check that your
.envfile exists - Verify API keys are correct
- Ensure no extra spaces in
.envfile
- Increase
recursionLimitindeep_agent.ts - Simplify the research task
- Check that tools are working correctly
- Ensure you have write permissions
- Check that file paths are relative
- Verify disk space is available
Run in development mode with auto-reload:
npm run devCompile TypeScript to JavaScript:
npx tsc- Customize the system prompt for your use case
- Add new tools in the
tools/directory - Experiment with different OpenAI models
- Adjust search parameters in
search_tool.ts
Happy researching! 🚀