Metadata-Version: 2.5
Name: zorvex-api
Version: 0.0.8
Summary: The Zorvex server: the LangGraph Agent Server API, self-hosted on PostgreSQL
Project-URL: Homepage, https://github.com/opendesign-os/zorvex
Project-URL: Source, https://github.com/opendesign-os/zorvex/tree/main/libs/zorvex-api
Project-URL: Issues, https://github.com/opendesign-os/zorvex/issues
License-Expression: Apache-2.0
Keywords: agent-protocol,agents,fastapi,langgraph,llm
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Requires-Dist: alembic>=1.20.1
Requires-Dist: anyio>=4.16.0
Requires-Dist: asgi-correlation-id>=5.0.1
Requires-Dist: colorama>=0.4.6; sys_platform == 'win32'
Requires-Dist: croniter>=7.0.0
Requires-Dist: cryptography>=46.0.0
Requires-Dist: fastapi>=0.165.0
Requires-Dist: greenlet>=3.5.6
Requires-Dist: httpx>=0.29.0
Requires-Dist: jsonschema>=4.26.0
Requires-Dist: langchain-core>=1.8.5
Requires-Dist: langchain-protocol>=0.0.22
Requires-Dist: langgraph-checkpoint-postgres>=3.2.1
Requires-Dist: langgraph-sdk>=0.4.14
Requires-Dist: langgraph>=1.2.24
Requires-Dist: mcp>=2.3.0
Requires-Dist: openinference-instrumentation-langchain>=0.1.90
Requires-Dist: opentelemetry-api>=1.45.2
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.45.2
Requires-Dist: opentelemetry-instrumentation-fastapi>=0.66b2
Requires-Dist: opentelemetry-sdk>=1.45.2
Requires-Dist: prometheus-fastapi-instrumentator>=8.1.0
Requires-Dist: psycopg[binary,pool]>=3.3.9
Requires-Dist: pydantic-settings>=2.16.3
Requires-Dist: pydantic>=2.14.4
Requires-Dist: redis[hiredis]>=8.2.0
Requires-Dist: sqlalchemy>=2.1.9
Requires-Dist: sse-starlette<4.0.0,>=3.7.1
Requires-Dist: standardwebhooks>=1.3.0
Requires-Dist: structlog>=26.1.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: uvicorn[standard]>=0.55.0
Description-Content-Type: text/markdown

# zorvex-api

[Zorvex](https://github.com/opendesign-os/zorvex) 的服务器：一个基于 FastAPI 的应用，以 LangSmith Agent Server 的
API 运行 [LangGraph](https://github.com/langchain-ai/langgraph) 图，数据存放在 PostgreSQL。LangGraph SDK 以及基于
它构建的客户端无需改动即可接入。

创建和运行项目请安装 [zorvex-cli](https://pypi.org/project/zorvex-cli/)，它会连同本包和 `zorvex` 命令一起安装。

## 直接运行

```bash
pip install zorvex-api
export DATABASE_URI=postgresql://zorvex:secret@localhost:5432/zorvex   # 使用当前目录下的 zorvex.json
uvicorn zorvex_api.main:app --host 0.0.0.0 --port 2026
```

服务器启动时会执行数据库迁移。在 Windows 上需要加 `--loop zorvex_api.utils.event_loop:selector_loop_factory`：
psycopg 的异步模式需要 selector 事件循环。

## 提供的接口

- `/assistants`、`/threads`、`/runs`、`/runs/crons` 和 `/store`：Agent Server API，行为与 `langgraph-api` 0.19
  一致，支持 SSE 流式输出与续流；store 按用户隔离，见根目录 README 的“API 兼容性”。
- `/threads/{thread_id}/stream/events` 和 `/threads/{thread_id}/commands`：Agent Protocol v2 事件流，基于 SSE 与
  WebSocket。
- `/mcp`：把部署内的 assistant 作为 MCP 服务器。
- `/a2a/{assistant_id}`：把每个 assistant 作为 A2A 智能体，附带其 agent card。
- `/ok`、`/info` 和 `/metrics`：存活检查、版本与特性、Prometheus 指标；`/docs` 为 API 文档。

## 了解更多

配置（`zorvex.json` 与环境变量）、部署和 API 兼容性见 [Zorvex README](https://github.com/opendesign-os/zorvex#readme)。

基于 [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0) 许可发布。
