Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Docs

on:
push:
branches:
- main
paths:
- "docs/mkdocs/**"
- "mkdocs.yml"
- ".github/workflows/docs.yml"
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install MkDocs
run: python -m pip install --upgrade pip mkdocs

- name: Build documentation
run: mkdocs build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: site

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
21 changes: 21 additions & 0 deletions docs/mkdocs/en/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# English Documentation

Welcome to the English documentation for tRPC-Agent-Python.

## Getting Started

- [LLM Agent](./llm_agent.md): Build a general-purpose LLM-powered agent.
- [Model Invocation](./model.md): Configure OpenAI, Anthropic, and LiteLLM models.
- [Tools](./tool.md): Add function tools, file tools, MCP tools, and agent tools.
- [Skills](./skill.md): Package reusable workflows with `SKILL.md`.
- [Code Executor](./code_executor.md): Execute code through local or sandboxed runtimes.

## Core Capabilities

- [Session](./session.md): Manage conversation events and state.
- [Memory](./memory.md): Store and retrieve long-term memories.
- [Knowledge](./knowledge.md): Build RAG workflows with LangChain components.
- [Multi-Agent](./multi_agents.md): Compose agents for complex workflows.
- [Evaluation](./evaluation.md): Evaluate agent behavior and response quality.

For source code and examples, see the [GitHub repository](https://github.com/trpc-group/trpc-agent-python).
12 changes: 10 additions & 2 deletions docs/mkdocs/en/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ session = await session_service.get_session(

**List Sessions**:
```python
# Specify user_id: returns all sessions for that user (without events)
session_list = await session_service.list_sessions(
app_name="my_app",
user_id="user_001"
)
# Returns ListSessionsResponse, containing all sessions for the user (without events)

# user_id=None: returns sessions across all users for the app
all_session_list = await session_service.list_sessions(
app_name="my_app",
user_id=None
)
# Returns ListSessionsResponse, containing matching sessions (without events)
```

**Delete Session**:
Expand All @@ -128,7 +135,7 @@ await session_service.delete_session(
**Implementation Logic** (`_base_session_service.py`):
- `create_session`: Creates a session, separates and stores app/user/session state
- `get_session`: Retrieves a session, merges app/user/session state, applies event filtering
- `list_sessions`: Lists sessions (excludes events to reduce data transfer)
- `list_sessions`: Lists sessions (excludes events to reduce data transfer); passing `user_id=None` returns sessions across all users for the app
- `delete_session`: Deletes a session and its associated data

---
Expand Down Expand Up @@ -611,6 +618,7 @@ session = await session_service.get_session(
)

# List existing Sessions
# Specify user_id to return that user's sessions; user_id=None returns sessions across all users for the app
session_list = await session_service.list_sessions(
app_name=app_name,
user_id=user_id
Expand Down
23 changes: 23 additions & 0 deletions docs/mkdocs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# tRPC-Agent-Python Documentation

tRPC-Agent-Python is a production-grade Agent framework deeply integrated with the Python AI ecosystem. It provides an end-to-end foundation for agent building, orchestration, tool integration, session and long-term memory, service deployment, and observability.

Choose a language to get started:

- [English Documentation](./en/)
- [中文文档](./zh/)

## Quick Links

- [LLM Agent](./en/llm_agent.md)
- [Model Invocation](./en/model.md)
- [Tools](./en/tool.md)
- [Skills](./en/skill.md)
- [Code Executor](./en/code_executor.md)
- [Session](./en/session.md)
- [Memory](./en/memory.md)

## Project

- [GitHub Repository](https://github.com/trpc-group/trpc-agent-python)
- [PyPI Package](https://pypi.org/project/trpc-agent-py/)
21 changes: 21 additions & 0 deletions docs/mkdocs/zh/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 中文文档

欢迎阅读 tRPC-Agent-Python 中文文档。

## 快速开始

- [LLM Agent](./llm_agent.md):构建通用 LLM Agent。
- [模型调用](./model.md):配置 OpenAI、Anthropic 和 LiteLLM 模型。
- [工具](./tool.md):接入函数工具、文件工具、MCP 工具和 Agent 工具。
- [Skills](./skill.md):通过 `SKILL.md` 封装可复用工作流。
- [代码执行器](./code_executor.md):通过本地或沙箱运行时代码执行。

## 核心能力

- [Session](./session.md):管理会话事件与状态。
- [Memory](./memory.md):存储和检索长期记忆。
- [Knowledge](./knowledge.md):基于 LangChain 组件构建 RAG 工作流。
- [多 Agent](./multi_agents.md):编排多个 Agent 完成复杂任务。
- [Evaluation](./evaluation.md):评测 Agent 行为和回复质量。

源码与示例请参考 [GitHub 仓库](https://github.com/trpc-group/trpc-agent-python)。
12 changes: 10 additions & 2 deletions docs/mkdocs/zh/session.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,18 @@ session = await session_service.get_session(

**列出会话**:
```python
# 指定 user_id:返回该用户的所有会话(不含 events)
session_list = await session_service.list_sessions(
app_name="my_app",
user_id="user_001"
)
# 返回 ListSessionsResponse,包含该用户的所有会话(不含 events)

# user_id 为 None:返回该 app 下所有用户的会话
all_session_list = await session_service.list_sessions(
app_name="my_app",
user_id=None
)
# 返回 ListSessionsResponse,包含符合条件的所有会话(不含 events)
```

**删除会话**:
Expand All @@ -128,7 +135,7 @@ await session_service.delete_session(
**实现逻辑**(`_base_session_service.py`):
- `create_session`:创建会话,分离并存储 app/user/session 状态
- `get_session`:获取会话,合并 app/user/session 状态,应用事件过滤
- `list_sessions`:列出会话列表(不包含 events,减少数据传输)
- `list_sessions`:列出会话列表(不包含 events,减少数据传输);`user_id` 传 `None` 时返回该 app 下所有用户的会话
- `delete_session`:删除会话及其关联数据

---
Expand Down Expand Up @@ -611,6 +618,7 @@ session = await session_service.get_session(
)

# 列出存在的 Session
# 指定 user_id 返回该用户的会话;user_id=None 返回该 app 下所有用户的会话
session_list = await session_service.list_sessions(
app_name=app_name,
user_id=user_id
Expand Down
9 changes: 6 additions & 3 deletions examples/langgraph_agent/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def build_calculator_subgraph():
api_key, url, model_name = get_model_config()
model = init_chat_model(
model_name,
model_provider="openai",
api_key=api_key,
api_base=url,
base_url=url,
)

tools = [calculate]
Expand Down Expand Up @@ -79,8 +80,9 @@ def build_graph_with_subgraph():
api_key, url, model_name = get_model_config()
model = init_chat_model(
model_name,
model_provider="openai",
api_key=api_key,
api_base=url,
base_url=url,
)

# Build calculator subgraph
Expand Down Expand Up @@ -126,8 +128,9 @@ def build_graph():
api_key, url, model_name = get_model_config()
model = init_chat_model(
model_name,
model_provider="openai",
api_key=api_key,
api_base=url,
base_url=url,
)

tools = [calculate]
Expand Down
3 changes: 2 additions & 1 deletion examples/langgraph_agent_with_cancel/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def build_graph():
api_key, url, model_name = get_model_config()
model = init_chat_model(
model_name,
model_provider="openai",
api_key=api_key,
api_base=url,
base_url=url,
)

tools = [calculate, analyze_data]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def _build_graph():
api_key, url, model_name = get_model_config()
model = init_chat_model(
model_name,
model_provider="openai",
api_key=api_key,
api_base=url,
base_url=url,
)
tools = [execute_database_operation]
llm_with_tools = model.bind_tools(tools)
Expand Down
4 changes: 2 additions & 2 deletions examples/mem0_tools/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from trpc_agent_sdk.agents import LlmAgent
from trpc_agent_sdk.models import LLMModel
from trpc_agent_sdk.models import OpenAIModel
from trpc_agent_sdk.tools.mem0_tools import SaveMemoryTool
from trpc_agent_sdk.tools.mem0_tools import SearchMemoryTool
from trpc_agent_sdk.tools.mem0_tool import SaveMemoryTool
from trpc_agent_sdk.tools.mem0_tool import SearchMemoryTool

from .config import get_mem0_platform_config
from .config import get_memory_config
Expand Down
105 changes: 105 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
site_name: tRPC-Agent-Python
site_description: Python LLM agent framework with multi-model support, tool calling, session management, and service integrations.
site_url: https://trpc-group.github.io/trpc-agent-python/
repo_url: https://github.com/trpc-group/trpc-agent-python
repo_name: trpc-group/trpc-agent-python
docs_dir: docs/mkdocs
site_dir: site

theme:
name: readthedocs
locale: en

markdown_extensions:
- admonition
- fenced_code
- tables
- toc:
permalink: true

nav:
- Home: index.md
- English:
- Overview: en/index.md
- Agent:
- LLM Agent: en/llm_agent.md
- Custom Agent: en/custom_agent.md
- LangGraph Agent: en/langgraph_agent.md
- Claude Agent: en/claude_agent.md
- Multi-Agent: en/multi_agents.md
- Team: en/team.md
- Graph: en/graph.md
- Sub Agent: en/sub_agent.md
- Model: en/model.md
- Tools:
- Tool: en/tool.md
- Code Executor: en/code_executor.md
- Skills: en/skill.md
- Session & Memory:
- Session: en/session.md
- SQL Session: en/session_sql.md
- Redis Session: en/session_redis.md
- Session Summary: en/session_summary.md
- Memory: en/memory.md
- Knowledge:
- Knowledge: en/knowledge.md
- Document Loader: en/knowledge_document_loader.md
- Text Splitter: en/knowledge_text_splitter.md
- Embedder: en/knowledge_embedder.md
- Vector Store: en/knowledge_vectorstore.md
- Retrievers: en/knowledge_retrievers.md
- Prompt Template: en/knowledge_prompt_template.md
- Custom Components: en/knowledge_custom_components.md
- Evaluation & Optimization:
- Evaluation: en/evaluation.md
- Optimization: en/optimization.md
- Integrations:
- A2A: en/a2a.md
- AG-UI: en/agui.md
- OpenClaw: en/openclaw.md
- Runtime:
- Filter: en/filter.md
- Human in the Loop: en/human_in_the_loop.md
- Cancellation: en/cancel.md
- 中文:
- 概览: zh/index.md
- Agent:
- LLM Agent: zh/llm_agent.md
- 自定义 Agent: zh/custom_agent.md
- LangGraph Agent: zh/langgraph_agent.md
- Claude Agent: zh/claude_agent.md
- 多 Agent: zh/multi_agents.md
- Team: zh/team.md
- Graph: zh/graph.md
- Sub Agent: zh/sub_agent.md
- 模型: zh/model.md
- 工具:
- 工具: zh/tool.md
- 代码执行器: zh/code_executor.md
- Skills: zh/skill.md
- Session 与 Memory:
- Session: zh/session.md
- SQL Session: zh/session_sql.md
- Redis Session: zh/session_redis.md
- Session Summary: zh/session_summary.md
- Memory: zh/memory.md
- Knowledge:
- Knowledge: zh/knowledge.md
- 文档加载器: zh/knowledge_document_loader.md
- 文本切分: zh/knowledge_text_splitter.md
- Embedder: zh/knowledge_embedder.md
- Vector Store: zh/knowledge_vectorstore.md
- Retrievers: zh/knowledge_retrievers.md
- Prompt Template: zh/knowledge_prompt_template.md
- 自定义组件: zh/knowledge_custom_components.md
- 评测与优化:
- Evaluation: zh/evaluation.md
- Optimization: zh/optimization.md
- 集成:
- A2A: zh/a2a.md
- AG-UI: zh/agui.md
- OpenClaw: zh/openclaw.md
- 运行时:
- Filter: zh/filter.md
- Human in the Loop: zh/human_in_the_loop.md
- Cancellation: zh/cancel.md
Loading
Loading