mirror of
https://github.com/langchain-ai/reply_gAI.git
synced 2026-07-01 08:35:18 -04:00
b4b1ddb264258bfffccb52967b9edb48895175f4
Reply gAI
🚀 Quickstart with LangGraph server
Sign up for an Arcade API to get access to Twitter data.
Install the langgraph CLI:
pip install -U "langgraph-cli[inmem]"
Install dependencies:
pip install -e .
Load API keys into the environment for the LangSmith SDK, Anthropic API and Tavily API:
export ANTHROPIC_API_KEY=<your_anthropic_api_key>
export ARCADE_API_KEY=<your_arcade_api_key>
export ARCADE_USER_ID=<your_arcade_user_id>
Launch the agent:
langgraph dev
If all is well, you should see the following output:
Ready!
LangGraph Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
How it works
Reply gAI uses LangGraph to create a workflow that mimics a Twitter user's writing style. Here's how the system operates:
-
Tweet Collection
- Uses the Arcade API X Toolkit to fetch up to 100 recent tweets from a specified Twitter user
- Tweets are stored locally with their text content and URLs
- The system automatically refreshes tweets if they're older than the configured age limit
-
Conversation Flow
- The workflow is managed by a state graph with two main nodes:
get_tweets: Fetches and stores recent tweetschat: Generates responses using Claude 3.5 Sonnet
- The workflow is managed by a state graph with two main nodes:
-
Response Generation
- Claude analyzes the collected tweets to understand the user's writing style
- Generates contextually appropriate responses that match the personality and tone of the target Twitter user
- Uses a temperature of 0.75 to balance creativity with consistency
-
Architecture
- Built on LangGraph for workflow management
- Uses Anthropic's Claude 3.5 Sonnet for response generation
- Integrates with Arcade API for Twitter data access
- Maintains conversation state and tweet storage for efficient operation
The system automatically determines whether to fetch new tweets or use existing ones based on their age, ensuring responses are generated using recent and relevant data.
Description
Languages
Jupyter Notebook
56.2%
Python
43.8%