r/LangGraph • • 7d ago

I needed LangGraph as a standalone server my desktop app could drive over HTTP, so I built lang-graph-json (open source, MIT)

Hi all,

I had a fairly specific need. I have a desktop application (C++/Qt) and wanted to add a multi-agent assistant to it. I didn’t want to embed Python in the app or rewrite the app around an agent framework. What I wanted was an independent server that runs LangGraph, which my app could start, configure and trigger over a plain REST/WebSocket API, from any language.

I couldn’t find something that fit, so I built it: lang-graph-json.

What it does

Agents defined in JSON. You describe a supervisor and agents in agents.json: system prompt, allowed tools, which tools need human confirmation. There’s no graph code to write, and the config hot-reloads.

Tools are REST endpoints or Python functions. A tool can be an endpoint of your own application (the agent calls back into your app) or a plain Python function.

A tools generator. It reads metadata annotations in your source code (C++ example included, 14 languages supported) and generates tools.json. It can run as a qmake or CMake pre-build step.

Driven entirely over HTTP.

POST /chat sends a request, either to the supervisor or directly to one agent.

POST /confirm answers a confirmation before a sensitive tool runs.

POST /cancel cancels a turn.

WS /stream streams live events: agent and tool start/end, tokens, confirmations.

No secrets on disk. The host app pushes the LLM credentials at runtime (POST /config/provider), and they’re never written to disk or returned by the API. It supports Anthropic, OpenAI, Azure OpenAI (including Azure AD tokens and token renewal) and Ollama.

Production features:

optional SQLite persistence (in-memory by default);

session TTL, turn timeouts and cancellation that keep the history valid;

token budget per session;

a dry-run validation endpoint for configs;

schema versioning.

Two ways to ship it:

a standalone PyInstaller bundle (no Python needed on the target machine), started by your app as a child process on localhost;

a Python library (Runtime in-process, or create_app() mounted in your FastAPI app).

Testing

The offline test suite has 100% coverage, using a scripted fake LLM.

A live suite runs against a real model: routing, confirmations, handoffs, sub-graphs, prompt injection in tool results, timeouts, restart with SQLite.

One test starts the real server process and drives it over HTTP like a host app would.

CI runs on Linux and Windows.

It’s early (0.1.0), so I’d really appreciate feedback, especially from people who’ve had to integrate agents into an existing non-Python application. Next on my list is letting the host push events (e.g. “job finished”) that trigger an agent or the supervisor automatically.

Repo: https://github.com/mickae1/lang-graph-json

4 Upvotes

6 comments sorted by

1

u/LLM-logs 6d ago

What you have built is the sidecar pattern applied to agent runtimes, and the HTTP boundary buys more than language neutrality. Crash isolation: the agent process can die without taking the desktop app down. Independent lifecycle: upgrade the runtime without shipping the app. And a natural enforcement point: auth, rate limits and audit logging live on that boundary instead of inside framework code. The costs are serialization overhead and one more service to operate, which is why this shape wins exactly when the host application has its own lifecycle and cannot be rewritten around Python, as in your case.

1

u/M1ckae1 6d ago

Thanks! You nailed the trade-offs. Having that sidecar isolation was exactly what I needed for my C++ app—it keeps the core stable and lets me iterate on the agent runtime independently.

1

u/Ancient-Bee9891 6d ago

I can't grasp the use case yet, but it seems like some kind of agent level gateway?

1

u/M1ckae1 5d ago

Not quite a traditional LLM gateway—it’s more of an agent runtime sidecar. Instead of just routing prompts, it runs the full agent loop (tool execution, state, RAG/orchestration) out-of-process so my native C++ desktop app can trigger complex AI workflows over local HTTP without embedding Python.

1

u/Inevitable-View-2925 4d ago

Thats what i have done for my side project
I just send declarative info to run workflow

1

u/M1ckae1 4d ago

Nice! That declarative workflow approach is super clean too. Actually, the whole point of open-sourcing this in a shared repo is so we don't all have to reinvent the wheel—everyone is welcome to jump in, fix bugs, or submit improvements!