Skip to content
Back to skills

Memory Schema

ASecurity

Forgetful MCP's exact call shape and rules — wrapper-trio dispatch, required fields, strict enums, hard char caps, the asymmetric linking API, the tools that do not exist, and project-scope discipline. Auto-loads before any memory WRITE (create_memory, create_entity, create_document, create_project, link_*, update_memory) so the model uses the right shape and stops inventing fields. Also load it whenever a Forgetful tool errors with `validation failure`, `unexpected keyword argument` or `Inpu...

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 19, 2026
ai-agentsrustgoapidatabasedocumentation

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 9, 2026

npx -y skills add konstantinos-malavazos/claude-code-playbook --skill memory-schema --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Memory Schema?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Memory Schema
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/konstantinos-malavazos-memory-schema-claude-code-playbook/badge)](https://www.skillsdirectory.com/skills/konstantinos-malavazos-memory-schema-claude-code-playbook)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: memory-schema
description: >-
  Forgetful MCP's exact call shape and rules — wrapper-trio dispatch, required fields,
  strict enums, hard char caps, the asymmetric linking API, the tools that do not exist,
  and project-scope discipline. Auto-loads before any memory WRITE (create_memory,
  create_entity, create_document, create_project, link_*, update_memory) so the model uses
  the right shape and stops inventing fields. Also load it whenever a Forgetful tool errors
  with `validation failure`, `unexpected keyword argument` or `Input should be …` — before
  retrying.
---

# Memory schema — Forgetful

> **This is the filled-in variant of `SKILL.md` for one memory server: Forgetful.**
> If Forgetful is what you run, `mv forgetful.SKILL.md SKILL.md` and delete the
> placeholder. If you run something else, keep the placeholder and fill it in from your
> own server — this file is then a worked example of the level of detail that pays off.
>
> **Verify before you trust it.** Caps and enums move between Forgetful releases. The
> server tells you the truth itself: `discover_forgetful_tools` lists what exists,
> `how_to_use_forgetful_tool` gives one tool's real signature. When this file and the
> server disagree, the server is right — fix this file in the same session.

## Call shape

**Step 0 — load the tools.** The memory tools can be **deferred**: listed by name, but
with no schema until loaded. Before the first call, load them with `ToolSearch`
(`select:mcp__forgetful__execute_forgetful_tool,mcp__forgetful__discover_forgetful_tools,mcp__forgetful__how_to_use_forgetful_tool`).
An unloaded tool is not an absent tool. Never conclude the server is missing because a
call failed with a schema error.

Forgetful exposes a wrapper trio: `mcp__forgetful__execute_forgetful_tool`,
`discover_forgetful_tools`, `how_to_use_forgetful_tool`. **Every** operation dispatches
through `execute_forgetful_tool(tool_name, arguments)` — the two are **siblings**. Nesting
`tool_name` inside `arguments` is the single most common failure, and it fails validation
every time.

CORRECT:
```
mcp__forgetful__execute_forgetful_tool(
  tool_name="create_memory",
  arguments={"title": "...", "content": "...", "context": "...",
             "keywords": [...], "tags": ["gotcha", "<repo-tag>", ...], "importance": 8,
             "project_ids": [<owner-id>], "source_files": ["path/in/repo.py"]}
)
```

WRONG:
```
mcp__forgetful__execute_forgetful_tool(
  arguments={"tool_name": "create_memory", ...}
)
```

## Required fields per primitive

### `create_memory` — all six are required

| Field | Cap | Notes |
|---|---|---|
| `title` | 200 chars | |
| `content` | 2000 chars | **hard cap — split, never trim** |
| `context` | 500 chars | where this came from / when it applies |
| `keywords` | 10 items | list of strings |
| `tags` | 10 items | list of strings |
| `importance` | int 1–10 | an **int**, not a string. The memory's type sets it, ±1 (`memory-lint`'s `vocab.json`): ruling 9 · contract, gotcha, architecture 8 · investigation, recipe 7 · feature 6 |

Over 2000 chars, split into 2–3 atomic linked memories rather than cutting the reasoning
out. Each part stands alone and points at the others in `context` — *"Part 2 of 3 — see
also '\<title> Part 1'"*. A trimmed memory is worse than two memories: the half that got
cut is always the *why*.

**Also checked by `memory-lint`** — the server accepts a create without these; the lint
does not:

| Field | Rule |
|---|---|
| `project_ids` | exactly one id: the owning project |
| `source_files` | list of repo-relative paths; required or optional per type |
| `source_repo` | optional; a bare repo name |
| type | exactly one tag in `tags` from the memory-lint types |

### `create_document`

| Field | Cap |
|---|---|
| `title` | 500 |
| `description` | 5000 |
| `content` | 100000 |
| `tags` | 10 |

### `create_entity`

- `name` ≤ 200
- `entity_type` — strict enum, see below
- `tags` ≤ 10

### `create_project`

- `name` ≤ 500
- `project_type` — strict enum, see below
- `repo_name` — if present, MUST be `owner/repo`. A bare name fails: **omit it** instead.

### `create_code_artifact`

- `title` ≤ 500 · `description` ≤ 5000 · `code` ≤ 50000 · `language` ≤ 100 · `tags` ≤ 10

## Strict enums — case-sensitive, exact

`Entity.entity_type`: `Organization` | `Individual` | `Team` | `Device` | `Other`

- `Other` **requires** `custom_type` (≤ 100). That is where everything technical goes, so
  the value is yours to pick — name the *kind of thing* in your own stack's words and stay
  consistent: `message-queue-topic`, `source-table`, `scheduled-job`, `mcp-server`.
- These all **fail**, however natural they read: `Service`, `Interface`, `Database`,
  `Application`, `Component`, `Repository`, `Project`.

`Project.project_type`: `personal` | `work` | `learning` | `development` |
`infrastructure` | `template` | `product` | `marketing` | `finance` | `documentation` |
`development-environment` | `third-party-library` | `open-source`

`Project.status` (default `active`): `active` | `archived` | `completed`

## The linking API is asymmetric — learn the table

| Link | Mechanism |
|---|---|
| Entity → Memory | `link_entity_to_memory` |
| Entity → Entity | `link_entities` |
| Memory → Memory | **automatic** — cosine similarity ≥ 0.7 at create time |
| Memory → Document | `update_memory` with `document_ids` |
| Entity → Document | **not supported** — bridge it |

**Entity → Document workaround:** name the entity in the document's content, share tags
between them, and bridge with a Memory linked to both (`link_entity_to_memory` +
`update_memory.document_ids`).

## Tools that do not exist

| Do NOT call | Use instead |
|---|---|
| `list_memories` | `get_recent_memories` or `query_memory` |
| `link_memory_to_document` | `update_memory` with `document_ids` |
| `link_entity_to_document` | not supported — bridge via a Memory |

## Quirks worth knowing before you hit them

- `query_memory` does **not** accept `limit`. Omit it.
- `query_memory` ranks by semantic similarity; it is **not exhaustive**. Never ask it for a
  complete list. A question that enumerates code — every X that implements Y, every caller
  of Z — goes to the code through Serena. Do not write a memory or a Document to read the
  list back later; it is stale the moment the code changes.
- `list_entities` takes `project_ids` (**plural**, `list[int]`) — not `project_id`, and
  not `limit`.
- `search_entities` *does* take `limit`. Don't conflate the two.
- `Project.repo_name` is format-checked (`owner/repo`). `Memory.source_repo`,
  `Document.source_repo` and `Entity.source_repo` are **not** — a bare name is fine there.

## Which primitive

- **Memory** — one atomic fact or conclusion, ≤ 2000 chars: a convention, a gotcha, a root
  cause, a job's behaviour.
- **Document** — long-form, ≤ 100K: an architecture write-up, a codified set of rulings —
  text the code cannot tell you. Not an inventory of code: Serena answers that live.
- **Entity** — real-world things only: a team, a vendor, a queue topic, a source table, a
  server you integrate with → `Other` + `custom_type` for anything not in the enum. Code
  and the jobs that run it are **Memories**, not entities.
- **CodeArtifact** — reusable code that will actually be pasted somewhere. Not a
  description of code.

## Tagging and content rules

The `memory-lint` skill enforces these rules: its hook blocks a create or update that
breaks one, and its `SKILL.md` lists them in full. In one line: one type tag, at least one
repo/project tag, the rest by functionality, at most ten lowercase tags, never a ticket id
(put it in `content` for provenance); content with no line references, branch state or
flow-state words.

- One atomic fact or conclusion per memory. State **what** and **why**.
- Link related memories so one query returns the whole chain — root cause → fix → blast
  radius → recipe.
- For recipes and hypotheses, carry a **confidence** and a **validated** marker in the
  content. Flip `validated` only after a real (e.g. staging) run confirms it.

## When to write

Durable conclusions only, at ticket APPROVE or via `/end-of-day`. Never write in-flight
chatter — that is what handoff files are for. See
[`../../../docs/shared/10-memory-hygiene.md`](../../../docs/shared/10-memory-hygiene.md).

## Project-scope discipline

Always set `project_ids` on a new memory. A memory with `project_ids: []` is invisible to
every project-scoped query — it is not lost, it is worse: it is there and never returned.

**Do not hardcode project ids in this file.** They are per-instance and they drift. Resolve
them with `list_projects` at the start of a writing session and reuse the answer for that
session.

## On any validation error

Read the error. Fix the **exact** field it names. Retry once. **Never retry unchanged** —
Forgetful's errors are precise, so an unchanged retry is a guaranteed second failure.

| Error | What it means |
|---|---|
| `unexpected keyword argument 'tool_name'` | you nested it inside `arguments` |
| `Input should be 'Organization'…` | invalid `entity_type` |
| `String should have at most 2000 characters` | split the content, don't trim it |
| `custom_type is required when entity_type is 'Other'` | add `custom_type` |
| `repo_name must follow 'owner/repo' format` | fix it or omit it |
| `got an unexpected keyword argument 'limit'` on `list_entities` | drop `limit` |
| `tool link_memory_to_document not found` | use `update_memory.document_ids` |
| `missing 1 required positional argument: 'importance'` | add the int |
| `Input should be a valid integer` on `importance` | `7`, not `"high"` |

Files in this skill

  • SKILL.md2.2 KB
  • forgetful.SKILL.md8.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.