Skip to content
Skills Library
AI & agents · Tool integration

memory-and-context

/memory-and-context

Store, retrieve, search, and manage persistent memory across sessions. Triggers on: store memory, save this, retrieve, forget, manage memory, context, pattern.

Repository
attune-ai ↗
Licence
Apache-2.0
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Store, retrieve, search, and manage persistent memory across sessions. Triggers on: store memory, save this, retrieve, forget, manage memory, context, pattern.

Original author description

Store, retrieve, search, and manage persistent memory across sessions. Triggers on: store memory, save this, retrieve, forget, manage memory, context, pattern.

How it works

  1. Scoping
  2. Execution
  3. When to Use This Skill
  4. Memory Operations
  5. Context Operations
  6. Security Classification
  7. Pattern Lifecycle
  8. Redis Upgrade Path
  9. Anti-Patterns
Original SKILL.md headings · 294 lines, 1,187 words
SKILL.md preview
---
name: memory-and-context
description: "Store, retrieve, search, and manage persistent memory across sessions. Triggers on: store memory, save this, retrieve, forget, manage memory, context, pattern."
---
# Memory and Context

**IMPORTANT: Start your response with a context preamble.**

Call `help_lookup(topic="memory", mode="preamble")` and
display the returned `preamble` text as a blockquote. Then
tell the user they can say "tell me more" for a step-by-step
guide, or answer the scoping questions below to proceed.

If the MCP call fails, fall back to:

> **Memory and Context** — Stores and retrieves persistent context across sessions — notes, preferences, project state.

## Scoping

Before running, ask:

1. **Operation**: "What do you need? Store, retrieve,
   search, or forget?"
2. **Key/query**: "What key or search term?"
3. **Classification** (store only): "PUBLIC, INTERNAL,
   or SENSITIVE?"

## Execution

### Shared command workspace (preferred)

Open adapter `memory-and-context` with the selected operation and scoped
arguments. Present its widget or returned Markdown and collect its bound
action before calling the existing memory tool. Store and forget are external
writes and require explicit confirmation; retrieve and search remain
read-only. Publish the exact tool response as `operation_result`.

After a successful store or forget, follow the workspace's returned
`memory_retrieve` verification request and publish it as
`verification_result`. Store succeeds only when the same value and
classification are retrieved; forget succeeds only when the post-delete read
misses. Never render stored values—especially SENSITIVE values—in the
workspace. A failed backend call must say “did not complete.” Preserve these
decisions and verification receipts in compact text when the shared tools are
unavailable.

Based on the user's answer, call the appropriate MCP
tool:

- Store: `memory_store(key, value, classification)`
- Retrieve: `memory_retrieve(key)`
- Search: `memory_search(query, pattern_type)`
- Forget: `memory_forget(key, scope)`

attune-ai's memory system sits ABOVE Anthropic's native
memory features. It provides security-classified storage,
cross-agent pattern sharing, and a structured pattern
lifecycle that native memory
does not offer. Use the decision table below to determine
which system to use for a given task.

## When to Use This Skill

### Layer Positioning

| Use Case | Use Anthropic Native | Use attune-ai |
|----------|----------------------|---------------|
| "Remember my code style" | CLAUDE.md | -- |
| "What did we do last session?" | Session Memory | -- |
| "Store this pattern for reuse across agents" | -- | memory_store (shared library) |
| "Classify this finding as SENSITIVE" | -- | Security pipeline |
| "Coordinate memory across 3 parallel agents" | -- | Redis pub/sub |
| "Promote this pattern after 5 successful uses" | -- | Pattern lifecycle |
| "Track what this project uses" | Auto Memory | -- |

The rule is simple: if Anthropic's native memory handles
it, use that. If you need classification, cross-agent
sharing, or pattern lifecycle management, use attune-ai.

## Memory Operations

MCP tools for memory management.

### memory_store

Store structured knowledge in attune-ai memory.

**Parameters:**

- **key** (required): Unique identifier for the
  stored data.
- **value** (required): Content to store. Can be a
  string, dict, or structured object.
- **classification** (optional): Security
  classification. One of `PUBLIC` (default),
  `INTERNAL`, or `SENSITIVE`. See Security
  Classification below.
- **pattern_type** (optional): Category string for
  pattern matching and lifecycle management.

**When to use:** Cross-agent patterns,
security-classified data, structured knowledge that
must persist beyond a single session or be shared
across agents.

**When NOT to use:** Simple preferences belong in
CLAUDE.md. Conversation history is handled by native
Session Memory.

**Example:**

```python
memory_store(
    key="python-import-ordering",
    value="stdlib first, then third-party, then local. Enforce with isort.",
    classification="PUBLIC",
    pattern_type="coding-convention"
)
```

### memory_retrieve

Retrieve data by key or pattern ID.

**Parameters:**

- **key** (required): The key or pattern_id to retrieve.

**Returns:** The stored value, or null if not found.

### memory_search

Search memory for patterns matching a query.

**Parameters:**

- **query** (required): Search string to match
  against stored keys and values.
- **pattern_type** (optional): Filter results to a
  specific pattern type category.

**Returns:** A list of matching memory entries,
ranked by relevance.

### memory_forget

Remove data from memory.

**Parameters:**

- **key** (required): The key or pattern_id to remove.
- **scope** (optional): Which storage layer to remove
  from. One of:
  - `"session"` -- Short-term session storage only.
  - `"persistent"` -- Long-term persistent storage only.
  - `"all"` -- Both layers. This is the default.

## Context Operations

Session-scoped key-value store for transient state.
Context values are discarded when the session ends.
Use these for temporary coordination data that does
not need to persist.

### context_get

Get a session context value.

**Parameters:**

- **key** (required): The context key to retrieve.

**Returns:** The stored value, or null if not set.

### context_set

Set a session context value.

**Parameters:**

- **key** (required): The context key to set.
- **value** (required): The value to store.

**Example:**

```python
context_set(key="current_review_file", value="src/attune/workflows/base.py")
file = context_get(key="current_review_file")
```

## Security Classification

When storing data with `memory_store`, choose the
appropriate classification level.

- **PUBLIC**: Safe to share across agents and sessions.
  No special handling. This is the default.
- **INTERNAL**: Limited to current project or team
  scope. Not shared externally.
- **SENSITIVE**: PII is scrubbed before storage. Data
  is encrypted with AES-256-GCM. All access is audit
  logged.

Choose the minimum classification that meets your
needs. Over-classifying creates unnecessary overhead.

**Example -- storing a security finding:**

```python
memory_store(
    key="vuln-2026-02-cve-1234",
    value={"severity": "HIGH", "file": "src/auth.py", "line": 42, "description": "Hardcoded credential"},
    classification="SENSITIVE",
    pattern_type="security-finding"
)
```

## Pattern Lifecycle

Patterns progress through three stages:

1. **Staged**: Initial storage, awaiting validation.
   Created by any `memory_store` call with a
   `pattern_type`.
2. **Validated**: Confirmed useful through repeated
   access (automatic) or explicit promotion. The system
   tracks access frequency and confidence scores.
3. **Promoted**: Available in the shared library for
   cross-agent access. Other agents and sessions can
   discover and use promoted patterns.

The system handles lifecycle transitions automatically
based on confidence thresholds and usage frequency. You
do not need to manually promote patterns in most cases.

**Creating a staged pattern:**

```python
memory_store(
    key="error-handling-api-calls",
    value="Always wrap external API calls in try/except with specific exceptions. Log before re-raising.",
    pattern_type="coding-convention"
)
```

This pattern starts as Staged. After it is retrieved
or matched 5+ times with positive outcomes, the system
promotes it to Validated, then eventually to Promoted.

## Redis Upgrade Path

By default, attune-ai uses in-memory storage. All
features described in this skill work without Redis.

**What Redis adds:**

- Multi-agent coordination via pub/sub channels.
- Sub-millisecond lookups for large memory stores.
- Shared state across sessions and agents running in
  parallel.
- Pattern persistence with configurable TTL.

**Upgrade:**

```bash
# Redis client libraries ship with attune-ai core — nothing extra to
# install; you only need a running Redis / Agent Memory Server.
pip install attune-ai
```

Zero configuration needed -- connects to
`localhost:6379` by default. For custom configuration,
set the `ATTUNE_REDIS_URL` environment variable:

```bash
export ATTUNE_REDIS_URL="redis://custom-host:6380/0"
```

If Redis disconnects mid-session, the system falls
back to in-memory storage gracefully. No data loss
occurs for the current session; cross-agent
coordination pauses until reconnection.

## Anti-Patterns

- DO NOT use `memory_store` for simple preferences --
  use CLAUDE.md instead.
- DO NOT push Redis on developers who do not need
  multi-agent coordination.
- DO NOT store conversation history -- native Session
  Memory handles this.
- DO NOT over-classify data as SENSITIVE -- use PUBLIC
  unless the data genuinely contains PII or
  credentials.
- DO NOT bypass the pattern lifecycle by manually
  marking patterns as Promoted -- let the confidence
  system validate them.

Versions

The database has no other skills named memory-and-context.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 16ba7205679a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100memory
    Manage the persistent memory layer in .claude/memory/ — list, search, save, update, delete, dedupe. Use to inspect what memories exist, write a new one, or clean up stale entries.
  • 84memory
    Store and retrieve durable agent memory — remember decisions, preferences, and session outcomes with calibrated salience; recall prior context before acting or resuming a project. Use whenever you store a memory, search memory, retrieve prior context, or check what was learned in past sessions.
  • 100twilio-conversation-memory
    Store and retrieve conversation context using Twilio Conversation Memory. Covers Memory Store provisioning, profile management, traits, observations, conversation summaries, and semantic Recall. Use this skill to give AI agents or human agents persistent memory of conversations…
  • 95pact-memory
    Persistent memory for PACT agents. Save context, goals, lessons learned, decisions, and entities. Semantic search across sessions. Use when: saving session context, recalling past decisions, searching lessons. Triggers: memory, save memory, search memory, lessons learned, remember, recall
  • 100persistent-memory
    Persists topic-scoped context across conversations as plain markdown with write, read, consolidate, and forget operations, a never-store list for secrets, and a consent preview before every write. Triggers on "remember this", "save to memory", "what do you remember about",…
  • 100sugar-memory
    Guides an agent to use Sugar's persistent memory layer to store and surface project context across sessions. Use when starting a task in a project that may have prior context (recall relevant memories, get project context); before making a decision that could benefit from past…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.