-
Notifications
You must be signed in to change notification settings - Fork 81
Deepagents upgrade #719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
avoguru
wants to merge
2
commits into
main
Choose a base branch
from
deepagents-upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Deepagents upgrade #719
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,187 @@ | ||||||
| # LangChain-Arcade Examples | ||||||
|
|
||||||
| Examples demonstrating the integration between [Arcade AI](https://arcade.dev) tools and [LangChain](https://langchain.com)/[DeepAgents](https://github.com/langchain-ai/deepagents). | ||||||
|
|
||||||
| ## Research Agent | ||||||
|
|
||||||
| An AI agent that researches topics, creates Google Docs reports, and emails them to you. | ||||||
|
|
||||||
| > **Note:** This example requires **Python 3.11+** (deepagents requirement). | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean we need to update the pyproject.toml to define the project as only working with 3.11+? Currently it is |
||||||
|
|
||||||
| ### Features | ||||||
|
|
||||||
| - 🔬 **End-to-end research workflow** - Research → Create Doc → Email | ||||||
| - 🔐 **Just-in-time OAuth** - Automatic authorization when tools need access | ||||||
| - 📄 **Creates real Google Docs** - Reports saved to your Google Drive | ||||||
| - 📧 **Sends via Gmail** - Delivers report link to your inbox | ||||||
| - 🤖 **Powered by DeepAgents** - Uses LangChain's deep agent framework | ||||||
|
|
||||||
| ### Setup | ||||||
|
|
||||||
| #### 1. Install Dependencies | ||||||
|
|
||||||
| ```bash | ||||||
| cd contrib/langchain | ||||||
| pip install -e ".[dev]" | ||||||
| ``` | ||||||
|
|
||||||
| #### 2. Configure Environment | ||||||
|
|
||||||
| ```bash | ||||||
| cd examples | ||||||
| cp env.example .env | ||||||
| ``` | ||||||
|
|
||||||
| Edit `.env` with your credentials: | ||||||
|
|
||||||
| ```env | ||||||
| # Get your Arcade API key at https://arcade.dev | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ARCADE_API_KEY=arc_your_key_here | ||||||
|
|
||||||
| # OpenAI or Anthropic API key | ||||||
| OPENAI_API_KEY=sk-your_key_here | ||||||
|
|
||||||
| # Your email (used for OAuth authorization) | ||||||
| [email protected] | ||||||
|
|
||||||
| # Email to receive research reports | ||||||
| [email protected] | ||||||
| ``` | ||||||
|
|
||||||
| ### Running the Agent | ||||||
|
|
||||||
| #### Interactive Mode | ||||||
|
|
||||||
| ```bash | ||||||
| python research_agent.py | ||||||
| ``` | ||||||
|
|
||||||
| #### Single Query Mode | ||||||
|
|
||||||
| ```bash | ||||||
| python research_agent.py --query "Research power banks released in 2025" | ||||||
| ``` | ||||||
|
|
||||||
| ### Example Queries | ||||||
|
|
||||||
| - `Research the latest trends in AI chips` | ||||||
| - `Research power banks released in 2025` | ||||||
| - `Research electric vehicle market in Europe` | ||||||
| - `Research remote work tools for 2024` | ||||||
|
|
||||||
| The agent will automatically: | ||||||
| 1. Research the topic | ||||||
| 2. Create a Google Doc with findings | ||||||
| 3. Email the document link to you | ||||||
|
|
||||||
| ### What to Expect | ||||||
|
|
||||||
| #### 1. Initialization | ||||||
| ``` | ||||||
| 🚀 Initializing Research Agent... | ||||||
| ✓ Loaded 55 tools | ||||||
| ``` | ||||||
|
|
||||||
| #### 2. Just-in-Time OAuth Authorization | ||||||
|
|
||||||
| First time only - you'll see authorization prompts: | ||||||
|
|
||||||
| ``` | ||||||
| 📋 Checking tool authorizations... | ||||||
|
|
||||||
| 🔐 Authorization required for: Google_CreateDocumentFromText | ||||||
|
|
||||||
| Please authorize by visiting: | ||||||
| 🔗 https://accounts.arcade.dev/oauth/authorize?... | ||||||
|
|
||||||
| Waiting for authorization... | ||||||
| ``` | ||||||
|
|
||||||
| **Click the link** → Sign in with Google → Grant permissions → Agent continues! | ||||||
|
|
||||||
| ``` | ||||||
| ✓ Authorization completed! | ||||||
|
|
||||||
| 🔐 Authorization required for: Google_SendEmail | ||||||
|
|
||||||
| Please authorize by visiting: | ||||||
| 🔗 https://accounts.arcade.dev/oauth/authorize?... | ||||||
|
|
||||||
| Waiting for authorization... | ||||||
| ✓ Authorization completed! | ||||||
| ``` | ||||||
|
|
||||||
| #### 3. Agent Execution | ||||||
|
|
||||||
| ``` | ||||||
| ✓ Using OpenAI GPT-4o | ||||||
| ✓ Agent ready! | ||||||
| ✓ Reports will be sent to: [email protected] | ||||||
|
|
||||||
| ============================================================ | ||||||
| 🔬 Research Agent - Interactive Mode | ||||||
| ============================================================ | ||||||
|
|
||||||
| 📧 User: [email protected] | ||||||
| 📬 Reports sent to: [email protected] | ||||||
|
|
||||||
| Examples: | ||||||
| • Research the latest trends in AI chips | ||||||
| • Research power banks released in 2025 | ||||||
| • Research electric vehicle market in Europe | ||||||
|
|
||||||
| The agent will create a Google Doc and email it to you. | ||||||
| Type 'quit' to exit. | ||||||
|
|
||||||
| You: Research power banks released in 2025 | ||||||
| ``` | ||||||
|
|
||||||
| #### 4. Tool Execution & Results | ||||||
|
|
||||||
| ``` | ||||||
| ──────────────────────────────────────────────────────────── | ||||||
| 📝 Query: Research power banks released in 2025 | ||||||
| ──────────────────────────────────────────────────────────── | ||||||
|
|
||||||
| 🔧 Tool: Google_CreateDocumentFromText | ||||||
| 📄 Document: https://docs.google.com/document/d/1ABC.../edit | ||||||
|
|
||||||
| 🔧 Tool: Google_SendEmail | ||||||
| ✓ Email sent successfully | ||||||
|
|
||||||
| 🤖 Agent: I've created a research report on power banks released in 2025 | ||||||
| and sent it to [email protected]. You can also view the document here: | ||||||
| https://docs.google.com/document/d/1ABC.../edit | ||||||
| ``` | ||||||
|
|
||||||
| ### Troubleshooting | ||||||
|
|
||||||
| #### "Missing required environment variables" | ||||||
| Ensure your `.env` file exists and has valid API keys. | ||||||
|
|
||||||
| #### "Authorization required" keeps appearing | ||||||
| - Click the authorization URL and complete the OAuth flow in your browser | ||||||
| - Make sure you're signed into the correct Google account | ||||||
| - Grant all requested permissions | ||||||
|
|
||||||
| #### Email not received | ||||||
| - Check your spam folder | ||||||
| - Verify RECIPIENT_EMAIL is correct in `.env` | ||||||
| - Ensure Gmail authorization was completed | ||||||
|
|
||||||
| ### Architecture | ||||||
|
|
||||||
| ``` | ||||||
| ┌─────────────────┐ ┌──────────────┐ ┌─────────────────┐ | ||||||
| │ DeepAgents │────▶│ langchain- │────▶│ Arcade API │ | ||||||
| │ (LangChain) │ │ arcade │ │ │ | ||||||
| └─────────────────┘ └──────────────┘ └────────┬────────┘ | ||||||
| │ | ||||||
| ▼ | ||||||
| ┌─────────────────┐ | ||||||
| │ Google Workspace│ | ||||||
| │ • Docs │ | ||||||
| │ • Gmail │ | ||||||
| │ • Calendar │ | ||||||
| └─────────────────┘ | ||||||
| ``` | ||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Copy this file to .env and fill in your values | ||
| # cp env.example .env | ||
|
|
||
| # Arcade API Key - Get yours at https://arcade.dev | ||
| ARCADE_API_KEY=arc_... | ||
|
|
||
| # OpenAI API Key - Get yours at https://platform.openai.com/api-keys | ||
| OPENAI_API_KEY=sk-... | ||
|
|
||
| # Your email address - used for Arcade OAuth authorization | ||
| [email protected] | ||
|
|
||
| # Where to send research reports - the agent will email the Google Doc link here | ||
| [email protected] | ||
|
|
||
|
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.