Twitter Integration
Guide to integrating Twitter with IntentKit agents.
IntentKit provides two ways to integrate with Twitter: using it as an entrypoint for your agent, or incorporating Twitter-specific skills into your agent’s capabilities.
Twitter as an Entrypoint
Entrypoint is a type of conversational interface.
The Twitter entrypoint allows your agent to automatically respond to Twitter mentions. When enabled, the agent will monitor mentions every 15 minutes and respond to them all.
Configuration
- Enable Twitter Entrypoint for your agent:
- Configure Twitter credentials in your agent’s config: Get your Twitter credentials from your Twitter developer portal.
Notice: Free accounts can only use post_tweet skill, if you want to use other skills, you need to upgrade your account.
- Run the Twitter entrypoint: If you have used the docker-compose, it already runs automatically.
How it Works
The Twitter entrypoint:
- Polls for new mentions every 15 minutes
- Uses both
since_id
andstart_time
for reliable mention tracking - Maintains the last processed tweet ID in the agent’s plugin data
- Automatically manages API rate limits and quotas
- Responds to mentions as threaded replies
Twitter Skills
IntentKit provides a set of Twitter-specific skills that can be added to your agent’s toolkit. All skills are built on top of the TwitterBaseTool
base class which handles authentication and client initialization.
Available Skills
-
TwitterGetMentions
- Retrieves mentions of the authenticated user
- Uses both
since_id
andstart_time
for reliable mention tracking - Always looks back 24 hours for safety
- No additional parameters required
-
TwitterGetTimeline
- Retrieves tweets from the authenticated user’s timeline
- Tracks the last retrieved tweet using timestamp
- Returns formatted timeline data
- No additional parameters required
-
TwitterPostTweet
- Posts new tweets to Twitter
- Parameters:
text
: Tweet content (max 280 characters)
-
TwitterReplyTweet
- Posts reply tweets to existing tweets
- Parameters:
tweet_id
: ID of the tweet to reply totext
: Reply content (max 280 characters)
Using Twitter Skills
Add Twitter skills to your agent: Just configure the skills you need in your agent’s config, the credentials also required.
Rate Limits and Quotas
Twitter side
Rate limits on the Twitter side can be found here.
IntentKit
IntentKit can help you manage Twitter API rate limits and quotas. This feature is not released yet.
Best Practices
-
Error Handling
- Always handle Twitter API errors gracefully
- Implement exponential backoff for rate limits
- Log failed interactions for debugging
-
Content Guidelines
- Keep responses within Twitter’s character limit
- Handle thread creation for longer responses
- Consider Twitter’s content policies
-
Security
- Store Twitter credentials securely
- Use environment variables for sensitive data
- Regularly rotate access tokens
Example Use Cases
-
Social Media Manager Bot
-
Content Aggregator with Timeline Analysis
-
Interactive Support Assistant
Troubleshooting
Common issues and solutions:
-
Rate Limit Exceeded
- Check your quota settings
- Implement proper waiting periods
- Use the built-in quota management
-
Authentication Errors
- Verify credential configuration
- Check token expiration
- Ensure proper permission scopes
-
Missing Mentions
- Verify
since_id
tracking - Check
start_time
configuration - Monitor the Twitter entrypoint logs
- Verify