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 — GitHub - langhost/langhost: Open-source, self-hosted LangGraph Agent Server. Production Postgres + Redis. Same SDK. Same Studio. Zero code changes.

BranchesTags
Open more actions menu

Latest commit

 

History

103 Commits
103 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
libs
libs
 
 
scripts
scripts
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
pyproject.toml
pyproject.toml
 
 
sonar-project.properties
sonar-project.properties
 
 
uv.lock
uv.lock
 
 

Repository files navigation

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. ⭐

About

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

github.com/langhost/langhost

Topics

agent-protocolagent-serverai-agentslangchainlanggraphlanggraph-apilanggraph-runtimelanggraph-runtime-inmemlanggraph-runtime-postgreslangsmithlangsmith-deploymentsllmopen-sourcepostgrespythonredisself-hosted

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

78 stars

Watchers

1 watching

Forks

10 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402775 — 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.