GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — langhost/README.md at main · langhost/langhost

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
256 lines (191 loc) · 10.2 KB
/

README.md

Copy path

File metadata and controls

256 lines (191 loc) · 10.2 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

langhost

Open-source, self-hosted LangGraph Agent Server.
Production Postgres + Redis. Same SDK. Same Studio. Zero code changes.

Independent project; not affiliated with or endorsed by LangChain.

GitHub stars   CI   PyPI   runtime PyPI   Python   MIT   100% open source

If this saves you a license key (or a weekend), ⭐ star the repo — it keeps this 100% open-source effort alive.

langhost quick start — from uv add to a live Agent Server (click for interactive player)

From uv add langhost to a live Agent Server — same SDK, same Studio, your Postgres + Redis. Click the demo to pause / seek.


langhost is the open way to run a production-grade LangGraph Agent Server on your Postgres and Redis — no closed runtime, no license key for persistence.

It is 100% compatible with the LangGraph ecosystem. Existing LangGraph projects (with a normal langgraph.json) should run without any code changes: add langhost, point at Postgres + Redis, and serve.

Compatible with:

LangSmith Studio · langgraph-sdk · Agent Protocol · Agent Chat UI · MCP · A2A · AG-UI / CopilotKit

Why langhost?

langgraph dev LangSmith Deployments Aegra langhost
Best for Fast local iteration Managed cloud or licensed self-host Self-hosted prod with an open FastAPI stack Self-hosted prod with the stock Agent Server
Persistence backend In-memory + local disk (.langgraph_api) Postgres + Redis Postgres + Redis Postgres + Redis
Persistence runtime Proprietary (langgraph-runtime-inmem, Elastic-2.0) Proprietary (licensed) Open (Apache-2.0) Open (MIT, langgraph-runtime-pg)
HTTP / API stack Official Agent Server Official Agent Server Independent FastAPI implementation Official Agent Server
Official protocols & extras MCP, A2A, Generative UI, webhooks MCP, A2A, Generative UI, webhooks Core Agent Protocol; MCP / A2A coming soon MCP, A2A, Generative UI, webhooks
LangGraph SDK / Studio Yes Yes Yes Yes
Config langgraph.json langgraph.json aegra.json (falls back to langgraph.json) langgraph.json
Project license Elastic-2.0 (runtime) Proprietary / commercial Apache-2.0 MIT
License key for self-host Not required (dev) Required (LANGGRAPH_CLOUD_LICENSE_KEY) None None

Official langgraph dev is ideal for in-memory development. Aegra reimplements the Agent Protocol serving layer as an open FastAPI stack. langhost keeps stock langgraph-api and swaps in MIT persistence — same MCP / A2A / Generative UI / webhooks, durable state, no license key.

How it fits together

  Studio / SDK / Chat UI / MCP / A2A
                 │
                 ▼
            langhost serve          ← this CLI (MIT)
                 │
                 ▼
           langgraph-api            ← stock Agent Server (unchanged)
                 │
                 ▼
      langgraph-runtime-pg          ← open Postgres + Redis runtime (MIT)
                 │
          ┌──────┴──────┐
          ▼             ▼
      Postgres        Redis
  • langhost — the friendly CLI you run (langhost serve)
  • langgraph-runtime-pg — the backbone: clean-room Postgres + Redis runtime (LANGGRAPH_RUNTIME_EDITION=pg) that plugs into stock langgraph-api
  • Your graphs — whatever you already have in langgraph.json; no rewrites

No API fork. No second protocol. Clients keep talking to the official Agent Server.

Quick start

Prerequisites: Python 3.11+, uv, Docker (only if you need local Postgres/Redis)

1. Scaffold a LangGraph app

Same flow as the official local server guide:

uvx --from langgraph-cli@latest langgraph new

Follow the on-screen prompts, then:

cd <your-project>
uv sync

Already have a LangGraph project? Skip scaffolding — jump to the next step.

2. Add langhost

uv add langhost

That pulls in langgraph-runtime-pg (the open runtime) automatically.

3. Start Postgres + Redis (if needed)

If you do not already have them running:

docker compose -f https://github.com/langhost/langhost.git#main:docker-compose.yml up -d

4. Configure .env

Create or update .env in your project root:

DATABASE_URI=postgresql+asyncpg://postgres:postgres@localhost:5432/langgraph?sslmode=disable
REDIS_URI=redis://localhost:6379/0

Add other environment variables as needed.

5. Serve

# Development — hot reload on code changes
uv run langhost serve --reload

# Production — bind all interfaces; scale workers as needed
uv run langhost serve --host 0.0.0.0 --workers 4

Default port is 31296. You should see API, Studio, docs, and Agent Chat UI URLs in the banner:

  • API: http://127.0.0.1:31296
  • Studio: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:31296
  • Docs: http://127.0.0.1:31296/docs
  • Agent Chat UI: https://agentchat.vercel.app/?apiUrl=http://127.0.0.1:31296&assistantId=agent

Tip: Safari often blocks localhost ↔ Studio. Use uv run langhost serve --reload --tunnel.

6. Call it like any Agent Server

from langgraph_sdk import get_client
import asyncio

client = get_client(url="http://127.0.0.1:31296")

async def main():
    async for chunk in client.runs.stream(
        None,  # threadless run
        "agent",  # graph / assistant name from langgraph.json
        input={"messages": [{"role": "human", "content": "What is LangGraph?"}]},
    ):
        print(chunk.event, chunk.data)

asyncio.run(main())

Same SDK. Same endpoints. Same Studio. Fully self-hosted.

What you get

  • 100% open source (MIT) — runtime + CLI you can audit, fork, and run anywhere
  • Drop-in for existing LangGraph apps — keep your langgraph.json and graph code
  • Official Agent Server surface — assistants, threads, runs, store, crons, SSE streaming
  • Studio-ready — open the printed Studio URL and debug like local langgraph dev
  • Ecosystem protocols — Agent Protocol (LangChain), plus MCP / A2A surfaces from the stock server
  • Horizontal scale — multi-replica claim/reclaim on Postgres + Redis
  • First-party checkpoints — via langgraph-checkpoint-postgres

Migrations

Schema is managed by Alembic inside langgraph-runtime-pg:

export DATABASE_URI=postgresql+asyncpg://postgres:postgres@localhost:5432/langgraph
uv run langgraph-runtime-pg-migrate upgrade
uv run langgraph-runtime-pg-migrate current
Environment Recommendation
Dev / tests Auto-migrate on (default)
Production Run migrate once before rollout; disable auto-migrate

Repository layout

libs/langhost/                 # CLI: langhost serve
libs/langgraph-runtime-pg/     # Open Postgres + Redis runtime (the backbone)
docker-compose.yml             # Local Postgres 16 + Redis 7
scripts/test.sh                # Full local e2e runner

Develop this repo

git clone https://github.com/langhost/langhost.git
cd langhost
uv sync --group dev
cp .env.example .env
docker compose up -d
./scripts/test.sh

See CONTRIBUTING.md.

License

MIT © Mohankumar Ramachandran — 100% open source.

Not affiliated with LangChain. When you run stock langgraph-api, you must still comply with its Elastic License 2.0. This project replaces the closed Postgres/Redis runtime, not the API package’s license.


Built in the open. If langhost helps you ship, a star goes a long way. ⭐

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.