Update README.md
Browse files
README.md
CHANGED
|
@@ -1,92 +1,10 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
## What it does
|
| 13 |
-
|
| 14 |
-
The ReAct agent:
|
| 15 |
-
|
| 16 |
-
1. Takes a user **query** as input
|
| 17 |
-
2. Reasons about the query and decides on an action
|
| 18 |
-
3. Executes the chosen action using available tools
|
| 19 |
-
4. Observes the result of the action
|
| 20 |
-
5. Repeats steps 2-4 until it can provide a final answer
|
| 21 |
-
|
| 22 |
-
By default, it's set up with a basic set of tools, but can be easily extended with custom tools to suit various use cases.
|
| 23 |
-
|
| 24 |
-
## Getting Started
|
| 25 |
-
|
| 26 |
-
Assuming you have already [installed LangGraph Studio](https://github.com/langchain-ai/langgraph-studio?tab=readme-ov-file#download), to set up:
|
| 27 |
-
|
| 28 |
-
1. Create a `.env` file.
|
| 29 |
-
|
| 30 |
-
```bash
|
| 31 |
-
cp .env.example .env
|
| 32 |
-
```
|
| 33 |
-
|
| 34 |
-
2. Define required API keys in your `.env` file.
|
| 35 |
-
|
| 36 |
-
The primary [search tool](./src/react_agent/tools.py) [^1] used is [Tavily](https://tavily.com/). Create an API key [here](https://app.tavily.com/sign-in).
|
| 37 |
-
|
| 38 |
-
### Setup Model
|
| 39 |
-
|
| 40 |
-
The defaults values for `model` are shown below:
|
| 41 |
-
|
| 42 |
-
```yaml
|
| 43 |
-
model: claude-sonnet-4-5-20250929
|
| 44 |
-
```
|
| 45 |
-
|
| 46 |
-
Follow the instructions below to get set up, or pick one of the additional options.
|
| 47 |
-
|
| 48 |
-
#### Anthropic
|
| 49 |
-
|
| 50 |
-
To use Anthropic's chat models:
|
| 51 |
-
|
| 52 |
-
1. Sign up for an [Anthropic API key](https://console.anthropic.com/) if you haven't already.
|
| 53 |
-
2. Once you have your API key, add it to your `.env` file:
|
| 54 |
-
|
| 55 |
-
```
|
| 56 |
-
ANTHROPIC_API_KEY=your-api-key
|
| 57 |
-
```
|
| 58 |
-
#### OpenAI
|
| 59 |
-
|
| 60 |
-
To use OpenAI's chat models:
|
| 61 |
-
|
| 62 |
-
1. Sign up for an [OpenAI API key](https://platform.openai.com/signup).
|
| 63 |
-
2. Once you have your API key, add it to your `.env` file:
|
| 64 |
-
```
|
| 65 |
-
OPENAI_API_KEY=your-api-key
|
| 66 |
-
```
|
| 67 |
-
|
| 68 |
-
3. Customize whatever you'd like in the code.
|
| 69 |
-
4. Open the folder LangGraph Studio!
|
| 70 |
-
|
| 71 |
-
## How to customize
|
| 72 |
-
|
| 73 |
-
1. **Add new tools**: Extend the agent's capabilities by adding new tools in [tools.py](./src/react_agent/tools.py). These can be any Python functions that perform specific tasks.
|
| 74 |
-
2. **Select a different model**: We default to Anthropic's Claude 3 Sonnet. You can select a compatible chat model using `provider/model-name` via runtime context. Example: `openai/gpt-4-turbo-preview`.
|
| 75 |
-
3. **Customize the prompt**: We provide a default system prompt in [prompts.py](./src/react_agent/prompts.py). You can easily update this via context in the studio.
|
| 76 |
-
|
| 77 |
-
You can also quickly extend this template by:
|
| 78 |
-
|
| 79 |
-
- Modifying the agent's reasoning process in [graph.py](./src/react_agent/graph.py).
|
| 80 |
-
- Adjusting the ReAct loop or adding additional steps to the agent's decision-making process.
|
| 81 |
-
|
| 82 |
-
## Development
|
| 83 |
-
|
| 84 |
-
While iterating on your graph, you can edit past state and rerun your app from past states to debug specific nodes. Local changes will be automatically applied via hot reload. Try adding an interrupt before the agent calls tools, updating the default system message in `src/react_agent/context.py` to take on a persona, or adding additional nodes and edges!
|
| 85 |
-
|
| 86 |
-
Follow up requests will be appended to the same thread. You can create an entirely new thread, clearing previous history, using the `+` button in the top right.
|
| 87 |
-
|
| 88 |
-
You can find the latest (under construction) docs on [LangGraph](https://github.com/langchain-ai/langgraph) here, including examples and other references. Using those guides can help you pick the right patterns to adapt here for your use case.
|
| 89 |
-
|
| 90 |
-
LangGraph Studio also integrates with [LangSmith](https://smith.langchain.com/) for more in-depth tracing and collaboration with teammates.
|
| 91 |
-
|
| 92 |
-
[^1]: https://python.langchain.com/docs/concepts/#tools
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Stateless-Agent-Service
|
| 3 |
+
emoji: 🤖
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
pinned: false
|
| 9 |
+
---
|
| 10 |
+
# Stateless Agent Engine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|