For AI Agents
This page is for AI agents that install, configure or operate SmartChats on behalf of a user. Everything here runs without prompts and reports in machine-readable form. Plain-markdown copies of every docs page are at https://smartchats.ai/docs/<page>.md, indexed in /llms.txt and combined in /llms-full.txt. If you are working on the SmartChats code itself, read AGENTS.md in the repository instead.
What you are installing
A local stack of three processes, started and stopped together by the smartchats CLI:
| Process | Port | Role |
|---|---|---|
| SurrealDB | 127.0.0.1:8000 | The user’s data (logs, metrics, todos, knowledge graph, sessions) |
| SeaweedFS | 127.0.0.1:8333 | Media storage (photos, videos, files), reached only through the server. Optional |
| smartchats-server | 0.0.0.0:3000 | The web app at /app and the API at /local-api/* |
The user talks to the agent in a browser at http://localhost:3000/app. The model provider keys are the user’s own.
Install without prompts
macOS (Apple Silicon) and Linux (x64, arm64):
curl -fsSL https://smartchats.ai/install | bash -s -- --non-interactiveThis installs to ~/.smartchats and links smartchats into /usr/local/bin when it is writable (otherwise it adds ~/.smartchats/bin to the shell rc). Add --no-path to touch neither, then call ~/.smartchats/bin/smartchats directly. Add --version v0.4.0 to pin a release. Intel Macs have no binary release: use npm install -g smartchats-ai (Node 24+).
Docker, anywhere:
docker run -d --name smartchats -p 3000:3000 \
-v ~/.smartchats/.env:/root/.smartchats/.env:ro \
-v ~/.smartchats/data:/data \
sheunaluko/smartchats:latestConfigure keys
Keys live in ~/.smartchats/.env (mode 0600). Write them with the user’s consent and never echo them back. With the keys in the environment, setup --no-prompt saves them and starts the stack:
TOGETHER_API_KEY=... AZURE_SPEECH_KEY=... AZURE_SPEECH_REGION=eastus \
smartchats setup --no-promptOr write the file and start:
umask 077
cat >> ~/.smartchats/.env <<'EOF'
TOGETHER_API_KEY=...
AZURE_SPEECH_KEY=...
AZURE_SPEECH_REGION=eastus
EOF
smartchats start --no-prompt| Key | Needed for | Without it |
|---|---|---|
TOGETHER_API_KEY | The default chat model (DeepSeek V4.1 Flash) and the voice turn judge | Another provider’s model is used if one has a key. Voice turns end on silence with no judge |
AZURE_SPEECH_KEY + AZURE_SPEECH_REGION | The default voice | An OpenAI voice is used if OpenAI has a key, otherwise no speech |
OPENAI_API_KEY | GPT models, OpenAI voices, embeddings (semantic search over the user’s logs) | Semantic search is off |
ANTHROPIC_API_KEY, GOOGLE_API_KEY, XAI_API_KEY | Claude, Gemini, Grok models | Those models aren’t offered |
SERPER_API_KEY | The agent’s web search tool | Web search is a no-op |
At least one chat provider key (Together, OpenAI, Anthropic, Google or xAI) is needed for the agent to reply. Restart after changing keys: smartchats restart. Every variable is listed in Providers & API Keys.
Verify
Each command exits 0 on success:
smartchats status --json
# {"up": true, "procs": [{"name": "surreal", "pid": 1234, "port": 8000, "pidAlive": true, "portHealthy": true, ...}, {"name": "seaweedfs", ...}, {"name": "server", ...}]}
smartchats doctor --json
# {"exit": 0, "results": [{"name": "LLM provider keys", "status": "pass", "severity": "warn", "note": "found: Together, Azure ..."}, ...], "port": 3000}
curl -s http://localhost:3000/local-api/health
# {"ok": true, "checks": {"data": {"ok": true, ...}, "providers": {"ok": true, ...}}}
curl -s http://localhost:3000/local-api/keys/providers
# {"llm": [{"provider": "together", "available": true, ...}, ...], "tts": [{"provider": "azure", "available": true, ...}, ...]}From a clone of the repository, node scripts/smoke-stack.mjs http://localhost:3000 exercises the stack the way a user would: the app loads, a database query, an LLM reply, and a media upload and download. It prints one line per check and exits non-zero if any fails.
From the machine running SmartChats these need no credentials. From anywhere else /local-api answers 401 pairing_required: use Authorization: Bearer $SMARTCHATS_API_KEY (set it on the server), or pair with a code from smartchats pair. In Docker, run commands inside the container: docker exec smartchats smartchats status.
Operate
| Task | Command |
|---|---|
| Start / stop / restart | smartchats start --no-prompt, smartchats stop, smartchats restart |
| Pair a phone or another computer | smartchats pair --json → {"code", "expires_at"}; list and revoke with smartchats devices [--json], smartchats devices revoke <id> |
| Logs | smartchats logs --proc server -n 100 (or surreal, seaweedfs), files in ~/.smartchats/logs/ |
| Run in the foreground (systemd, containers) | smartchats start --foreground --no-prompt |
| Other ports | smartchats start --port 3100 --surreal-port 8100 (media: SMARTCHATS_S3_PORT=8433) |
| Back up the user’s data | smartchats data export ~/smartchats-backup.json |
| Restore | smartchats data import ~/smartchats-backup.json --dry-run, then without --dry-run |
| Upgrade | smartchats upgrade -y |
Process IDs and ports are in ~/.smartchats/run/pids.json. The database is in ~/.smartchats/data/surreal.db and media in ~/.smartchats/data/seaweedfs/.
When something is wrong
| Symptom | Likely cause | Fix |
|---|---|---|
status shows server with portHealthy: false | The server failed to start | smartchats logs --proc server -n 50. Often a port in use: start with --port |
Health providers.ok is false, the agent never replies | No chat provider key | Add one to ~/.smartchats/.env, then smartchats restart |
| Replies work but there’s no voice | No Azure key and no OpenAI key | Add AZURE_SPEECH_KEY + AZURE_SPEECH_REGION (or OPENAI_API_KEY) |
Uploads fail in the app, createUpload answers 501 | Media storage is off | smartchats doctor shows why (no weed binary, or SMARTCHATS_STORAGE=off) |
Every /local-api call returns 401 pairing_required | The caller is not the machine running SmartChats (another device, or the host of a Docker container) | Pair (smartchats pair, then enter the code in the app), or send Authorization: Bearer $SMARTCHATS_API_KEY |
| The app shows Pair this device | Same | Give the user the code from smartchats pair (Docker: docker exec smartchats smartchats pair) |
smartchats: command not found after install | PATH not updated in this shell | Use ~/.smartchats/bin/smartchats, or open a new shell |
Give the user’s agent their data
SmartChats exposes the user’s data to other agents (Claude Desktop, Claude Code, Cursor and others) through an MCP server with tools to read and write logs, metrics, todos and the knowledge graph. See MCP Server.
Ground rules
- The data is the user’s: logs, journal entries and transcripts are personal. Don’t copy them anywhere the user didn’t ask for.
- Keys stay in
~/.smartchats/.envwith mode 0600. Don’t print them, commit them, or pass them on the command line where other users can see them. - The server listens on all interfaces. Other devices must pair, but don’t expose port 3000 to the internet without TLS and a reverse proxy that forwards
HostandX-Forwarded-For(Security). Pair a device only when the user asks.