From 3459ffd90d4a512379d200f6466acacbe962675a Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Fri, 15 May 2026 15:09:48 -0400 Subject: [PATCH] Inject user profile into system prompt --- README.md | 10 ++++++++++ src/index.ts | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index ec8ad73..d4481ac 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,10 @@ You are a helpful agent. Use tools when they are useful, and answer clearly. Override it with the `SYSTEM_PROMPT` environment variable. Extensions can also append fragments to the final system prompt with `addSystemPrompt(...)`. +`USER.md` is also loaded into the system prompt on every run so stable user +preferences are available immediately. `MEMORY.md` and daily logs remain +tool-driven rather than being injected automatically. + ## Durable memory The harness keeps long-lived memory in simple markdown files: @@ -138,6 +142,12 @@ The harness keeps long-lived memory in simple markdown files: YYYY-MM-DD.md ``` +The memory model is intentionally split: + +- `USER.md` is always injected into the system prompt +- `MEMORY.md` is available through tools when broader durable context is useful +- `daily/` stays tool-driven for episodic notes + The model can choose to use: - `memory_read` — read `MEMORY.md` or `USER.md` diff --git a/src/index.ts b/src/index.ts index 3ee74d9..b63b121 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,6 +27,13 @@ const promptFragments = [ const sessionStore = new SessionStore(resolve(cwd, ".harness", "session.json")); const memoryStore = new MemoryStore(resolve(cwd, ".harness", "memory")); await memoryStore.ensure(); +const userProfile = await memoryStore.read("user"); +promptFragments.push( + [ + "Always-on user profile from USER.md:", + userProfile.trim() || "# User" + ].join("\n") +); promptFragments.push( [ "You have access to durable memory tools.",