Standalone memory engine for coding agents
Project description
snipara-memory
snipara-memory is an open source memory engine for coding agents.
Transcript memory remembers what was said. snipara-memory remembers what
should keep mattering.
It is the extraction of Snipara's reusable memory domain into a small open source package that can run without Snipara Cloud, billing, or multi-tenant SaaS concerns.
The goal is simple:
- store durable memories
- recall them semantically
- load session bundles by tier
- compact or archive low-value memory
- detect and resolve contradictions
TL;DR
If your agent forgets decisions between sessions, snipara-memory gives you a
small local memory layer you can embed into your own tooling.
It is built for cases like:
- coding conventions that should survive restarts
- durable project decisions
- reusable learnings from previous sessions
- session warm-up bundles for agents
- memory stores that need auditability instead of silent overwrites
The Open Source Wedge
snipara-memory is not trying to win by being a generic "AI memory" bucket.
The wedge is narrower and more useful:
- durable memory for coding agents
- explicit memory lifecycle instead of raw transcript dumps
- contradiction handling instead of silent duplication
- auditable graveyard state instead of destructive deletes
- session warm-up bundles instead of ad hoc prompt stuffing
If the open source package is not clearly better for this job, it will not help Snipara. That is the quality bar for this repository.
Why This Is Different
Many memory tools stop at "store text, run semantic search".
snipara-memory goes further on the memory lifecycle itself:
- tiered retrieval:
CRITICAL,DAILY,ARCHIVE - explicit lifecycle states:
ACTIVE,ARCHIVED,GRAVEYARD - contradiction tracking and resolution
- graveyard restore flow instead of destructive deletes
- session bundle loading for agent warm-up
That makes it closer to a durable memory engine than a simple vector wrapper.
Transcript Store vs Durable Memory Engine
| Need | Transcript-first memory | snipara-memory |
|---|---|---|
| Keep the original conversation | Strong | Not the main goal |
| Preserve durable decisions and conventions | Usually ad hoc | First-class |
| Handle conflicting memories over time | Rare | Built-in |
| Archive without hard deletion | Rare | Built-in graveyard |
| Warm up a new coding session | Manual | Session bundle loading |
| Model project memory as typed objects | Limited | Built-in |
If your main problem is "search my old chats", a transcript store is enough. If your main problem is "my coding agent should keep stable project memory", this repository is a better fit.
Why This Exists
Snipara the SaaS product has grown into a larger surface:
- hosted MCP
- reviewed project memory
- automation policies
- team and workspace controls
- analytics and managed infrastructure
That full product is useful, but too heavy if all you want is a local memory engine for agents.
snipara-memory is the smaller open source layer.
Who This Is For
Use snipara-memory if you are building:
- coding agents
- local-first agent tools
- MCP-compatible developer tooling
- persistent session memory
- project memory layers for your own apps
Do not use it if you are looking for:
- a full hosted MCP platform
- a SaaS dashboard for team memory review
- billing, auth, and tenant management
What Is Included
Version 0.1.x includes:
- a standalone domain model for memories, graveyard entries, and contradictions
- a memory service for storage, recall, session loading, compaction, and contradiction resolution
- an in-memory adapter for local runs and tests
- a JSON file store for local persistent usage
- a minimal FastAPI app
- a local MCP wrapper for MCP-compatible clients
- transcript and project-doc import commands
- a reproducible benchmark harness
- a Prisma schema draft for a production persistence adapter
- runnable examples for store, recall, and contradiction resolution
What Is Not Included
This repository does not try to clone Snipara Cloud.
Not included:
- billing and plan gating
- hosted MCP transport
- SaaS auth and project/team UI
- approval workflows and review queue
- managed automation policies
- enterprise admin and analytics
Those remain part of Snipara's commercial hosted product.
Install
Until the first PyPI release is published, install from GitHub:
pip install git+https://github.com/Snipara/snipara-memory.git
Or clone locally:
pip install -e .
For local development:
pip install -e ".[dev]"
Main CLI:
snipara-memory version
Local store path by default:
~/.snipara-memory/store.json
Python Quickstart
import asyncio
from snipara_memory import InMemoryMemoryStore, MemoryService, RecallQuery, StoreMemoryRequest
async def main() -> None:
store = InMemoryMemoryStore()
service = MemoryService(store=store)
await service.store_memory(
StoreMemoryRequest(
namespace_id="demo",
content="JWT auth uses RS256 token pairs and refresh tokens.",
title="Auth convention",
)
)
matches = await service.semantic_recall(
RecallQuery(namespace_id="demo", query="How do we handle JWT auth?")
)
for match in matches:
print(match.score, match.memory.title, match.memory.content)
asyncio.run(main())
Runnable example:
python examples/quickstart.py
Persistent local import:
snipara-memory import-transcript examples/transcript.txt --namespace demo
Run The Local API
The package ships with a minimal API server backed by the local JSON store by default.
snipara-memory serve --host 127.0.0.1 --port 8000
Example requests:
curl http://127.0.0.1:8000/health
curl -X POST http://127.0.0.1:8000/v1/namespaces/demo/memories \
-H "content-type: application/json" \
-d '{
"title": "Auth convention",
"content": "JWT auth uses RS256 token pairs and refresh tokens."
}'
curl -X POST http://127.0.0.1:8000/v1/namespaces/demo/memories/recall \
-H "content-type: application/json" \
-d '{
"query": "How do we handle JWT auth?"
}'
Contradiction example:
python examples/contradiction_flow.py
Run The Local MCP Server
The package also ships with a local MCP stdio wrapper.
snipara-memory mcp
With an explicit store file:
snipara-memory mcp --store-path ./.snipara-memory.json
Current MCP tools:
memory_storememory_recallmemory_session_bundlememory_listmemory_detect_contradictionsmemory_resolve_contradictionmemory_import_transcriptmemory_import_project
See docs/mcp.md.
Import Durable Memory
Transcript import:
snipara-memory import-transcript examples/transcript.txt --namespace demo
Project-doc import:
snipara-memory import-project docs/ --namespace demo
These importers are intentionally conservative. They try to extract durable decisions, preferences, learnings, and todos instead of storing every line.
See docs/importers.md.
Benchmark Harness
Run the reproducible recall harness:
snipara-memory benchmark benchmarks/datasets/basic_recall.jsonl
This is a regression harness, not a headline benchmark claim.
See benchmarks/README.md.
Why Not Just Keep Raw Transcripts?
Raw conversation storage is useful, but it is not enough on its own for durable agent memory.
snipara-memory adds structure on top of stored content:
- typed memories (
FACT,DECISION,LEARNING,PREFERENCE,TODO,CONTEXT) - explicit retrieval tiers
- lifecycle transitions
- contradiction handling
- graveyard snapshots for auditability
If you only need searchable transcript history, a transcript store may be enough. If you need reusable project memory with lifecycle rules, this package is the better fit.
Core Concepts
Namespace: the container for a memory corpusMemory: a durable fact, decision, learning, preference, todo, or context itemTier:CRITICAL,DAILY,ARCHIVEStatus:ACTIVE,ARCHIVED,GRAVEYARDGraveyard: tombstoned or superseded memory snapshots kept for auditabilityContradiction: tracked overlap/conflict between memories before or after resolution
Public API
Main exports:
from snipara_memory import (
InMemoryMemoryStore,
MemoryService,
RecallQuery,
StoreMemoryRequest,
ResolveContradictionRequest,
)
Key operations:
store_memorystore_memories_bulksemantic_recalllist_memoriesget_session_memoriescompact_memoriesdetect_contradictionsresolve_contradictionmove_to_graveyardrestore_from_graveyard
Project Status
snipara-memory is usable today for local experiments and OSS integration work.
Current state:
- domain service: implemented
- in-memory store: implemented
- JSON file store: implemented
- HTTP API: implemented
- MCP wrapper: implemented
- transcript/project import CLI: implemented
- reproducible benchmark harness: implemented
- Prisma/Redis/embeddings production adapters: not published yet
We are intentionally not making benchmark claims yet. The current public value is clarity, inspectability, and a reusable memory lifecycle for coding agents. The benchmark harness is now reproducible from this repository, but it is still positioned as a regression harness rather than a competitive research claim.
Roadmap
Near-term roadmap:
- Prisma-backed persistence adapter
- pluggable embeddings provider packages
- Redis-backed session bundle cache
- richer recall filtering and namespace stats
- larger public benchmark suites
- richer CLI inspection and export flows
More detail: ROADMAP.md
Contributing
Contributions are welcome.
Start here:
Relation To Snipara
Snipara Cloud builds on top of this kind of memory domain and adds:
- hosted MCP surface
- reviewable memory queue
- transcript import
- workspace profiles
- automation policies
- team controls and managed operations
Project site: snipara.com
License
Apache 2.0. See LICENSE.
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 snipara_memory-0.1.0.tar.gz.
File metadata
- Download URL: snipara_memory-0.1.0.tar.gz
- Upload date:
- Size: 34.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990a01141c5473211c9d85e3306ebac01b2da9b91674ac75d87911ead7a17821
|
|
| MD5 |
58f392696d9f9349a36d9dbabb84cdfe
|
|
| BLAKE2b-256 |
f8881a4448d70f8818b5ba7370be0708fa2100ba026f98e71ec4a1140c71ccbd
|
Provenance
The following attestation bundles were made for snipara_memory-0.1.0.tar.gz:
Publisher:
publish.yml on Snipara/snipara-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snipara_memory-0.1.0.tar.gz -
Subject digest:
990a01141c5473211c9d85e3306ebac01b2da9b91674ac75d87911ead7a17821 - Sigstore transparency entry: 1318469190
- Sigstore integration time:
-
Permalink:
Snipara/snipara-memory@414928ff1fef4d395fa8c4dd18083c36f4fddfac -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Snipara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@414928ff1fef4d395fa8c4dd18083c36f4fddfac -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file snipara_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: snipara_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cb71722ff866e919cadb68e5f4d321d764c9ed5ddae14266381a8eaf8643c61
|
|
| MD5 |
2f998804929f4fd7ec3292af5ddaecff
|
|
| BLAKE2b-256 |
840bfe151a6325aaed639316dca7af8f95af4719a14207a1490b5c1b43e14e1e
|
Provenance
The following attestation bundles were made for snipara_memory-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Snipara/snipara-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snipara_memory-0.1.0-py3-none-any.whl -
Subject digest:
1cb71722ff866e919cadb68e5f4d321d764c9ed5ddae14266381a8eaf8643c61 - Sigstore transparency entry: 1318469552
- Sigstore integration time:
-
Permalink:
Snipara/snipara-memory@414928ff1fef4d395fa8c4dd18083c36f4fddfac -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Snipara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@414928ff1fef4d395fa8c4dd18083c36f4fddfac -
Trigger Event:
workflow_dispatch
-
Statement type: