Developer/Products/Agent Server

Agent Server

@cognipeer/agent-server  ·  Around Agent SDK
stable

A production-ready serving layer that registers, versions, and exposes multiple AI agents as secure, streaming-enabled REST services with Swagger/OpenAPI documentation.

License  ·  MITTypeScript  ·  100%Audience  ·  Backend teams thatFits  ·  Serving custom agents
Serving custom agentsREST and SSE APIsVersioned agent deliveryBrowse recipes
Production install
$npm install @cognipeer/agent-server

What's in the box

Backend teams that need to publish agents as versioned APIs with streaming, auth, storage, and OpenAPI discovery. Each capability is opt-in — use the parts that fit, leave the rest.

Multi-Agent Registry

Registers and manages multiple agents within a central serving catalogue.

REST API

Exposes agents as standardised RESTful endpoints for application integration.

SSE Streaming

Streams real-time agent responses via Server-Sent Events.

Swagger / OpenAPI

Auto-generates interactive API documentation and testing interfaces.

Auth (JWT / Token)

Secures endpoints using token-based and JWT authentication models.

Publish & Version

Controls agent lifecycle through versioning, release, and publishing workflows.

Storage (Postgres / Mongo)

Persists conversations, messages, and metadata in scalable databases.

File Upload

Supports document ingestion and attachment handling within agent interactions.

How it runs

Wrap any number of agents and publish them as versioned, streaming REST endpoints with OpenAPI discovery, JWT auth, and pluggable storage.

Step 1
Register
Step 2
Version
Step 3
Expose
REST + SSE
Step 4
Authenticate
JWT · token
Step 5
Persist
Mongo · Postgres
Step 6
Observe

Registry

  • Multi-agent catalog
  • Per-agent versions
  • Lifecycle hooks
  • Discovery endpoint

Transport

  • REST + JSON
  • Server-Sent Events
  • File uploads
  • OpenAPI / Swagger

Persistence

  • Conversations
  • Messages
  • Files
  • Trace events

Quickstart

Install, configure, run. The example below is the smallest piece of code that does something useful in production.

1import { createServer } from "@cognipeer/agent-server";
2import { supportAgent, salesAgent } from "./agents";
3 
4const server = createServer({
5  agents: [ supportAgent, salesAgent ],
6  auth: { type: "jwt", jwksUrl: env.JWKS },
7  storage: { kind: "mongo", url: env.MONGO_URL },
8  swagger: true,
9});
10 
11await server.listen(4000);  // REST + SSE on /agents/:id/run

How it compares

Against the around agent sdk options teams most often weigh — focused on operational concerns, not feature inventories.

CapabilityAgent ServerCustom FastAPI / ExpressOpenAI Assistants APILangServe (LangChain)
Multi-Agent Serving●  native◐  partial○  missing◐  partial
Streaming (SSE)●  native◐  partial●  native◐  partial
Built-in Auth●  native◐  partial●  native◐  partial
Built-in Storage●  native◐  partial●  native◐  partial
File Handling●  native◐  partial◐  partial◐  partial
OpenAPI / Swagger●  native◐  partial○  missing◐  partial

Patterns that use Agent Server

Production-tested recipes powered by this package.

Next steps