docs: update documentation structure and content

This commit is contained in:
jinli.yl 2025-10-23 17:58:25 +08:00
parent 82d0adc86e
commit c314a82039
6 changed files with 145 additions and 87 deletions

3
.gitignore vendored
View file

@ -28,4 +28,5 @@ cookbook/appworld/exp_result/*
file_vector_store/*
cookbook/appworld/file_vector_store/*
/.venv/
site/*
site/*
docs/_build/*

View file

@ -19,6 +19,9 @@ execute:
parse:
myst_enable_extensions:
- colon_fence
- deflist
- attrs_inline
- dollarmath
# Define the name of the latex output file for PDF builds
latex:

View file

@ -31,11 +31,6 @@ parts:
- file: tool_memory/tool_summary_ops
- file: tool_memory/tool_bench
- caption: SOP Memory
maxdepth: 1
chapters:
- file: sop_memory/making_sop_memories
- caption: Extensions
maxdepth: 1
chapters:

View file

@ -17,7 +17,7 @@ kernelspec:
<div class="flex justify-center space-x-3">
<a href="https://pypi.org/project/reme-ai/"><img src="https://img.shields.io/badge/python-3.12+-blue" alt="Python Version"></a>
<a href="https://pypi.org/project/reme-ai/"><img src="https://img.shields.io/badge/pypi-v0.1-blue?logo=pypi" alt="PyPI Version"></a>
<a href="https://pypi.org/project/reme-ai/"><img src="https://img.shields.io/badge/pypi-v0.1.10.3-blue?logo=pypi" alt="PyPI Version"></a>
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-black" alt="License"></a>
<a href="https://github.com/modelscope/ReMe"><img src="https://img.shields.io/github/stars/modelscope/ReMe?style=social" alt="GitHub Stars"></a>
</div>
@ -41,44 +41,45 @@ Personal memory helps "**understand user preferences**", task memory helps agent
ReMe integrates three complementary memory capabilities:
```{admonition} Task Memory/Experience
:::{admonition} Task Memory/Experience
:class: note
Procedural knowledge reused across agents
Procedural knowledge reused across agents
- **Success Pattern Recognition**: Identify effective strategies and understand their underlying principles
- **Failure Analysis Learning**: Learn from mistakes and avoid repeating the same issues
- **Comparative Patterns**: Different sampling trajectories provide more valuable memories through comparison
- **Validation Patterns**: Confirm the effectiveness of extracted memories through validation modules
- **Success Pattern Recognition**: Identify effective strategies and understand their underlying principles
- **Failure Analysis Learning**: Learn from mistakes and avoid repeating the same issues
- **Comparative Patterns**: Different sampling trajectories provide more valuable memories through comparison
- **Validation Patterns**: Confirm the effectiveness of extracted memories through validation modules
```
:::
Learn more about how to use task memory from [task memory](task_memory/task_memory.md)
```{admonition} Personal Memory
:::{admonition} Personal Memory
:class: note
Contextualized memory for specific users
Contextualized memory for specific users
- **Individual Preferences**: User habits, preferences, and interaction styles
- **Contextual Adaptation**: Intelligent memory management based on time and context
- **Progressive Learning**: Gradually build deep understanding through long-term interaction
- **Time Awareness**: Time sensitivity in both retrieval and integration
- **Individual Preferences**: User habits, preferences, and interaction styles
- **Contextual Adaptation**: Intelligent memory management based on time and context
- **Progressive Learning**: Gradually build deep understanding through long-term interaction
- **Time Awareness**: Time sensitivity in both retrieval and integration
```
:::
Learn more about how to use personal memory from [personal memory](personal_memory/personal_memory.md)
```{admonition} Tool Memory
:::{admonition} Tool Memory
:class: note
Data-driven tool selection and usage optimization
Data-driven tool selection and usage optimization
- **Historical Performance Tracking**: Success rates, execution times, and token costs from real usage
- **LLM-as-Judge Evaluation**: Qualitative insights on why tools succeed or fail
- **Parameter Optimization**: Learn optimal parameter configurations from successful calls
- **Dynamic Guidelines**: Transform static tool descriptions into living, learned manuals
- **Historical Performance Tracking**: Success rates, execution times, and token costs from real usage
- **LLM-as-Judge Evaluation**: Qualitative insights on why tools succeed or fail
- **Parameter Optimization**: Learn optimal parameter configurations from successful calls
- **Dynamic Guidelines**: Transform static tool descriptions into living, learned manuals
```
:::
Learn more about how to use tool memory from [tool memory](tool_memory/tool_memory.md)

View file

@ -42,6 +42,27 @@ reme \
`````{tab-set}
````{tab-item} python(http)
```{code-block}
import requests
# Experience Summarizer: Learn from execution trajectories
response = requests.post("http://localhost:8002/summary_task_memory", json={
"workspace_id": "task_workspace",
"trajectories": [
{"messages": [{"role": "user", "content": "Help me create a project plan"}], "score": 1.0}
]
})
# Retriever: Get relevant memories
response = requests.post("http://localhost:8002/retrieve_task_memory", json={
"workspace_id": "task_workspace",
"query": "How to efficiently manage project progress?",
"top_k": 1
})
```
````
````{tab-item} python(import)
```{code-block}
import asyncio
@ -82,27 +103,6 @@ if __name__ == "__main__":
```
````
````{tab-item} python(http)
```{code-block}
import requests
# Experience Summarizer: Learn from execution trajectories
response = requests.post("http://localhost:8002/summary_task_memory", json={
"workspace_id": "task_workspace",
"trajectories": [
{"messages": [{"role": "user", "content": "Help me create a project plan"}], "score": 1.0}
]
})
# Retriever: Get relevant memories
response = requests.post("http://localhost:8002/retrieve_task_memory", json={
"workspace_id": "task_workspace",
"query": "How to efficiently manage project progress?",
"top_k": 1
})
```
````
````{tab-item} curl
```bash
# Experience Summarizer: Learn from execution trajectories
@ -164,11 +164,37 @@ fetch("http://localhost:8002/retrieve_task_memory", {
#### Personal Memory Management
<summary> import version</summary>
`````{tab-set}
````{tab-item} Python(import)
```{code-cell}
````{tab-item} python(http)
```{code-block}
import requests
# Memory Integration: Learn from user interactions
response = requests.post("http://localhost:8002/summary_personal_memory", json={
"workspace_id": "task_workspace",
"trajectories": [
{"messages":
[
{"role": "user", "content": "I like to drink coffee while working in the morning"},
{"role": "assistant",
"content": "I understand, you prefer to start your workday with coffee to stay energized"}
]
}
]
})
# Memory Retrieval: Get personal memory fragments
response = requests.post("http://localhost:8002/retrieve_personal_memory", json={
"workspace_id": "task_workspace",
"query": "What are the user's work habits?",
"top_k": 5
})
```
````
````{tab-item} python(import)
```{code-block}
import asyncio
from reme_ai import ReMeApp
@ -208,32 +234,7 @@ if __name__ == "__main__":
```
````
```{code-cell}
# Memory Integration: Learn from user interactions
response = requests.post("http://localhost:8002/summary_personal_memory", json={
"workspace_id": "task_workspace",
"trajectories": [
{"messages":
[
{"role": "user", "content": "I like to drink coffee while working in the morning"},
{"role": "assistant",
"content": "I understand, you prefer to start your workday with coffee to stay energized"}
]
}
]
})
# Memory Retrieval: Get personal memory fragments
response = requests.post("http://localhost:8002/retrieve_personal_memory", json={
"workspace_id": "task_workspace",
"query": "What are the user's work habits?",
"top_k": 5
})
```
````{dropdown} curl version
````{tab-item} curl
```bash
# Memory Integration: Learn from user interactions
curl -X POST http://localhost:8002/summary_personal_memory \
@ -259,8 +260,7 @@ curl -X POST http://localhost:8002/retrieve_personal_memory \
```
````
````{dropdown} Node.js version
````{tab-item} Node.js
```{code-block} javascript
// Memory Integration: Learn from user interactions
fetch("http://localhost:8002/summary_personal_memory", {
@ -297,11 +297,15 @@ fetch("http://localhost:8002/retrieve_personal_memory", {
.then(data => console.log(data));
```
````
`````
#### Tool Memory Management
```{code-cell}
`````{tab-set}
````{tab-item} python(http)
```{code-block}
import requests
# Record tool execution results
@ -332,10 +336,59 @@ response = requests.post("http://localhost:8002/retrieve_tool_memory", json={
"tool_names": "web_search"
})
```
````
````{tab-item} python(import)
```{code-block}
import asyncio
from reme_ai import ReMeApp
````{dropdown} curl version
async def main():
async with ReMeApp(
"llm.default.model_name=qwen3-30b-a3b-thinking-2507",
"embedding_model.default.model_name=text-embedding-v4",
"vector_store.default.backend=memory"
) as app:
# Record tool execution results
result = await app.async_execute(
name="add_tool_call_result",
workspace_id="tool_workspace",
tool_call_results=[
{
"create_time": "2025-10-21 10:30:00",
"tool_name": "web_search",
"input": {"query": "Python asyncio tutorial", "max_results": 10},
"output": "Found 10 relevant results...",
"token_cost": 150,
"success": True,
"time_cost": 2.3
}
]
)
print(result)
# Generate usage guidelines from history
result = await app.async_execute(
name="summary_tool_memory",
workspace_id="tool_workspace",
tool_names="web_search"
)
print(result)
# Retrieve tool guidelines before use
result = await app.async_execute(
name="retrieve_tool_memory",
workspace_id="tool_workspace",
tool_names="web_search"
)
print(result)
if __name__ == "__main__":
asyncio.run(main())
```
````
````{tab-item} curl
```bash
# Record tool execution results
curl -X POST http://localhost:8002/add_tool_call_result \
@ -373,8 +426,7 @@ curl -X POST http://localhost:8002/retrieve_tool_memory \
```
````
````{dropdown} Node.js version
````{tab-item} Node.js
```{code-block} javascript
// Record tool execution results
fetch("http://localhost:8002/add_tool_call_result", {
@ -428,4 +480,5 @@ fetch("http://localhost:8002/retrieve_tool_memory", {
.then(response => response.json())
.then(data => console.log(data));
```
````
````
`````

View file

@ -27,6 +27,11 @@ dependencies = [
"flowllm[reme]>=0.1.11.3",
]
[project.optional-dependencies]
dev = ["jupyter-book", "ghp-import", "myst-nb", "sphinxcontrib-bibtex", "furo", "sphinxcontrib-mermaid"]
all = ["reme_ai[dev]"]
[tool.setuptools.packages.find]
where = ["."]
include = ["reme_ai*"]