@@ -42,6 +42,27 @@ reme \
4242
4343````` {tab-set}
4444
45+ ````{tab-item} python(http)
46+ ```{code-block}
47+ import requests
48+
49+ # Experience Summarizer: Learn from execution trajectories
50+ response = requests.post("http://localhost:8002/summary_task_memory", json={
51+ "workspace_id": "task_workspace",
52+ "trajectories": [
53+ {"messages": [{"role": "user", "content": "Help me create a project plan"}], "score": 1.0}
54+ ]
55+ })
56+
57+ # Retriever: Get relevant memories
58+ response = requests.post("http://localhost:8002/retrieve_task_memory", json={
59+ "workspace_id": "task_workspace",
60+ "query": "How to efficiently manage project progress?",
61+ "top_k": 1
62+ })
63+ ```
64+ ````
65+
4566````{tab-item} python(import)
4667```{code-block}
4768import asyncio
@@ -82,27 +103,6 @@ if __name__ == "__main__":
82103```
83104````
84105
85- ````{tab-item} python(http)
86- ```{code-block}
87- import requests
88-
89- # Experience Summarizer: Learn from execution trajectories
90- response = requests.post("http://localhost:8002/summary_task_memory", json={
91- "workspace_id": "task_workspace",
92- "trajectories": [
93- {"messages": [{"role": "user", "content": "Help me create a project plan"}], "score": 1.0}
94- ]
95- })
96-
97- # Retriever: Get relevant memories
98- response = requests.post("http://localhost:8002/retrieve_task_memory", json={
99- "workspace_id": "task_workspace",
100- "query": "How to efficiently manage project progress?",
101- "top_k": 1
102- })
103- ```
104- ````
105-
106106````{tab-item} curl
107107```bash
108108# Experience Summarizer: Learn from execution trajectories
@@ -164,11 +164,37 @@ fetch("http://localhost:8002/retrieve_task_memory", {
164164
165165#### Personal Memory Management
166166
167- <summary > import version</summary >
168167````` {tab-set}
169168
170- ````{tab-item} Python(import)
171- ```{code-cell}
169+ ````{tab-item} python(http)
170+ ```{code-block}
171+ import requests
172+
173+ # Memory Integration: Learn from user interactions
174+ response = requests.post("http://localhost:8002/summary_personal_memory", json={
175+ "workspace_id": "task_workspace",
176+ "trajectories": [
177+ {"messages":
178+ [
179+ {"role": "user", "content": "I like to drink coffee while working in the morning"},
180+ {"role": "assistant",
181+ "content": "I understand, you prefer to start your workday with coffee to stay energized"}
182+ ]
183+ }
184+ ]
185+ })
186+
187+ # Memory Retrieval: Get personal memory fragments
188+ response = requests.post("http://localhost:8002/retrieve_personal_memory", json={
189+ "workspace_id": "task_workspace",
190+ "query": "What are the user's work habits?",
191+ "top_k": 5
192+ })
193+ ```
194+ ````
195+
196+ ````{tab-item} python(import)
197+ ```{code-block}
172198import asyncio
173199from reme_ai import ReMeApp
174200
@@ -208,32 +234,7 @@ if __name__ == "__main__":
208234```
209235````
210236
211-
212- ```{code-cell}
213- # Memory Integration: Learn from user interactions
214- response = requests.post("http://localhost:8002/summary_personal_memory", json={
215- "workspace_id": "task_workspace",
216- "trajectories": [
217- {"messages":
218- [
219- {"role": "user", "content": "I like to drink coffee while working in the morning"},
220- {"role": "assistant",
221- "content": "I understand, you prefer to start your workday with coffee to stay energized"}
222- ]
223- }
224- ]
225- })
226-
227- # Memory Retrieval: Get personal memory fragments
228- response = requests.post("http://localhost:8002/retrieve_personal_memory", json={
229- "workspace_id": "task_workspace",
230- "query": "What are the user's work habits?",
231- "top_k": 5
232- })
233- ```
234-
235- ````{dropdown} curl version
236-
237+ ````{tab-item} curl
237238```bash
238239# Memory Integration: Learn from user interactions
239240curl -X POST http://localhost:8002/summary_personal_memory \
@@ -259,8 +260,7 @@ curl -X POST http://localhost:8002/retrieve_personal_memory \
259260```
260261````
261262
262- ````{dropdown} Node.js version
263-
263+ ````{tab-item} Node.js
264264```{code-block} javascript
265265// Memory Integration: Learn from user interactions
266266fetch("http://localhost:8002/summary_personal_memory", {
@@ -297,11 +297,15 @@ fetch("http://localhost:8002/retrieve_personal_memory", {
297297.then(data => console.log(data));
298298```
299299````
300+ `````
300301
301302
302303#### Tool Memory Management
303304
304- ```{code-cell}
305+ ````` {tab-set}
306+
307+ ````{tab-item} python(http)
308+ ```{code-block}
305309import requests
306310
307311# Record tool execution results
@@ -332,10 +336,59 @@ response = requests.post("http://localhost:8002/retrieve_tool_memory", json={
332336 "tool_names": "web_search"
333337})
334338```
339+ ````
335340
341+ ````{tab-item} python(import)
342+ ```{code-block}
343+ import asyncio
344+ from reme_ai import ReMeApp
345+
346+ async def main():
347+ async with ReMeApp(
348+ "llm.default.model_name=qwen3-30b-a3b-thinking-2507",
349+ "embedding_model.default.model_name=text-embedding-v4",
350+ "vector_store.default.backend=memory"
351+ ) as app:
352+ # Record tool execution results
353+ result = await app.async_execute(
354+ name="add_tool_call_result",
355+ workspace_id="tool_workspace",
356+ tool_call_results=[
357+ {
358+ "create_time": "2025-10-21 10:30:00",
359+ "tool_name": "web_search",
360+ "input": {"query": "Python asyncio tutorial", "max_results": 10},
361+ "output": "Found 10 relevant results...",
362+ "token_cost": 150,
363+ "success": True,
364+ "time_cost": 2.3
365+ }
366+ ]
367+ )
368+ print(result)
369+
370+ # Generate usage guidelines from history
371+ result = await app.async_execute(
372+ name="summary_tool_memory",
373+ workspace_id="tool_workspace",
374+ tool_names="web_search"
375+ )
376+ print(result)
377+
378+ # Retrieve tool guidelines before use
379+ result = await app.async_execute(
380+ name="retrieve_tool_memory",
381+ workspace_id="tool_workspace",
382+ tool_names="web_search"
383+ )
384+ print(result)
336385
337- ````{dropdown} curl version
386+ if __name__ == "__main__":
387+ asyncio.run(main())
388+ ```
389+ ````
338390
391+ ````{tab-item} curl
339392```bash
340393# Record tool execution results
341394curl -X POST http://localhost:8002/add_tool_call_result \
@@ -373,8 +426,7 @@ curl -X POST http://localhost:8002/retrieve_tool_memory \
373426```
374427````
375428
376- ````{dropdown} Node.js version
377-
429+ ````{tab-item} Node.js
378430```{code-block} javascript
379431// Record tool execution results
380432fetch("http://localhost:8002/add_tool_call_result", {
@@ -428,4 +480,5 @@ fetch("http://localhost:8002/retrieve_tool_memory", {
428480.then(response => response.json())
429481.then(data => console.log(data));
430482```
431- ````
483+ ````
484+ `````
0 commit comments