You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 11, 2026. It is now read-only.
Sign up for an [Arcade API](https://docs.arcade-ai.com/integrations/toolkits/x) to get access to Twitter data.
6
+
7
+
Install the langgraph CLI:
8
+
```
9
+
pip install -U "langgraph-cli[inmem]"
10
+
```
11
+
12
+
Install dependencies:
13
+
```
14
+
pip install -e .
15
+
```
16
+
17
+
Load API keys into the environment for the LangSmith SDK, Anthropic API and Tavily API:
18
+
```
19
+
export ANTHROPIC_API_KEY=<your_anthropic_api_key>
20
+
export ARCADE_API_KEY=<your_arcade_api_key>
21
+
export ARCADE_USER_ID=<your_arcade_user_id>
22
+
```
23
+
24
+
Launch the agent:
25
+
```
26
+
langgraph dev
27
+
```
28
+
29
+
If all is well, you should see the following output:
30
+
31
+
> Ready!
32
+
33
+
> API: http://127.0.0.1:2024
34
+
35
+
> Docs: http://127.0.0.1:2024/docs
36
+
37
+
> LangGraph Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
38
+
39
+
## How it works
40
+
41
+
Reply gAI uses LangGraph to create a workflow that mimics a Twitter user's writing style. Here's how the system operates:
42
+
43
+
1.**Tweet Collection**
44
+
- Uses the [Arcade API X Toolkit](https://docs.arcade-ai.com/integrations/toolkits/x) to fetch up to 100 recent tweets from a specified Twitter user
45
+
- Tweets are stored locally with their text content and URLs
46
+
- The system automatically refreshes tweets if they're older than the configured age limit
47
+
48
+
2.**Conversation Flow**
49
+
- The workflow is managed by a state graph with two main nodes:
50
+
-`get_tweets`: Fetches and stores recent tweets
51
+
-`chat`: Generates responses using Claude 3.5 Sonnet
52
+
53
+
3.**Response Generation**
54
+
- Claude analyzes the collected tweets to understand the user's writing style
55
+
- Generates contextually appropriate responses that match the personality and tone of the target Twitter user
56
+
- Uses a temperature of 0.75 to balance creativity with consistency
57
+
58
+
4.**Architecture**
59
+
- Built on LangGraph for workflow management
60
+
- Uses Anthropic's Claude 3.5 Sonnet for response generation
61
+
- Integrates with Arcade API for Twitter data access
62
+
- Maintains conversation state and tweet storage for efficient operation
63
+
64
+
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.
0 commit comments