Memory / Facts Tool
Store and retrieve long-term facts that persist across sessions and are injected into the system prompt.
Tool Name
remember_fact
Parameters
| Key | Type | Default | Description |
|---|---|---|---|
category | string | โ | Grouping category (e.g., "user", "preference", "project") |
key | string | โ | Unique identifier within the category |
value | string | โ | The fact content to store |
Storage
Facts are upserted into the facts table in SQLite. The (category, key) pair is unique โ storing a fact with the same category and key overwrites the previous value.
System Prompt Injection
Up to state.max_facts (default 100) facts are injected into the system prompt under a ## Known Facts section, grouped by category and ordered by most recently updated. This means the agent always has access to its stored knowledge.
system prompt injection
## Known Facts
### user
- name: David
- timezone: US/Pacific
### project
- language: Rust
- repo: /home/david/projects/myappFacts Table Schema
| Key | Type | Default | Description |
|---|---|---|---|
id | integer | auto | Auto-incrementing primary key |
category | string | โ | Grouping category |
key | string | โ | Fact key (unique per category) |
value | string | โ | Fact content |
source | string | "" | Who stored it: "agent" or "user" |
created_at | timestamp | now | When the fact was created |
updated_at | timestamp | now | When the fact was last updated |