Inject user profile into system prompt
This commit is contained in:
10
README.md
10
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`
|
||||
|
||||
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user