Git-native, human-readable session memory for AI agents. Every decision is a commit, every state is Markdown.
Project description
cervellaswarm-session-memory
Git-native, human-readable session memory for AI agents.
Every decision is a commit. Every state is Markdown. Every audit trail is a git log away.
Session 1 Session 2 Session 3
| | |
v v v
+-----------+ +-----------+ +-----------+
| State.md |--->| State.md |--->| State.md |
| (v1) | | (v2) | | (v3) |
+-----------+ +-----------+ +-----------+
| | |
v v v
git commit git commit git commit
No vector databases. No cloud services. No embedding models.
Why This Exists
AI agent frameworks lose context between sessions. Your agent forgets decisions, repeats mistakes, and can't explain what happened yesterday.
Current solutions store memory in opaque binary formats (LanceDB, ChromaDB, Qdrant) that you can't read, can't version-control, and can't audit.
cervellaswarm-session-memory takes a different approach: plain Markdown files tracked in git.
Installation
pip install cervellaswarm-session-memory
Requires Python 3.10+. Single dependency: pyyaml.
Quick Start
Initialize a project
cervella-session init my-project
This creates:
.session-memory/
my-project/
SESSION_STATE_my-project.md # Your session state
archive/ # Old states go here
PROJECT_COMPASS.md # Project direction
Check quality
cervella-session check my-project
Scores your session state on 4 criteria (0-10 scale):
- Actionability (30%): Are there clear TODOs and next steps?
- Specificity (30%): Dates and numbers, or vague "soon" and "maybe"?
- Freshness (20%): Updated this week, or gathering dust?
- Conciseness (20%): Within line limits, or a novel?
Audit for secrets
cervella-session audit .session-memory/
Detects accidentally committed API keys, tokens, passwords, and private keys. Supports custom patterns via config.
Verify sync status
cervella-session sync my-project
Checks freshness, file size limits, git tracking, and uncommitted changes.
List projects
cervella-session list
Python API
from cervellaswarm_session_memory import (
init_project,
check_quality,
audit_directory,
verify_project,
discover_projects,
)
# Initialize
project = init_project("my-project", project_root=Path("/path/to/repo"))
# Quality check
result = check_quality(project.state_file, project.name)
print(f"Score: {result.total}/10 [{result.status}]")
# Secret audit
audit = audit_directory(Path(".session-memory"))
assert audit.clean, f"Found {audit.critical_count} critical secrets!"
# Sync verification
sync = verify_project("my-project")
print(f"Overall: {sync.overall.value}")
# Discovery
projects = discover_projects()
for p in projects:
print(f" {p.name}: {p.state_file}")
Configuration
Create .cervella/session-memory.yaml in your project root:
# Where session memory files live
memory_dir: ".session-memory"
# File size limits
max_lines: 300
warning_lines: 200
# Quality scoring weights (must sum to 1.0)
quality:
weights:
actionability: 0.30
specificity: 0.30
freshness: 0.20
conciseness: 0.20
target_score: 8.0
# Secret scanning
secrets:
extra_patterns:
- pattern: "CUSTOM_KEY_[a-zA-Z0-9]+"
name: "Custom API Key"
# Multi-project registry
projects:
my-app:
path: ~/Developer/MyApp
my-api:
path: ~/Developer/MyAPI
Config priority: CERVELLASWARM_SESSION_MEMORY_CONFIG env var > project .cervella/session-memory.yaml > user ~/.claude/session-memory.yaml > defaults.
How It Compares
| Feature | CervellaSwarm | CrewAI Memory | AutoGen Memory | Letta |
|---|---|---|---|---|
| Storage format | Markdown files | LanceDB (binary) | ChromaDB (binary) | PostgreSQL |
| Version control | git native | manual | none | developing |
| Human readable | 100% | no | no | partial |
| Cloud required | never | optional | optional | optional |
| Setup time | < 5 min | 10-30 min | varies | varies |
| Audit trail | git log |
none | none | developing |
| EU AI Act ready | yes | no | no | developing |
| Dependencies | 1 (pyyaml) | LanceDB + embeddings | ChromaDB + embeddings | PostgreSQL + more |
| Multi-project | native | no | no | no |
Honest note: CrewAI and AutoGen offer semantic search over memory using vector embeddings, which we deliberately don't include. If you need similarity-based retrieval, pair this package with
cervellaswarm-code-intelligenceor use a vector store alongside it. Our bet is that explicit, human-curated session state is more reliable than automated extraction for critical decisions.
Template System
Session state files are created from templates with {{ placeholder }} substitution. The built-in templates provide a battle-tested structure for tracking:
- Session progress: What was done, what's next
- Decisions: What was decided, why, and when
- Project status: Progress bars and phase tracking
- Archive: Historical session summaries
JSON Output
All CLI commands support --json for integration with CI/CD and automation:
cervella-session check --json | jq '.[] | select(.total < 8)'
License
Apache-2.0. See LICENSE for details.
Part of CervellaSwarm
This package is part of the CervellaSwarm multi-agent framework. Other packages:
cervellaswarm-code-intelligence- AST-based code analysiscervellaswarm-agent-hooks- Lifecycle hooks for Claude Code agentscervellaswarm-agent-templates- Agent definition templatescervellaswarm-task-orchestration- Deterministic task routingcervellaswarm-spawn-workers- Worker process management
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cervellaswarm_session_memory-0.1.0.tar.gz.
File metadata
- Download URL: cervellaswarm_session_memory-0.1.0.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4706747e162dec71772fac5faa2afbac701817d6771a4afa03198f1c4a5f490
|
|
| MD5 |
070ca40ed5093306c216b00cfaeb7acd
|
|
| BLAKE2b-256 |
1d02ee2e836b5d3f3a34aaea041cc30d3edf02c854b230aa14d51c6777efbffc
|
Provenance
The following attestation bundles were made for cervellaswarm_session_memory-0.1.0.tar.gz:
Publisher:
publish-session-memory.yml on rafapra3008/cervellaswarm-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cervellaswarm_session_memory-0.1.0.tar.gz -
Subject digest:
b4706747e162dec71772fac5faa2afbac701817d6771a4afa03198f1c4a5f490 - Sigstore transparency entry: 991484797
- Sigstore integration time:
-
Permalink:
rafapra3008/cervellaswarm-internal@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Branch / Tag:
refs/tags/session-memory-v0.1.0 - Owner: https://github.com/rafapra3008
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-session-memory.yml@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cervellaswarm_session_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cervellaswarm_session_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
078ca9f7f6bfc2fd3c864a8228e3335bc74a994e578fc026373181616c12c0c9
|
|
| MD5 |
f2d3ba081d509d514263679d20a55b97
|
|
| BLAKE2b-256 |
0cc3fb0717f447a165b86155b2454b769cda2613ed3b96224c6ce08ba6456aa8
|
Provenance
The following attestation bundles were made for cervellaswarm_session_memory-0.1.0-py3-none-any.whl:
Publisher:
publish-session-memory.yml on rafapra3008/cervellaswarm-internal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cervellaswarm_session_memory-0.1.0-py3-none-any.whl -
Subject digest:
078ca9f7f6bfc2fd3c864a8228e3335bc74a994e578fc026373181616c12c0c9 - Sigstore transparency entry: 991484800
- Sigstore integration time:
-
Permalink:
rafapra3008/cervellaswarm-internal@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Branch / Tag:
refs/tags/session-memory-v0.1.0 - Owner: https://github.com/rafapra3008
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-session-memory.yml@ac9df4a1b110a5d243ef091a26655087aaf6bca8 -
Trigger Event:
push
-
Statement type: