computenest-agent-integrations
面向 计算巢Agent部署 的集成库。以 Google ADK(Agent Development Kit)为底层 Agent 架构,将部署所需的能力与 ADK 标准接口对接,帮助开发者在 ADK 生态中构建、集成并部署 Agent 服务。
凭证由调用方在运行时传入,库内不包含任何密钥。
环境要求
- Python >= 3.12
安装
pip install computenest-agent-integrations
使用 RAGFlow 集成时安装可选依赖:
pip install "computenest-agent-integrations[ragflow]"
Mem0 集成面向 self-host REST 服务实现,不依赖 mem0ai 平台版 SDK。使用时通过初始化参数显式传入 host 和 api_key。
架构说明
计算巢Agent部署 ADK Agent 架构
│ │
└──── ADK 集成适配层 ────┘
本库在 ADK 的 Tool、Memory、MCP 等扩展点上提供与计算巢Agent部署及云上 Agent 生态的对接实现。开发者使用标准 ADK API 编写 Agent 逻辑,通过本库接入部署侧所需的外部能力。
当前已提供的集成
以下为实现示例,后续会持续扩展更多计算巢Agent部署与 ADK 的对接能力:
from computenest.integrations.adk import (
BailianLongTermMemoryService,
Mem0SelfHostingMemoryService,
BailianRagTool,
RagflowKnowledgeBaseTool,
McpTool,
E2bSandboxToolset,
E2bCodeInterpreterToolset,
)
| 组件 | ADK 扩展点 | 说明 |
|---|---|---|
BailianRagTool |
Tool | 知识库检索 |
RagflowKnowledgeBaseTool |
Tool | 基于 RAGFlow dataset 的知识库检索,继承 ADK BaseTool |
McpTool |
Tool (MCP) | 从 MCP JSON 配置构建 McpToolset(支持任意 ${VAR} 占位符) |
BailianLongTermMemoryService |
Memory | 长期记忆存储与检索 |
Mem0SelfHostingMemoryService |
Memory | 基于开源版 self-host Mem0 REST 的长期记忆存储与检索 |
E2bSandboxToolset |
Tool | E2B 沙箱文件系统与 Shell 操作(文件读写、目录管理、命令执行) |
E2bCodeInterpreterToolset |
Tool | 在 E2B Code Interpreter 沙箱中执行 Python/JavaScript 代码,支持有状态 context 管理 |
接入 RAGFlow 知识库检索
RAGFlow 集成当前提供知识库检索 Tool。使用前需要准备 RAGFlow 服务地址、API Key 和 Dataset ID。
RAGFLOW_BASE_URL=http://your-ragflow-host
RAGFLOW_API_KEY=ragflow-xxxx
RAGFLOW_DATASET_IDS=dataset-id
from google.adk.agents.llm_agent import Agent
from computenest.integrations.adk import RagflowKnowledgeBaseTool
rag_tool = RagflowKnowledgeBaseTool(
base_url="http://localhost:9380",
api_key="ragflow-...",
dataset_ids=["dataset-id"],
)
agent = Agent(
model=...,
name="ragflow_agent",
tools=[rag_tool],
)
接入 ADK Agent
from google.adk.agents.llm_agent import Agent
from computenest.integrations.adk import BailianRagTool, McpTool, Mem0SelfHostingMemoryService
memory_service = Mem0SelfHostingMemoryService(
host="http://localhost:8888",
api_key="m0sk_...",
)
agent = Agent(
model=...,
name="my_agent",
tools=[rag_tool, *McpTool(mcp_config, variables={"DASHSCOPE_API_KEY": api_key})],
memory_service=memory_service,
)
各组件的初始化参数见源码 docstring。
相关链接
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file computenest_agent_integrations-0.1.7.tar.gz.
File metadata
- Download URL: computenest_agent_integrations-0.1.7.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d44876d4a1b53363b88750692edd6289101dfe5c91d8099246d405979932e23
|
|
| MD5 |
84ef3109d2c520bffcc81447374c10f0
|
|
| BLAKE2b-256 |
20c8642a76df640a72541d48baf468f5e054d75b21893b7d25271dcced7180a7
|
File details
Details for the file computenest_agent_integrations-0.1.7-py3-none-any.whl.
File metadata
- Download URL: computenest_agent_integrations-0.1.7-py3-none-any.whl
- Upload date:
- Size: 41.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8488b531a5ccdeaeaa438cabd934ee64b785b5291434bfc8aa84d927064bbd90
|
|
| MD5 |
92af923c43636640e7f67a967e2f8b89
|
|
| BLAKE2b-256 |
69593085eb5ef1851e2d360adaaabd10fde52876807938457488e20c6c28cfa2
|