Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ with path-stored fields: the pinned mdbase-ts and Rust CLI reject the starter
until `sources.json` moves to engines that implement them. See
[`mdbase.daily-note` 1.0.0](contracts/mdbase.daily-note/1.0.0.md).

The `mdbase.memory` pack defines memories that AI assistants share: one record
per thing to remember, indexed by a kebab-case `name`, a one-line `description`
and a `kind` (`user`, `feedback`, `project` or `reference`), with the memory
itself in the Markdown body. Assistants recall by listing the index and reading
only the bodies that matter, and update a memory on the same subject rather than
adding a duplicate. The **Memory** starter stores the name in the file name,
`Memories/<name>.md`, with `collection.path.fields`, and puts the rules
assistants need into its description and field descriptions, which they read
before any body. See [`mdbase.memory` 1.0.0](contracts/mdbase.memory/1.0.0.md).

The `tasknotes.task` pack is the canonical application-provisioned TaskNotes
contract bundle. TaskNotes clients embed the published provision byte-for-byte
and pin its catalog digest so independently deployed clients cannot drift onto
Expand Down
73 changes: 73 additions & 0 deletions contracts/mdbase.memory/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
kind: mdbase.contract
contract_type: record
id: mdbase.memory
version: 1.0.0
name: Memory
description: One thing an AI assistant should remember about the person it works for, shared by every assistant that reaches the collection.
record_schema:
dialect: json-schema-2020-12
ref: ../../schemas/mdbase.memory/1.0.0.schema.json
---

# Memory

A record exposed through `mdbase.memory` holds one thing an assistant should
remember about the person it works for: who they are, how they want
assistants to work, what they are working on, or where to find something.
Several assistants, such as Claude, ChatGPT and Codex, read and write the same
memories, so what one learns the others can use.

The Markdown body is the memory itself. The contract's fields are the index an
assistant reads before deciding which bodies to open.

## Fields

- `name` identifies the memory: a short kebab-case slug such as
`prefers-metric-units`. It is the memory's identity, never its path or file
name. An implementing type may store it in the path.
- `description` is one line, specific enough that an assistant can tell from
it alone whether the memory matters to the conversation at hand.
- `kind` is one of:
- `user`: who the person is, such as their role, expertise or circumstances;
- `feedback`: how they want assistants to work, including corrections and
approaches they confirmed;
- `project`: ongoing work, goals, decisions and dates not recorded elsewhere;
- `reference`: where to find things, such as documents, dashboards or
other collections.
- `by`, when present, names the assistant that saved or last changed the
memory, such as `Claude`. It is a display hint, not an identity or
authority.

## One memory per name

A collection should hold at most one memory per `name` across all types that
implement this contract. An application that finds several records with the
same name MUST report the duplicate and MUST NOT silently merge them or pick
one to change. Implementing types may declare `collection.unique` on their
name field so the engine reports duplicates within the type.

## Recalling

An assistant recalls by listing memories with only `name`, `description` and
`kind`, then reading the bodies of the few that matter to the conversation.
It does not read every body up front.

## Saving

Before saving, an assistant looks for an existing memory on the same subject
and updates it rather than adding another. One memory holds one subject. A
`feedback` or `project` body states the fact, then a line beginning `Why:` and
a line beginning `How to apply:`. Dates are written as absolute dates, never
as "yesterday" or "next week". Memories link to related memories as
`[[name]]`.

A memory never holds passwords, keys, tokens or other secrets.

## Forgetting

Forgetting a memory deletes its record. Applications that show memories to
the person should let them read, correct and forget each one.

This artifact is passive. Implementing it grants no authority to read, create,
or modify any record.
73 changes: 73 additions & 0 deletions dist/artifacts/contracts/mdbase.memory/1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
kind: mdbase.contract
contract_type: record
id: mdbase.memory
version: 1.0.0
name: Memory
description: One thing an AI assistant should remember about the person it works for, shared by every assistant that reaches the collection.
record_schema:
dialect: json-schema-2020-12
ref: ../../schemas/mdbase.memory/1.0.0.schema.json
---

# Memory

A record exposed through `mdbase.memory` holds one thing an assistant should
remember about the person it works for: who they are, how they want
assistants to work, what they are working on, or where to find something.
Several assistants, such as Claude, ChatGPT and Codex, read and write the same
memories, so what one learns the others can use.

The Markdown body is the memory itself. The contract's fields are the index an
assistant reads before deciding which bodies to open.

## Fields

- `name` identifies the memory: a short kebab-case slug such as
`prefers-metric-units`. It is the memory's identity, never its path or file
name. An implementing type may store it in the path.
- `description` is one line, specific enough that an assistant can tell from
it alone whether the memory matters to the conversation at hand.
- `kind` is one of:
- `user`: who the person is, such as their role, expertise or circumstances;
- `feedback`: how they want assistants to work, including corrections and
approaches they confirmed;
- `project`: ongoing work, goals, decisions and dates not recorded elsewhere;
- `reference`: where to find things, such as documents, dashboards or
other collections.
- `by`, when present, names the assistant that saved or last changed the
memory, such as `Claude`. It is a display hint, not an identity or
authority.

## One memory per name

A collection should hold at most one memory per `name` across all types that
implement this contract. An application that finds several records with the
same name MUST report the duplicate and MUST NOT silently merge them or pick
one to change. Implementing types may declare `collection.unique` on their
name field so the engine reports duplicates within the type.

## Recalling

An assistant recalls by listing memories with only `name`, `description` and
`kind`, then reading the bodies of the few that matter to the conversation.
It does not read every body up front.

## Saving

Before saving, an assistant looks for an existing memory on the same subject
and updates it rather than adding another. One memory holds one subject. A
`feedback` or `project` body states the fact, then a line beginning `Why:` and
a line beginning `How to apply:`. Dates are written as absolute dates, never
as "yesterday" or "next week". Memories link to related memories as
`[[name]]`.

A memory never holds passwords, keys, tokens or other secrets.

## Forgetting

Forgetting a memory deletes its record. Applications that show memories to
the person should let them read, correct and forget each one.

This artifact is passive. Implementing it grants no authority to read, create,
or modify any record.
42 changes: 42 additions & 0 deletions dist/artifacts/schemas/mdbase.memory/1.0.0.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://mdbase.dev/contracts/schemas/mdbase.memory/1.0.0.schema.json",
"title": "Memory",
"description": "One thing an AI assistant should remember about the person it works for. The Markdown body is the memory itself.",
"type": "object",
"required": [
"name",
"description",
"kind"
],
"properties": {
"name": {
"type": "string",
"pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
"maxLength": 80,
"description": "Short kebab-case identifier for the memory, unique in the collection."
},
"description": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "One line saying what the memory is about, specific enough to decide from it alone whether to read it."
},
"kind": {
"enum": [
"user",
"feedback",
"project",
"reference"
],
"description": "user: who the person is. feedback: how they want assistants to work. project: ongoing work, goals and dates. reference: where to find things."
},
"by": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"description": "The assistant that saved or last changed the memory, such as Claude, ChatGPT or Codex."
}
},
"additionalProperties": false
}
90 changes: 90 additions & 0 deletions dist/artifacts/types/memory/1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
kind: mdbase.type
name: memory
version: 1
description: 'Something an AI assistant should remember about the person it works for, one per note in Memories/. To recall, list only name, description and kind, then read the few that matter. Update an existing memory rather than adding a duplicate. Never store passwords, keys or other secrets.'
match:
path_glob: 'Memories/*.md'
schema:
dialect: json-schema-2020-12
value:
$schema: https://json-schema.org/draft/2020-12/schema
title: Memory
description: One thing to remember, written in the note's body. The name is stored in the file name.
type: object
required:
- name
- description
- kind
properties:
name:
type: string
pattern: '^[a-z0-9]+(-[a-z0-9]+)*$'
maxLength: 80
description: Short kebab-case identifier, such as prefers-metric-units. It is the file name (Memories/prefers-metric-units.md), so changing it renames the note.
description:
type: string
minLength: 1
maxLength: 200
description: One line saying what this memory is about, specific enough to decide from it alone whether to read the note.
kind:
enum:
- user
- feedback
- project
- reference
description: 'user: who the person is. feedback: how they want assistants to work, including corrections and confirmed approaches. project: ongoing work, goals and dates not recorded elsewhere. reference: where to find things. For feedback and project memories, the body states the fact, then a "Why:" line and a "How to apply:" line. Write dates as absolute dates.'
by:
type: string
minLength: 1
maxLength: 80
description: The assistant that saved or last changed this memory, such as Claude, ChatGPT or Codex.
additionalProperties: true
collection:
path:
pattern: 'Memories/{name}.md'
fields:
- name
unique:
- field: name
scope: type
display:
name_field: description
icon: brain
implements:
- contract: mdbase.memory
version: 1.0.0
fields:
name: name
description: description
kind: kind
by: by
---

# Memory

One thing an assistant should remember about you, at `Memories/<name>.md`.
The note's body is the memory; its frontmatter is the index assistants read
first.

```markdown
---
description: Prefers metric units and 24-hour times in every answer
kind: feedback
by: Claude
---
Use kilometres, kilograms, Celsius and 24-hour times.

Why: they find imperial units and am/pm slow to read.
How to apply: convert any figures a source gives in other units.
```

Assistants that reach this collection through mdbase recall by listing each
memory's name, description and kind, then reading the few that matter. When
they learn something worth keeping, they update the memory on that subject or
add a new one. You can read, correct or delete any memory here yourself.

This type belongs to your collection once installed. Apps find memories
through the `mdbase.memory` contract, not through this folder, so you can move
them by changing both `match.path_glob` and `collection.path.pattern`, or add
fields of your own.
48 changes: 48 additions & 0 deletions dist/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
"artifact": "./artifacts/contracts/mdbase.daily-note/1.0.0.md",
"standards": []
},
{
"id": "mdbase.memory",
"version": "1.0.0",
"name": "Memory",
"description": "One thing an AI assistant should remember about the person it works for, shared by every assistant that reaches the collection.",
"contract_type": "record",
"digest": "sha256:09d16184787c403222d33ff0449569f664e3d12bd83c5368e2de1adbae93a52f",
"artifact": "./artifacts/contracts/mdbase.memory/1.0.0.md",
"standards": []
},
{
"id": "mdbase.person",
"version": "1.0.0",
Expand Down Expand Up @@ -744,6 +754,44 @@
]
}
},
{
"id": "mdbase.memory",
"version": "1.0.0",
"name": "Memories",
"description": "The mdbase.memory contract and an editable Memory type that AI assistants share.",
"digest": "sha256:c6453eaeea05efef616ad4282e131ad933535c9a1cb1df6fa0859e36541df2cd",
"provision": "./packs/mdbase.memory/1.0.0.json",
"provides": [
{
"id": "mdbase.memory",
"version": "1.0.0",
"digest": "sha256:0db69a68f706a216c3cf133af84dd600928c3637d49d51b707b499ddb7407bd6"
}
],
"resource_count": 3,
"display": {
"name": "Memories",
"summary": "Keep what your AI assistants remember about you in one place that Claude, ChatGPT and others all read and update.",
"category": "other",
"audience": "general",
"icon": "brain",
"badges": [
"Shared AI memory"
]
},
"installation": {
"visibility": "default",
"recommendation": "optional",
"primary_type": "memory",
"caution": "Requires an mdbase engine with path-stored fields (mdbase 0.3.0-rc.6). Older engines reject the Memory type, which keeps each memory's name in its file name.",
"types": [
{
"name": "memory",
"label": "Memory"
}
]
}
},
{
"id": "mdbase.runtime.standard",
"version": "0.2.0",
Expand Down
Loading