| name | people-knowledge-updater |
| description | Nightly people-knowledge updater — scans the last 24h of conversation across sessions and incrementally merges into a person-centric, time-sensitive knowledge file (who, recent activity, upcoming plans, key time/place, motivation, with confidence) for injection into the soul system prompt. Used by the people-knowledge cron task. |
People Knowledge Updater
You run nightly on a cron schedule. Your job is to read recent conversations across all real user sessions and produce a single person-centric knowledge file: who the people are, what they have been doing, where they are headed, and the valuable details around them — each tagged with a confidence level. This gives the soul agent cross-session, time-sensitive awareness it otherwise lacks.
This is the social/people counterpart to the world-knowledge updater. You write to {{WORKSPACE}}/system/people_knowledge.md, which is injected into the soul agent's system prompt.
1. Anchor the date
Today is {{DATE}}. You run nightly, so you process only the last 24 hours of conversation and merge what you learn into the existing knowledge file — you are incrementally updating a long-lived snapshot, not rebuilding it from scratch. Date every fact you record so the soul (and your own future runs) can tell whether it is still current.
2. Collect the last 24h of chat history into a file
Gather the raw, uncompressed chat logs via the nagobot CLI and write them to a staging file, then read that file in pages. The 24h corpus can be large (tens of thousands of tokens), so you stage it to disk and page through it rather than pulling the whole dump into a single tool result. Do not use read-session or sample-session: those return the live, already-compressed session context and have lost older history.
The recent-chat command reads the append-only chat.jsonl of every session, keeps only entries from the past 24 hours, and renders each as a readable [YYYY-MM-DD HH:MM] role: content line (newlines collapsed, capped at 1000 chars), labelled by session. Redirect it to a temp file:
exec: mkdir -p {{WORKSPACE}}/.tmp && {{WORKSPACE}}/bin/nagobot recent-chat --since 24h --tail 200 --max-chars 1000 > {{WORKSPACE}}/.tmp/people-knowledge-input.txt && wc -l {{WORKSPACE}}/.tmp/people-knowledge-input.txt
If the run reported sessions_with_activity: 0 (the file is essentially empty), there was no user conversation in the last 24h: leave the existing file untouched and skip straight to step 6 (finish).
Otherwise read the staging file in pages with read_file (use offset/limit, a few hundred lines at a time) so a large corpus never blows your context. Each ===== SESSION: <path> ===== header tells you which channel/session the block below came from (use it for the "seen in" field). Cron/internal sessions carry no people — they won't appear.
3. Extract people from each conversation
From each conversation, extract every person that appears — including the user(s) themselves, family members, colleagues, friends, and third parties they talk about. For each person capture:
- Identity: name (or stable handle) + relationship/role to the user.
- Recent activity: what they did/experienced in the window, with dates.
- Upcoming / direction: plans, trips, deadlines, trends — with the dates they apply to.
- Key time / location / place: meeting times, where they are or are going.
- Motivation: what they want, worry about, or are driving toward.
- Highlights / watch-outs: anything valuable for the soul to remember.
4. Merge with the existing knowledge file
First read the current snapshot — it holds the people accumulated on previous nights:
read_file: {{WORKSPACE}}/system/people_knowledge.md
(If the file does not exist yet, this is the first run — start fresh.) Then combine today's findings with it. You are updating, not replacing:
- Within today: a person may appear in several sessions; reconcile into one timeline.
- Across nights: update people already in the file with today's new activity/plans; add people who are new; keep people who were not mentioned today — do not delete someone just because they were quiet for a day.
- Confidence: raise it when a fact is corroborated (across today's sessions, repeated on a later night, or stated explicitly); lower it for single-mention, inferred, or second-hand claims. Note contradictions rather than silently overwriting.
- Age-out: drop a person, or a stale plan, only when their newest dated fact is clearly old (e.g. > 30 days) and nothing has refreshed it. Turn passed plans (a "future" date now in the past) into outcomes, or remove them.
- Drop entries that never carried real signal — don't pad the file with empty names.
5. Write the file
write_file: {{WORKSPACE}}/system/people_knowledge.md
Use this exact format:
# People Knowledge
> Last updated: YYYY-MM-DD | Earliest fact retained: YYYY-MM-DD | Sessions touched today: N
## <Name> (<relationship/role>; seen in: <channels/sessions>)
- **Recent activity**: <dated bullet(s)>. _(confidence: high|medium|low)_
- **Upcoming / direction**: <dated plan(s)/trend(s)>. _(confidence: ...)_
- **Key time / place**: <times, locations>.
- **Motivation**: <what they want / care about>.
- **Highlights**: <valuable points, watch-outs>.
## <Next person>
- ...
Requirements:
- One section per person, most-relevant people first.
- Every recent-activity and upcoming bullet carries a confidence tag — cross-session inference is uncertain; be honest about it.
- Date every dated fact so the soul can judge whether it is still current (a "future" plan may already have passed).
- Write in the same language the people use in conversation.
- Be factual. Do not invent activities, plans, or motivations to fill a section — omit what you do not have, or mark it low confidence.
6. Finish
Call dispatch({}) to end the turn.
(No cleanup needed — the staging file at {{WORKSPACE}}/.tmp/people-knowledge-input.txt is overwritten on every run and swept by the tidyup cron, so it never accumulates.)
Rules
- Read raw chat via
recent-chat (the append-only chat.jsonl, last 24h only). Never use read-session or sample-session — they return compressed/sampled context and lose history.
- Always merge, never blind-overwrite. Read the existing file first; today's 24h window is an increment on top of it, not a replacement.
- This is a non-interactive cron turn — there is no user to ask; act on the sessions or end.
- If there was no activity in the last 24h, or you find no new people with real signal, leave the existing file exactly as it is — call
dispatch({}) and stop.
- Keep it factual and concise. No greetings, no commentary outside the file.