Skills memory-totalrecall
Total Recall memory backend — git-branch-based persistent memory store with time-decay relevance.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/apptah/openclaw-memory-stack/skills/memory-totalrecall" ~/.claude/skills/openclaw-skills-memory-totalrecall && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/apptah/openclaw-memory-stack/skills/memory-totalrecall" ~/.openclaw/skills/openclaw-skills-memory-totalrecall && rm -rf "$T"
skills/apptah/openclaw-memory-stack/skills/memory-totalrecall/SKILL.mdTotal Recall — SKILL.md
Overview
Total Recall is a git-based memory backend that stores memories as structured markdown files on a dedicated orphan branch (
openclaw-memory) within your existing project repository. It requires zero external dependencies beyond git itself, making it the simplest backend to deploy and the most portable across environments. Each memory is a timestamped markdown file in a _memory/ directory, committed with a searchable commit message. Retrieval uses git's built-in search (git log --grep, git grep). Relevance scoring is time-based: recent memories rank higher than older ones. Total Recall is ideal for conversation history, architectural decisions, and context snapshots in any project where installing additional tooling is impractical or undesirable.
Prerequisites
- Git (version >= 2.20) — pre-installed on macOS and most Linux distributions.
- A POSIX shell (bash or zsh).
- No external services, databases, or runtimes required.
Verify with:
git --version
Configuration
Configuration is stored in
config.json alongside this file. The router reads it to understand backend capabilities.
| Key | Type | Default | Description |
|---|---|---|---|
| string | | Backend identifier for the router |
| string | | Orphan branch where memories are stored |
| string | | Directory within the branch for memory files |
| string | | File format for stored memories |
| string | | Relevance scoring method |
| string | | Continuous decay formula |
| float | | Score for memories from today |
| float | | Score for memories from this week |
| float | | Score for memories from this month |
| float | | Floor score for older memories |
| int | | Maximum results per query |
| string | | Prefix for commit messages |
Usage
All operations target the
openclaw-memory orphan branch. The agent reads and writes memory files on this branch using git show and git checkout commands, avoiding disruption to the working tree. Alternatively, use git worktree for a persistent second checkout.
Store
To store a memory with key
auth-decision:
# Save current branch CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) # Switch to memory branch git checkout openclaw-memory # Create memory file with structured content TIMESTAMP=$(date -u +"%Y-%m-%dT%H-%M-%S") FILENAME="_memory/${TIMESTAMP}_auth-decision.md" cat > "$FILENAME" << 'MEMORY_EOF' --- key: auth-decision timestamp: 2026-03-17T14:30:00Z tags: [auth, architecture, decision] --- # Auth Decision We chose JWT with RS256 signing for the auth middleware. Refresh tokens use httpOnly cookies for storage. MEMORY_EOF # Commit the memory git add "$FILENAME" git commit -m "memory: auth-decision — JWT auth middleware decision" # Return to working branch git checkout "$CURRENT_BRANCH"
File naming convention:
{ISO-timestamp}_{slugified-key}.md
- Timestamp format:
(colons replaced with hyphens for filesystem safety)YYYY-MM-DDTHH-MM-SS - Key slug: lowercase, hyphens for spaces, alphanumeric and hyphens only
Commit message convention:
memory: {key} — {brief description}
This convention enables git log --grep to find memories by key.
Retrieve
To retrieve a memory by key:
# Search for the key in commit messages on the memory branch git log openclaw-memory --grep="memory: auth-decision" --format="%H %ai %s" --max-count=5 # Get the file path from the most recent matching commit COMMIT_HASH=$(git log openclaw-memory --grep="memory: auth-decision" --format="%H" --max-count=1) FILEPATH=$(git diff-tree --no-commit-id --name-only -r "$COMMIT_HASH" | grep "_memory/") # Read the file content without switching branches git show "openclaw-memory:$FILEPATH"
Output construction — build the contract JSON from the results:
{ "query_echo": "auth-decision", "results": [ { "content": "We chose JWT with RS256 signing for the auth middleware...", "relevance": 1.0, "source": "totalrecall", "timestamp": "2026-03-17T14:30:00Z" } ], "result_count": 1, "status": "success", "error_message": null, "error_code": null, "backend_duration_ms": 45, "normalized_relevance": 1.0, "backend": "totalrecall" }
Search
To search memories by pattern across all memory files:
# Search commit messages for pattern git log openclaw-memory --grep="auth" --format="%H %ai %s" # Search file contents on the memory branch for a pattern git grep -l "JWT" openclaw-memory -- "_memory/" # Read matching files for FILE in $(git grep -l "JWT" openclaw-memory -- "_memory/"); do echo "--- $FILE ---" git show "$FILE" done
For broader search with context:
# Full-text search with surrounding lines git grep -n -C 2 "pattern" openclaw-memory -- "_memory/" # Case-insensitive search git grep -il "jwt" openclaw-memory -- "_memory/"
Interface Contract
Input
— Create a markdown file on the memory branch and commit it.store(key, content, metadata?)
— Search commit messages withretrieve(query, options?)
, read matching files viagit log --grep
.git show
— Search file contents withsearch(pattern, scope?)
on the memory branch.git grep
Output Format
All backends return the same JSON structure:
{ "query_echo": "original query string", "results": [ { "content": "...", "relevance": 0.0, "source": "totalrecall", "timestamp": "ISO8601" } ], "result_count": 0, "status": "success | partial | empty | error", "error_message": null, "error_code": null, "backend_duration_ms": 0, "normalized_relevance": 0.0, "backend": "totalrecall" }
Failure Codes
| Code | Meaning |
|---|---|
| Git not installed, not in a git repo, or memory branch missing |
| Exceeded 5s (router-measured) |
| Query succeeded but no matching memories found |
| Some results returned but search may be incomplete |
| Git command failed (see error_message for stderr) |
Relevance Normalization
Total Recall uses time-decay relevance scoring. There is no semantic similarity — relevance is purely a function of how recently the memory was stored.
Formula:
relevance = max(0.2, 1.0 - (days_ago * 0.043))
This produces a continuous decay curve that roughly aligns with these buckets:
| Age | Score | Calculation |
|---|---|---|
| Today (0 days) | 1.0 | max(0.2, 1.0 - 0) |
| 3 days ago | 0.871 | max(0.2, 1.0 - 0.129) |
| 7 days ago | 0.699 | max(0.2, 1.0 - 0.301) |
| 14 days ago | 0.398 | max(0.2, 1.0 - 0.602) |
| 19+ days ago | 0.2 | max(0.2, ...) = floor |
The
normalized_relevance field in the response is the highest relevance score among all results. When multiple results match, they are sorted by relevance (most recent first).
Router Integration
- Normalized relevance >= 0.4 -> "good enough", no fallback needed.
- Normalized relevance < 0.4 or status = empty -> trigger fallback to another backend.
- status = error -> immediate fallback, log error.
Limitations
- No semantic search. Total Recall uses literal text matching (
). It cannot understand that "authentication" and "login" are related concepts. If the query uses different words than the stored memory, it will not match.git grep - No relationship or graph queries. Cannot answer "what decisions led to X" unless those links are explicitly stored in the memory content.
- Time-based relevance only. A highly relevant old memory scores lower than a trivial recent one. The scoring model has no understanding of content importance.
- Branch switching overhead. Store operations require switching to the memory branch and back, which can be disruptive during active development. Use
to mitigate this.git worktree - Linear scaling. Search performance degrades linearly with the number of stored memories. Git grep is fast, but thousands of memory files will eventually slow down.
- No concurrent writes. Git does not support concurrent commits safely. Simultaneous store operations from multiple agents may conflict.
- Keyword matching is case-sensitive by default. Use
flag with-i
andgit grep
for case-insensitive matching.git log --regexp-ignore-case
Tier
Starter — Included in the $49 package. Zero additional cost, zero additional dependencies.