Phone capture

Code check: the repo now has an Android app in android/ that does the phone side. The old doc said no phone code ships.

A phone app listens during the day, turns speech into text on the phone, and uploads the text. The server keeps it for a short time, lets dreaming pick out what matters, and asks the user to confirm each pick before it becomes memory. This file is the contract for anyone building that phone app (the repo ships no phone code; see Contributing).

Rules

Speaker

Each chunk has speaker:

ValueMeaningTrust the server gives it
userThe phone matched the owner's own voice, enrolled by the owner on the phone. The voiceprint stays on the phone.user
otherA voice that is not the owner's.outside
unknownThe phone could not tell.outside

The client never sends trust. The core sets it.

Tokens

agent-core token create device pixel (or POST /v1/tokens {"scope":"device","label":"pixel"}, owner only). A device token can only:

Everything else returns 403. The phone app itself, which manages everything, uses a client or owner token. If a phone is lost: agent-core token revoke <id>.

Reaching the server from a phone

The server listens on 127.0.0.1 only. For a phone, keep it that way and put a private tunnel in front (Tailscale or WireGuard):

AGENT_ALLOWED_HOSTS=my-mac.tailnet-name.ts.net  # Host names the server answers to
AGENT_BIND=127.0.0.1                            # keep the default if the tunnel runs on this computer

AGENT_BIND=0.0.0.0 exists for tunnels that cannot reach loopback, and prints a warning: plain HTTP shows the token to the network, so never use it on a shared network without a tunnel. The Host header must match 127.0.0.1: or an entry in AGENT_ALLOWED_HOSTS (with or without the port).

Routes

POST   /v1/ambient/chunks          upload text chunks (device, client, owner)
GET    /v1/ambient/chunks          list what is stored (?status=new|done, paged)
DELETE /v1/ambient/chunks          delete: ?id=  |  ?last_minutes=  |  ?day=YYYY-MM-DD  |  ?all=true
GET    /v1/ambient/status          listening or not, counts, pending picks, seconds since last upload
GET    /v1/ambient/settings        read the settings
PATCH  /v1/ambient/settings        change them
POST   /v1/ambient/pause           {"minutes": 30}  (1 to 1440)
POST   /v1/ambient/resume
POST   /v1/ambient/process         look through the waiting text now (starts a dreaming run)
GET    /v1/ambient/picks           newest first (?status=pending|kept|dismissed, paged)
POST   /v1/ambient/picks/{id}      {"action":"keep"|"dismiss"|"edit", "text"?, "folder"?, "who"?, "due"?}

Upload

POST /v1/ambient/chunks
{ "chunks": [
  { "started": 1794600000, "ended": 1794600006, "speaker": "user",
    "text": "Hey mom, when is my appointment?", "place": "kitchen", "stt_confidence": 0.93 },
  { "started": 1794600008, "speaker": "other", "label": "Mom",
    "text": "Tuesday at three." } ] }

Settings

KeyDefaultMeaning
enabledtrueOff refuses uploads
retention_days141 to 365
listen_places[]The only place names where text is kept
process_after_chunks20Start a processing run at this many waiting chunks
process_every_mins30...if the last run is at least this old

paused_until is read-only here; use /pause and /resume.

Processing

The core timer starts a dreaming run when enough chunks wait (or when notes wait, as before). Dreaming has three more tools:

The model is told to skip small talk, TV and noise, to pick at most 15 things a run, and never to guess a person from a voice. See prompts/dreaming.md.

Token cost is bounded by the dreaming limits (max_tokens_per_dreaming, max_tokens_per_day).

Review on the phone

GET /v1/ambient/picks?status=pending is the daily "what I picked up" list. Each pick has text, kind, who, due, folder, confidence, trust and the chunks it came from (read them with the chunk ids if the user wants the source).

keep creates a memory entry in the pick's folder at confidence 0.8 or more; dismiss drops it; edit changes fields and leaves it pending. If the chunks behind a pending pick are deleted, the pick is dismissed with them.

Not built yet

The screen to API table is in Talking to the server.