Skip to content

Commit 1d18285

Browse files
committed
update
1 parent df0561f commit 1d18285

3 files changed

Lines changed: 28 additions & 257 deletions

File tree

docs_src/src/pages/documentation/en/api_reference/agents.mdx

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ app.start()
3737
## Features
3838

3939
### 🧠 **Memory System**
40-
- Multiple provider support (InMemory, Mem0)
40+
- InMemory provider support
4141
- Persistent conversation history
42-
- Semantic search capabilities
4342
- Context-aware responses
4443

4544
### 🤖 **Agent Runners**
4645
- Simple runner with OpenAI integration
47-
- LangGraph runner for complex workflows
4846
- Custom runner support
4947
- Async execution
5048

@@ -81,30 +79,6 @@ messages = await mem.get()
8179
await mem.clear()
8280
```
8381

84-
#### Mem0 Provider
85-
86-
Integration with Mem0 for advanced memory capabilities including semantic search and persistence.
87-
88-
```python
89-
from robyn.ai import memory
90-
91-
# Create Mem0 memory instance
92-
mem = memory(
93-
provider="mem0",
94-
user_id="user123",
95-
# Mem0 configuration
96-
vector_store={
97-
"provider": "chroma",
98-
"config": {"collection_name": "robyn_memory"}
99-
}
100-
)
101-
102-
# Add messages with metadata
103-
await mem.add("I love pizza", metadata={"category": "food_preference"})
104-
105-
# Search with query
106-
results = await mem.get(query="food preferences")
107-
```
10882

10983
### Memory API
11084

@@ -138,25 +112,6 @@ result = await simple_agent.run("What's the weather like?")
138112
# Returns structured response with AI-generated content
139113
```
140114

141-
#### LangGraph Runner
142-
143-
Integration with LangGraph for complex workflow execution:
144-
145-
```python
146-
from robyn.ai import agent, memory
147-
148-
# Create memory
149-
mem = memory(provider="inmemory", user_id="user123")
150-
151-
# Create LangGraph agent with custom workflow
152-
graph_agent = agent(
153-
runner="langgraph:path/to/workflow.json",
154-
memory=mem
155-
)
156-
157-
# Execute with context
158-
result = await graph_agent.run("Process this request", history=True)
159-
```
160115

161116
#### Custom Runners
162117

@@ -199,11 +154,6 @@ export AI_MODEL="gpt-4o"
199154
export AI_TEMPERATURE="0.7"
200155
export AI_MAX_TOKENS="1000"
201156

202-
# Mem0 Configuration
203-
export MEM0_API_KEY="your-mem0-key"
204-
205-
# LangGraph Configuration
206-
export LANGGRAPH_API_KEY="your-langgraph-key"
207157
```
208158

209159
### Programmatic Configuration
@@ -224,9 +174,8 @@ chat_agent = agent(runner="simple", config=config)
224174

225175
# Or configure memory
226176
mem = memory(
227-
provider="mem0",
228-
user_id="user123",
229-
vector_store={"provider": "chroma"}
177+
provider="inmemory",
178+
user_id="user123"
230179
)
231180
```
232181

@@ -247,11 +196,10 @@ config = configure(
247196
temperature=0.7
248197
)
249198

250-
# Create memory with Mem0 provider
199+
# Create memory with InMemory provider
251200
mem = memory(
252-
provider="mem0",
253-
user_id="guest",
254-
vector_store={"provider": "chroma"}
201+
provider="inmemory",
202+
user_id="guest"
255203
)
256204

257205
# Create agent with memory and config
@@ -337,10 +285,10 @@ if __name__ == "__main__":
337285

338286
**ImportError for required packages**: Install the required packages:
339287
```bash
340-
pip install openai mem0ai langgraph
288+
pip install openai
341289
```
342290

343-
**Memory not persisting**: Ensure you're using a persistent provider like Mem0, not the in-memory provider for production.
291+
**Memory not persisting**: Note that the in-memory provider loses data when the application restarts. Consider implementing a custom persistent provider for production use.
344292

345293
**Agent timeouts**: Complex workflows may take time. Consider implementing timeout handling in your endpoints.
346294

docs_src/src/pages/documentation/en/api_reference/ai.mdx

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@ The AI features are included with the base Robyn installation:
1313
pip install robyn
1414
```
1515

16-
For additional providers, you may need to install their respective packages:
17-
18-
```bash
19-
# For Mem0 memory provider
20-
pip install mem0ai
21-
22-
# For LangGraph agent runner
23-
pip install langgraph
24-
```
2516

2617
## Quick Start
2718

@@ -77,30 +68,6 @@ messages = await mem.get()
7768
await mem.clear()
7869
```
7970

80-
#### Mem0 Provider
81-
82-
Integration with Mem0 for advanced memory capabilities including semantic search and persistence.
83-
84-
```python
85-
from robyn.ai import memory
86-
87-
# Create Mem0 memory instance
88-
mem = memory(
89-
provider="mem0",
90-
user_id="user123",
91-
# Mem0 configuration
92-
vector_store={
93-
"provider": "chroma",
94-
"config": {"collection_name": "robyn_memory"}
95-
}
96-
)
97-
98-
# Add messages with metadata
99-
await mem.add("I love pizza", metadata={"category": "food_preference"})
100-
101-
# Search with query
102-
results = await mem.get(query="food preferences")
103-
```
10471

10572
### Memory API
10673

@@ -118,38 +85,22 @@ Agents provide the execution layer for AI functionality. They can use different
11885

11986
#### Simple Runner
12087

121-
A basic echo runner useful for testing and development:
88+
A runner with OpenAI integration that provides intelligent responses:
12289

12390
```python
12491
from robyn.ai import agent
12592

126-
# Create simple agent
127-
simple_agent = agent(runner="simple")
93+
# Create simple agent with OpenAI
94+
from robyn.ai import configure
95+
96+
config = configure(openai_api_key="your-openai-key")
97+
simple_agent = agent(runner="simple", config=config)
12898

12999
# Use the agent
130-
result = await simple_agent.run("Hello world")
131-
# Returns: {"response": "Echo: Hello world", "query": "Hello world", "kwargs": {}}
100+
result = await simple_agent.run("What's the weather like?")
101+
# Returns structured response with AI-generated content
132102
```
133103

134-
#### LangGraph Runner
135-
136-
Integration with LangGraph for complex workflow execution:
137-
138-
```python
139-
from robyn.ai import agent, memory
140-
141-
# Create memory
142-
mem = memory(provider="inmemory", user_id="user123")
143-
144-
# Create LangGraph agent
145-
graph_agent = agent(
146-
runner="langgraph:path/to/workflow.json",
147-
memory=mem
148-
)
149-
150-
# Execute with context
151-
result = await graph_agent.run("Process this request", history=True)
152-
```
153104

154105
### Agent API
155106

@@ -169,11 +120,10 @@ from robyn.ai import agent, memory
169120

170121
app = Robyn(__file__)
171122

172-
# Create memory with Mem0 provider
123+
# Create memory with InMemory provider
173124
mem = memory(
174-
provider="mem0",
175-
user_id="guest",
176-
vector_store={"provider": "chroma"}
125+
provider="inmemory",
126+
user_id="guest"
177127
)
178128

179129
# Create agent with memory
@@ -302,13 +252,13 @@ custom_agent = Agent(runner=CustomAgentRunner())
302252

303253
### Common Issues
304254

305-
**ImportError for mem0ai/langgraph**: Install the required packages:
255+
**ImportError for openai**: Install the required package:
306256
```bash
307-
pip install mem0ai langgraph
257+
pip install openai
308258
```
309259

310-
**Memory not persisting**: Ensure you're using a persistent provider like Mem0, not the in-memory provider for production.
260+
**Memory not persisting**: Note that the in-memory provider loses data when the application restarts. Consider implementing a custom persistent provider for production use.
311261

312-
**Agent timeouts**: Complex LangGraph workflows may take time. Consider implementing timeout handling in your endpoints.
262+
**Agent timeouts**: Complex operations may take time. Consider implementing timeout handling in your endpoints.
313263

314264
**Memory growing too large**: Implement periodic cleanup or use providers with built-in retention policies.

0 commit comments

Comments
 (0)