{"id":34541484,"url":"https://github.com/agenticdevops/deepagent","last_synced_at":"2026-06-08T07:03:04.450Z","repository":{"id":327240834,"uuid":"1108496339","full_name":"agenticdevops/deepagent","owner":"agenticdevops","description":"Deep Agent Examples","archived":false,"fork":false,"pushed_at":"2025-12-02T15:23:52.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-05T12:20:15.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agenticdevops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-02T14:25:48.000Z","updated_at":"2025-12-02T15:23:56.000Z","dependencies_parsed_at":"2025-12-06T00:08:43.419Z","dependency_job_id":null,"html_url":"https://github.com/agenticdevops/deepagent","commit_stats":null,"previous_names":["agenticdevops/deepagent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/agenticdevops/deepagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenticdevops%2Fdeepagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenticdevops%2Fdeepagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenticdevops%2Fdeepagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenticdevops%2Fdeepagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agenticdevops","download_url":"https://codeload.github.com/agenticdevops/deepagent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agenticdevops%2Fdeepagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34051772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T06:18:08.460Z","updated_at":"2026-06-08T07:03:04.445Z","avatar_url":"https://github.com/agenticdevops.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Agent Quickstart with Gemini 2.5 Flash\n\nA comprehensive guide and working example for building deep agents using Google's Gemini 2.5 Flash model with the deepagents framework.\n\n## Overview\n\nThis project demonstrates how to build intelligent research agents that can:\n- Plan complex tasks using built-in planning tools\n- Search the internet for information\n- Manage file systems to handle large datasets\n- Delegate subtasks to specialized subagents\n- Synthesize research into polished reports\n\nAll powered by Google's fast and cost-efficient **Gemini 2.5 Flash** model.\n\n## Quick Start\n\n\n### 1. Install Dependencies\n```bash\npip install -r requirements.txt\n```\n\nOr with uv:\n```bash\nuv add -r requirements.txt\n```\n\n### 2. Set Up API Keys\nCreate a `.env` file from the template:\n```bash\ncp .env.example .env\n```\n\nThen add your API keys:\n- **GOOGLE_API_KEY**: Get from [Google AI Studio](https://aistudio.google.com/apikey)\n- **TAVILY_API_KEY**: Get from [Tavily](https://tavily.com)\n\n### 3. Run the Agent\n```bash\npython gemini_quickstart.py\n```\n\n## Files in This Project\n\n| File | Purpose |\n|------|---------|\n| `GEMINI_QUICKSTART.md` | Comprehensive guide to using Gemini with deep agents |\n| `gemini_quickstart.py` | Ready-to-run example script |\n| `requirements.txt` | Python dependencies |\n| `.env.example` | Template for environment variables |\n| `README.md` | This file |\n\n## What Makes This Different From Anthropic?\n\n### Model Integration\n```python\n# Anthropic (Claude)\nfrom langchain_anthropic import ChatAnthropic\nmodel = ChatAnthropic(model=\"claude-3-5-sonnet-20241022\")\n\n# Google (Gemini) - This project\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nmodel = ChatGoogleGenerativeAI(model=\"gemini-2.5-flash\")\n```\n\n### Key Benefits of Gemini 2.5 Flash\n- ⚡ **Speed**: Optimized for fast inference\n- 💰 **Cost**: More economical pricing\n- 📊 **Context**: 1 million token window\n- 🎯 **Quality**: Excellent performance-to-latency ratio\n\n## Agent Architecture\n\n```\n┌─────────────────────────────────────────────┐\n│      User Query (Research Task)             │\n└──────────────┬──────────────────────────────┘\n               │\n               ▼\n┌─────────────────────────────────────────────┐\n│  Gemini 2.5 Flash Deep Agent                │\n│  ┌────────────────────────────────────────┐ │\n│  │  System Prompt (Research Expert)       │ │\n│  └────────────────────────────────────────┘ │\n└──────────────┬──────────────────────────────┘\n               │\n        ┌──────┼──────┬──────────┬──────────┐\n        ▼      ▼      ▼          ▼          ▼\n    ┌─────┐ ┌──────┐ ┌────────┐ ┌──────┐ ┌─────┐\n    │Plan │ │Search│ │Organize│ │Write │ │Report│\n    │Work │ │Web   │ │Files   │ │File  │ │Synth │\n    │Todos│ │      │ │        │ │      │ │      │\n    └─────┘ └──────┘ └────────┘ └──────┘ └─────┘\n        │      │        │         │        │\n        └──────┼────────┼─────────┼────────┘\n               │        │         │\n               ▼        ▼         ▼\n        ┌──────────────────────────────┐\n        │  Built-in Tools              │\n        │  • write_todos               │\n        │  • internet_search           │\n        │  • read_file/write_file      │\n        │  • grep/glob                 │\n        │  • execute                   │\n        │  • task (subagents)          │\n        └──────────────────────────────┘\n               │\n               ▼\n        ┌──────────────────────────────┐\n        │  Final Report                │\n        │  • Structured findings       │\n        │  • Citations                 │\n        │  • Analysis \u0026 conclusions    │\n        └──────────────────────────────┘\n```\n\n## Example Usage\n\n### Basic Research Agent\n```python\nfrom gemini_quickstart import agent\n\nresult = agent.invoke({\n    \"messages\": [{\n        \"role\": \"user\",\n        \"content\": \"What are the latest developments in AI agents?\"\n    }]\n})\n\nprint(result[\"messages\"][-1].content)\n```\n\n### Research with Specific Parameters\n```python\n# Research with more search results\nsystem_prompt = \"\"\"You are an expert researcher...\nUse up to 10 search results per query for comprehensive coverage.\"\"\"\n\nagent = create_deep_agent(\n    tools=[internet_search],\n    system_prompt=system_prompt,\n    model=model,\n)\n```\n\n## Common Tasks\n\n### Change the Search Topic\nModify the `internet_search` call in your agent's instructions:\n```python\n# For finance-specific research\ntopic = \"finance\"\n\n# For current news\ntopic = \"news\"\n\n# For general topics\ntopic = \"general\"\n```\n\n### Add More Tools\nExtend the agent with additional tools:\n```python\ndef calculator(expression: str) -\u003e float:\n    \"\"\"Evaluate mathematical expressions\"\"\"\n    return eval(expression)\n\nagent = create_deep_agent(\n    tools=[internet_search, calculator],\n    system_prompt=research_instructions,\n    model=model,\n)\n```\n\n### Create Specialized Subagents\nDelegate specific tasks to specialized agents:\n```python\n# Define system prompts for specialized agents\ndata_analyst_prompt = \"You are an expert data analyst...\"\nsummarizer_prompt = \"You are an expert at summarizing content...\"\n\n# Agents will automatically handle delegation\n```\n\n## Troubleshooting\n\n### Issue: \"GOOGLE_API_KEY not found\"\n**Solution**: Make sure you've set the environment variable:\n```bash\nexport GOOGLE_API_KEY=\"your-key-here\"\n```\n\nOr use a `.env` file with `python-dotenv`:\n```python\nfrom dotenv import load_dotenv\nload_dotenv()\n```\n\n### Issue: Rate limiting errors\n**Solution**: Reduce request frequency or add delays:\n```python\nimport time\ntime.sleep(1)  # 1 second delay between searches\n```\n\n### Issue: Large search results causing context issues\n**Solution**: Use the built-in `write_file` tool to save results:\n```python\n# Agent automatically manages this with FilesystemMiddleware\n# No additional configuration needed\n```\n\n## Performance Tips\n\n1. **Use Flash model**: It's faster and cheaper than Pro/Ultra models\n2. **Limit search results**: Set `max_results=3-5` for focused searches\n3. **Cache API keys**: Set environment variables once, reuse across sessions\n4. **Enable LangSmith**: Monitor agent behavior and optimize\n5. **Use file management**: Let the agent offload context to files\n\n## Resources\n\n- **Deepagents**: https://github.com/langchain-ai/deepagents\n- **Google Gemini API**: https://ai.google.dev\n- **Tavily Search**: https://tavily.com\n- **LangChain**: https://python.langchain.com\n- **LangGraph**: https://langgraph.dev\n\n## License\n\nThis project is provided as an educational example.\n\n## Support\n\nFor issues with:\n- **Deep agents**: Check [deepagents docs](https://github.com/langchain-ai/deepagents)\n- **Gemini API**: Visit [Google AI Support](https://support.google.com/ai/)\n- **Tavily**: Contact [Tavily Support](https://tavily.com/support)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenticdevops%2Fdeepagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagenticdevops%2Fdeepagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagenticdevops%2Fdeepagent/lists"}