Skip to content
lucasaarchPublic

About

Self-hosted agent gateway with per-profile identity, persistent memory and shared context across sessions and channels.

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

 

History

889 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Jian — self-hosted agent gateway.

Jian

Jian is a self-hosted gateway that gives AI agents a persistent identity. A profile keeps its own instructions, model, memory and tools, and every session and channel that belongs to it works from that same context — so a conversation started on WhatsApp continues in the web panel without repeating anything.

It runs on your own server. Provider keys stay in an encrypted vault on your machine, not in a vendor's account.

Jian takes its name from the one-winged bird. Its new mark makes that wing a single, forward-moving shape: an agent with its own identity, connected to the person who owns it.

What it does

  • Profiles as identity. Versioned role, tone, goals and boundaries, with their own context budget and skills. Models and MCP servers are configured once and shared by every profile.
  • Memory that survives the session. Explicit memories, paginated history search, and messages passed between parallel sessions.
  • A context budget you control. Per-step and per-run limits, relevant memories only, tool schemas loaded on demand instead of flooding the prompt.
  • Channels. WhatsApp, Telegram and an API server, one of each. A stranger's first message becomes a contact request the owner approves; each approved conversation gets its own session, so no channel inherits the owner's privileges.
  • A vault, not a config file. Provider, MCP and channel secrets are typed where the thing is configured and stored encrypted with AES-256-GCM, never read back.
  • A typed contract. OpenAPI 3.1 generated from the schemas the server validates against, with a TypeScript SDK generated from the same document.
  • A web panel for profiles, usage, memories, skills, MCP servers and channels.

Memories, conversations and identity are per agent; files are shared by every agent of an installation. One installation serves one trusted owner; it is not a multi-tenant SaaS.

Clients

The web panel ships inside the gateway and talks to it through the same contract any other client would use.

Repository

apps/gateway/       HTTP API, runtime and workers
apps/web/    Web panel: its own Next.js server, in front of the gateway
packages/contracts/ Zod schemas — the source of the HTTP contract
packages/sdk/       Generated TypeScript client
docs/               Architecture, security, channels, panel

Hosting it

Docker, and a clone of this repository. make up starts the published panel and gateway images with their own PostgreSQL; the panel answers on 127.0.0.1:4310.

make setup
make up

The same images run as plain containers against your own PostgreSQL, or in Kubernetes. What changed in each version, and what to do when updating to it, is in docs/releases.

Developing it

Node.js 24+, pnpm 11.9.0 and Docker for the local database. make alone lists the targets.

make install
make setup
make db-up
make dev

make setup writes a .env with local credentials and an encryption key, and never prints a secret. make dev serves the API on 127.0.0.1:4310 and the panel with hot reload on http://localhost:3000/.

To test the packaged application in production mode from VS Code, open this repository in a Dev Container using .devcontainer/devcontainer.json. It builds the gateway and web images, starts them with an isolated PostgreSQL database, and serves the panel on port 4310. The Dev Container attaches to a separate Node workspace; the production gateway does not mount the source tree or its .env secrets. Use jian-devcontainer-test-token-only to sign in. The Compose file contains fixed synthetic credentials strictly for local tests: do not use them with real data or outside this Dev Container. Rebuild the container after changing source so the production image includes those changes. Its database and /home/node workspace use separate volumes from make up.

Status

Early. The contract, the vault and the runtime are in place; the native client currently signs in and lists profiles. Interfaces may still change.

Apache 2.0 — see LICENSE and CONTRIBUTING.md.

About

Self-hosted agent gateway with per-profile identity, persistent memory and shared context across sessions and channels.

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages