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
Metadata
Release files for cervellaswarm-session-memory 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cervellaswarm_session_memory-0.1.0.tar.gz | 38.5 kB | With provenance | Details for cervellaswarm_session_memory-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cervellaswarm_session_memory-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for cervellaswarm_session_memory-0.1.0-py3-none-any.whl |
Total release size: 65.5 kB
Release files / cervellaswarm_session_memory-0.1.0.tar.gz
| Download URL | cervellaswarm_session_memory-0.1.0.tar.gz |
|---|---|
| Size | 38.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b4706747e162dec71772fac5faa2afbac701817d6771a4afa03198f1c4a5f490
|
|
BLAKE2b-256 checksum How to use checksums |
1d02ee2e836b5d3f3a34aaea041cc30d3edf02c854b230aa14d51c6777efbffc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 25, 2026.
Transparency logRelease files / cervellaswarm_session_memory-0.1.0-py3-none-any.whl
| Download URL | cervellaswarm_session_memory-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
078ca9f7f6bfc2fd3c864a8228e3335bc74a994e578fc026373181616c12c0c9
|
|
BLAKE2b-256 checksum How to use checksums |
0cc3fb0717f447a165b86155b2454b769cda2613ed3b96224c6ce08ba6456aa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 25, 2026.
Transparency logSecurity for cervellaswarm-session-memory 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for cervellaswarm_session_memory-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.