Guidance for AI coding agents working on Sentient. Humans are welcome to read it too; the contribution workflow is in CONTRIBUTING.md.
Sentient is a desktop personal assistant: an Electron + React app that starts a local Python engine. Its core is long-running tasks, memory, proactivity, integrations and voice, plus devices (phones, smart glasses), messaging channels, browser control, code execution and self-improving skills.
Area guides with deeper conventions: sentient/AGENTS.md for the engine and
desktop/AGENTS.md for the app.
- Read docs/ARCHITECTURE.md for the shape of the system.
- Anything that crosses the window ↔ engine boundary is defined in docs/API.md. Change the contract in the same change as the code.
- The reasons behind the big rules are in docs/adr/. If your change reverses one of them, add a new ADR instead of quietly working around it.
| Path | What it is |
|---|---|
sentient/ |
The engine (python -m sentient serve). One package per area: agent, llm, store, tools, gateway, tasks, memory, proactivity, evolution, skills, integrations, channels, nodes, browser, sandbox, terminal, voice, folders |
desktop/ |
Electron main and preload (desktop/electron) and the React renderer (desktop/src) |
tests/ |
pytest, asyncio_mode=auto. One folder per area; core tests are tests/test_*.py |
docs/ |
Architecture, API contract, ADRs, devices protocol, guides |
firmware/ |
Reference firmware for ESP32-S3 smart glasses (never compiled in CI) |
packaging/ |
Freezing the engine for installers |
Sentient v2 (the old cloud web app) is on the v2 branch only. Do not port new code from it.
- No accounts. No login, plans or feature gating. The window ↔ engine token is invisible to users.
- One process, one SQLite file. No Redis, Celery, Postgres or required Docker.
- No shared keys. Never add a
.envrequirement. Secrets go throughsentient.secrets(the OS keychain) and never into config files, logs, tests or fixtures. - Models through roles. Use
app.llmwith a role (primary,fast,planner,executor,embedding,vision,voice) and an optional explicit model. Never hard-code a model outsideconfig/schema.py. - Every tool declares a
Risk. Sending, deleting, buying or running code issendorexecand asks the user. Userisk_fnwhen risk depends on the arguments; markinternal=Truewhen the effect stays inside Sentient. - Safety is deterministic. A model may raise a risk, never lower it.
- Config is self-describing. New keys go in the right section of
sentient/config/schema.pywith adescription; the Settings screen is generated from it. - Small local models are first-class. Short, structured prompts; tolerant JSON parsing; never assume a frontier model.
- Plain language in the UI. Users are not engineers: "device", not "node"; no jargon; no em-dashes.
- Find the area guide and the tests for what you are changing. Read the existing code before adding new code.
- Make the smallest change that solves the problem. Match the surrounding style.
- Add or update tests. Tests never touch the network or a real model: use the scripted
FakeProviderfromtests/conftest.pyandrespxfor HTTP. - Run the checks for what you touched, then the full suite before you open a pull request.
- Update
docs/API.mdfor contract changes, an ADR for decision changes, andCHANGELOG.mdfor user-visible changes.
.venv/Scripts/python.exe -m pytest -q # engine tests (macOS/Linux: .venv/bin/python)
.venv/Scripts/python.exe -m pytest -q tests/tasks # one area
.venv/Scripts/ruff.exe check sentient tests packaging # lint
.venv/Scripts/python.exe -m sentient serve # engine only
cd desktop && npm run dev # the app (starts the engine)
cd desktop && npm run typecheck && npm run build # desktop checks
cd desktop && npm run package # installer for this OSCI runs the same checks on every pull request, on Linux and Windows, with no secrets.