# Send Faya Session Memory to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "faya-session-memory",
    "name": "Faya Session Memory",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/moltbotmolty-del/faya-session-memory",
    "canonicalUrl": "https://clawhub.ai/moltbotmolty-del/faya-session-memory",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/faya-session-memory",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=faya-session-memory",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/build-glossary.py",
      "scripts/cron-optimizer.py",
      "scripts/session-to-memory.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "faya-session-memory",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-03T04:18:34.371Z",
      "expiresAt": "2026-05-10T04:18:34.371Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=faya-session-memory",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=faya-session-memory",
        "contentDisposition": "attachment; filename=\"faya-session-memory-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "faya-session-memory"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/faya-session-memory"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/faya-session-memory",
    "downloadUrl": "https://openagent3.xyz/downloads/faya-session-memory",
    "agentUrl": "https://openagent3.xyz/skills/faya-session-memory/agent",
    "manifestUrl": "https://openagent3.xyz/skills/faya-session-memory/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/faya-session-memory/agent.md"
  }
}
```
## Documentation

### Session Memory

Solve the #1 problem with long-running AI agents: knowledge loss after context compaction.

### The Problem

When sessions compact (summarize old messages to free context), specific details are lost:
names, decisions, file paths, reasoning. The agent retains a summary but loses the ability
to recall "What exactly did Annika say?" or "When did we decide to use v6 format?"

### The Solution: Three-Layer Memory Architecture

Layer 1: MEMORY.md          — Curated long-term memory (human-edited)
Layer 2: SESSION-GLOSSAR.md — Auto-generated structured index (people/projects/decisions/timeline)
Layer 3: memory/sessions/   — Full session transcripts as searchable Markdown

All three layers live under memory/ and are automatically vectorized by OpenClaw's
memory search, creating a navigational hierarchy: glossary finds the right session,
session provides the details.

### Step 1: Convert existing sessions to Markdown

python3 scripts/session-to-memory.py

This scans all JSONL session logs in ~/.openclaw/agents/*/sessions/ and converts
them to memory/sessions/session-YYYY-MM-DD-HHMM-*.md. Truncates long assistant
responses to 2KB, skips system messages, tracks state to avoid re-processing.

Options:

--new — Only convert sessions not yet processed (for incremental runs)
--agent main — Specify agent ID (default: main)

### Step 2: Build the glossary

python3 scripts/build-glossary.py

Scans all session transcripts and builds memory/SESSION-GLOSSAR.md with:

People — Who was mentioned, in how many sessions, date ranges
Projects — Which projects discussed, with relevant topic tags
Topics — Categorized themes (Email Drafts, Website Build, Security, etc.)
Timeline — Per-day summary (session count, people, topics)
Decisions — Extracted decision-like statements with dates

Options:

--incremental — Only process new sessions (uses cached scan state)

### Step 3: Set up cron jobs for auto-updates

Create two cron jobs (use a cheap model like Gemini Flash):

Job 1: Session sync + glossary rebuild (every 4-6 hours)

Task: Run \`python3 scripts/session-to-memory.py --new\` then
      \`python3 scripts/build-glossary.py --incremental\`.
      Report how many new sessions were converted and indexed.

Optional Job 2: Pre-compaction memory flush check
Already built into AGENTS.md by default — just ensure the agent writes to
memory/YYYY-MM-DD.md before each compaction.

### Customizing Entity Detection

Edit scripts/build-glossary.py to add your own known people and projects:

KNOWN_PEOPLE = {
    "alice": "Alice Smith — Project Manager",
    "bob": "Bob Jones — CTO",
}

KNOWN_PROJECTS = {
    "website-redesign": "Website Redesign — Q1 Initiative",
    "api-migration": "API Migration — v2 to v3",
}

The glossary also detects topics via regex patterns. Add new patterns in the
topic_patterns dict for your domain.

### How It Works With memory_search

Once set up, memory_search("Alice project decision") will find:

The glossary entry for Alice (which sessions she appears in)
The actual session transcript where the decision was discussed
Any MEMORY.md entry about Alice

This gives the agent a navigation layer (glossary) plus detail access
(transcripts) — much better than either alone.

### File Structure After Setup

memory/
├── MEMORY.md                    — Curated (you maintain this)
├── SESSION-GLOSSAR.md           — Auto-generated index
├── YYYY-MM-DD.md                — Daily notes
├── .glossary-state.json         — Glossary builder state
├── .glossary-scans.json         — Cached scan results
└── sessions/
    ├── .state.json              — Converter state
    ├── session-2026-01-15-0830-abc123.md
    ├── session-2026-01-15-1200-def456.md
    └── ...

### Cron Memory Optimizer

Cron jobs run in isolated sessions with zero memory context. The optimizer analyzes your cron jobs and suggests memory-enhanced versions:

python3 scripts/cron-optimizer.py

This scans ~/.openclaw/cron/jobs.json, identifies jobs that would benefit from memory context, and generates memory/cron-optimization-report.md with before/after prompts and implementation guidance.

Example optimization:

Original: "Run daily research scout..."
Enhanced: "Before starting: Use memory_search to find recent context about research activities. Check memory/SESSION-GLOSSAR.md for relevant people, projects, and recent decisions. Then proceed with the original task using this context.

Run daily research scout..."

The script is conservative (suggests only, never auto-modifies) and skips monitoring jobs that don't need context.

### Tips

Run the full rebuild (python3 scripts/build-glossary.py without --incremental)
occasionally to pick up improvements to entity detection
The glossary is most useful when KNOWN_PEOPLE and KNOWN_PROJECTS are populated —
spend 5 minutes adding your key contacts and projects
For agents that run 24/7, the cron job keeps everything current automatically
Session transcripts can get large (our 297 sessions = 24MB) — this is fine,
OpenClaw's vector search handles it efficiently
Use the cron optimizer after setting up memory to enhance existing automation
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: moltbotmolty-del
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-03T04:18:34.371Z
- Expires at: 2026-05-10T04:18:34.371Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/faya-session-memory)
- [Send to Agent page](https://openagent3.xyz/skills/faya-session-memory/agent)
- [JSON manifest](https://openagent3.xyz/skills/faya-session-memory/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/faya-session-memory/agent.md)
- [Download page](https://openagent3.xyz/downloads/faya-session-memory)