A self-hosted AI chat and agent workspace for local LLM servers such as LM Studio and Ollama, with MCP (Model Context Protocol), web search, knowledge, code execution, and browser/GUI preview support.
- Node.js (v24 recommended)
- PostgreSQL (v18 recommended)
- Docker
Recommended first-time setup:
npm run setupThis runs npm ci for the workspaces and then installs the OS packages required by Playwright Chromium through npm -w chat-engine run setup:browser-deps. Use this if you plan to use web search or browser-driven agent features.
If you only need the core chat UI and already have the Chromium runtime dependencies you need:
npm ciCreate server/.env from the sample and adjust it for your environment:
cp server/.env.sample server/.envExample:
NODE_ENV=production
DATABASE_URL=postgresql://user:password@localhost:5432/tenjo
DATABASE_SCHEMA=tenjo
SESSION_SECRET=your-secret-key-here
LISTEN_HOST=127.0.0.1
LISTEN_PORT=3000
ENCRYPTION_KEY=your-encryption-key-here
BASE_URL=https://chat.example.com
| Variable | Description |
|---|---|
NODE_ENV |
development, production, or test |
DATABASE_URL |
PostgreSQL connection string |
DATABASE_SCHEMA |
PostgreSQL schema name (defaults to public if omitted) |
SESSION_SECRET |
Secret used for session encryption |
LISTEN_HOST |
Host address to bind to |
LISTEN_PORT |
Port number to listen on |
DATA_DIR |
Data directory path (default: files/ under the server working directory) |
SINGLE_USER_MODE |
Set to true to run in single-user mode |
ENCRYPTION_KEY |
Encryption key for credentials (API keys, OAuth tokens, etc.) stored in the database |
BASE_URL |
Public base URL of the application |
npm run build
npm startnpm run devNote: The environment variable
LISTEN_PORTmust be3000during development. The Vite dev server proxies API requests tolocalhost:3000, so changing the port will break the proxy.
Docker is required because the agent runs in a sandbox container.
On Linux, the user running the Tenjo server process must have permission to operate Docker. For example, you may need to add that user to the docker group.
Tenjo creates and manages the following Docker resources:
- Container:
tenjo-sandbox - Image:
tenjo-agent-sandbox:* - Volume:
tenjo-sandbox-data
How do I add new users? The first user to register automatically becomes an admin. After that, registration requires an invitation code. Admins can generate and manage invitation codes from the settings page. Codes are single-use and determine the new user's role (admin or standard).
Images in prompts are not working. The connected model must support vision. Use a vision-capable model if you want to include images in prompts.
MCP tools are not working. The connected model must support function calling. MCP tool calling will not work with models that do not support it. Even with supported models, tool calls may not work well depending on the model's capability.
MIT © netalkGB