Metadata-Version: 2.3
Name: agent-api-server
Version: 2.2.1
Summary: A Langgraph agent API server that implements Langgraph agent's web capabilities and can interact with chatbot
Keywords: fastapi,langgraph,agent,api-server
Author: Zijie Zhang
Author-email: zijie.zhang@advantech.com.cn
Requires-Python: >=3.11,<3.14
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
Requires-Dist: aiohttp (>=3.13.3,<4.0.0)
Requires-Dist: authlib (>=1.6.5)
Requires-Dist: cryptography (>=45.0.4,<46.0.0)
Requires-Dist: fastapi (>=0.117.0,<0.121.2)
Requires-Dist: fastmcp (>=2.13.0,<3.0.0)
Requires-Dist: langchain (>=1.2.0,<2.0.0)
Requires-Dist: langchain-core (>=1.2.5,<2.0.0)
Requires-Dist: langchain-mcp-adapters (>=0.2.1,<0.3.0)
Requires-Dist: langgraph (>=1.0.6,<2.0.0)
Requires-Dist: langgraph-checkpoint (>=4.0.0,<5.0.0)
Requires-Dist: langgraph-checkpoint-postgres (>=3.0.3,<4.0.0)
Requires-Dist: llm-sdk (==1.0.1)
Requires-Dist: model-manage-client (>=0.0.1.8)
Requires-Dist: nats-py (>=2.11.0,<3.0.0)
Requires-Dist: psycopg-binary (>=3.2.9,<4.0.0)
Requires-Dist: psycopg-pool (>=3.2.6,<4.0.0)
Requires-Dist: pydantic-settings (>=2.9.1,<3.0.0)
Requires-Dist: redis (>=6.2.0,<7.0.0)
Requires-Dist: starlette (>=0.49.3,<0.50.0)
Requires-Dist: tenacity (>=9.1.2,<10.0.0)
Project-URL: Homepage, https://gitlab.wise-paas.com/openai/agent_api_server
Project-URL: Repository, https://gitlab.wise-paas.com/openai/agent_api_server
Description-Content-Type: text/markdown

# agent-api-server

`agent-api-server` is a FastAPI-based API server for LangGraph agents. It exposes REST endpoints for thread, schema, graph, and runtime configuration management, and it serves a built-in web client from `/site`.

## Features

- FastAPI application factory for embedding or standalone deployment
- LangGraph-oriented API routes under `/api/v1`
- Built-in static client assets bundled in both sdist and wheel artifacts
- Redis-backed thread storage and PostgreSQL checkpoint integration
- Optional integration with config center, SSO, MCP, and model management services

## Requirements

- Python 3.11 to 3.13
- Redis
- PostgreSQL
- Access to all runtime dependencies declared in `pyproject.toml`

## Installation

Install from a package index that provides all required dependencies:

```bash
pip install agent-api-server
```

This project depends on `llm-sdk` and `model-manage-client`. If those packages are hosted on a private index in your environment, configure `pip` or Poetry to use that index before installation.

## Configuration

The server reads configuration from environment variables. Common settings include:

```env
REDIS_URL=redis://localhost:6379/0
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/postgres
MODEL_MANAGER_SERVICE_URL=http://127.0.0.1:10053
SERVER_PORT=8080
SERVER_WORKER_AMOUNT=1
LOG_LEVEL=INFO
ENABLE_MCP_SERVER=False
```

See `.env_example` for a more complete example.

## Running the server

Run the application with Uvicorn:

```bash
uvicorn agent_api_server.service:create_fastapi_app --factory --host 0.0.0.0 --port 8080
```

After startup:

- API root: `http://127.0.0.1:8080/api/v1`
- OpenAPI docs: `http://127.0.0.1:8080/docs`
- Built-in client: `http://127.0.0.1:8080/site`

## Build

Build source and wheel distributions with Poetry:

```bash
poetry build
```

## Repository

Source repository: <https://gitlab.wise-paas.com/openai/agent_api_server>

