Composio Setup Guide for Epic News¶
Overview¶
Composio provides hosted integrations for agentic workflows. epic_news uses it for two things:
- Social search tools for the
company_newscrew (Reddit, Twitter, Hacker News). - Report email delivery through Gmail (
GMAIL_SEND_EMAIL), called directly by the flow, not by an agent.
Important: epic_news uses the Composio 1.0 API (Composio(..., provider=CrewAIProvider())). The old ComposioToolSet API is deprecated.
Quick Start¶
1. Get Your Composio API Key¶
- Sign up at https://app.composio.dev
- Navigate to Settings → API Keys
- Copy your API key
2. Add API Key to Environment¶
Add to your .env file:
3. Test Connection¶
# Test Composio connection
uv run python -c "
from epic_news.config.composio_config import ComposioConfig
config = ComposioConfig()
print('✓ Composio configured successfully')
print(f'✓ Search tools available: {len(config.get_search_tools())}')
"
What epic_news Uses¶
ComposioConfig (src/epic_news/config/composio_config.py) exposes:
| Method | Returns | Used by |
|---|---|---|
get_search_tools() |
Search tools from Reddit, Twitter and Hacker News | company_news crew |
get_gmail_email_tools(include_send=True) |
Gmail toolkit tools for an agent | Not used by any crew |
Email delivery does not go through an agent: epic_news.utils.email_sender.send_report_email() executes GMAIL_SEND_EMAIL with the Composio client.
1. Search Tools (From Social Media Platforms)¶
Composio 1.0 has no dedicated "SEARCH" toolkit. get_search_tools() loads the Reddit, Twitter and Hacker News toolkits and keeps the tools whose name contains search:
REDDIT_SEARCH_ACROSS_SUBREDDITS: Search Reddit for topicsREDDIT_GET_SUBREDDITS_SEARCH: Find relevant subredditsTWITTER_FULL_ARCHIVE_SEARCH: Search Twitter posts (requires Twitter connection)HACKERNEWS_SEARCH_POSTS: Search Hacker News stories (no auth required)
A toolkit that fails to load is logged and skipped, so the list can be shorter than expected.
Connect Reddit / Twitter:
- Go to the Composio Dashboard
- Find Reddit or Twitter and click Connect
- Authorize Composio (read and search permissions are enough)
Hacker News needs no connection.
2. Gmail (Report Email)¶
Setup:
- In the Composio Dashboard, add a Gmail connection under the user/entity ID
default - Set
EPIC_ENABLE_EMAIL=truein.env(email is skipped otherwise) - Set
MAILto the recipient address
send_report_email() validates the recipient and body, uploads the attachment from the output directory (EPIC_OUTPUT_DIR, default output), calls GMAIL_SEND_EMAIL and raises EmailDeliveryError unless Composio reports success.
Manual tool execution needs a pinned toolkit version. The default is set in email_sender.py; override it with COMPOSIO_GMAIL_VERSION when Composio publishes a new Gmail toolkit version.
Testing Your Setup¶
from epic_news.config.composio_config import ComposioConfig
config = ComposioConfig()
search_tools = config.get_search_tools()
print(f"✓ {len(search_tools)} search tools: {[t.name for t in search_tools]}")
gmail_tools = config.get_gmail_email_tools(include_send=True)
print(f"✓ Gmail tools: {[t.name for t in gmail_tools]}")
If GMAIL_SEND_EMAIL is missing from the Gmail list, your Gmail connection or Composio plan does not expose it.
Troubleshooting¶
Issue: "COMPOSIO_API_KEY environment variable is required"¶
Solutions:
- Ensure
COMPOSIO_API_KEYis set in.env - Restart your terminal/IDE to reload environment
- Verify the key is valid at https://app.composio.dev
Issue: "Could not load {PLATFORM} search tools from Composio"¶
Solutions:
- Check that the app is connected in the Composio Dashboard
- Check app permissions
- For OAuth apps, re-authenticate if the token expired
Issue: Email not delivered¶
See Troubleshooting → I didn't receive the email.