Indestructible memory system for any LLM — priority anchors, decay, context packing.
Project description
dwa10-memory
Indestructible memory for Claude. Stop losing context mid-conversation.
pip install dwa10-memory
The problem
Claude forgets everything after ~20 messages. Long conversations lose critical facts. Every new session starts from zero.
The solution
dwa10-memory wraps the Anthropic SDK with a priority-based anchor engine. Important facts survive the entire session — automatically.
from dwa10 import DWASession
session = DWASession() # uses ANTHROPIC_API_KEY env var
session.chat("My name is Sarah and my budget is $5,000")
session.chat("I prefer minimal, modern design")
# ... 40 messages later ...
response = session.chat("What laptop should I buy?")
# Claude STILL knows: Sarah, $5,000, minimal design ✓
How it works
Every message runs a 3-step cycle:
- Pre-call — decay old anchors, score by utility density, inject top-K into context
- Post-call — extract new anchors from response (heuristic NER + patterns)
- Summary check — compress low-priority anchors at message 15 or 70% window usage
Anchor priority classes
| Class | Meaning | Decay |
|---|---|---|
| P0 | Critical — never forget | None |
| P1 | Important — keep active | Slow |
| P2 | Useful — archive when full | Fast |
API
from dwa10 import DWASession, Anchor
# Basic chat
session = DWASession(api_key="sk-...", model="claude-sonnet-4-20250514")
response = session.chat("Hello!")
# Manual anchoring (exact, always remembered)
session.anchor("User is a senior Python developer", class_="P0")
session.anchor("Project deadline: June 2026", class_="P1")
# Memory stats
print(session.memory_stats())
# {'core': 5, 'archival': 2, 'total': 7, 'message_count': 12}
# Export memory (on demand)
session.save("my_session") # writes my_session.json + my_session.md
md = session.export_markdown() # get markdown string
data = session.export_json() # get dict
# Load memory into new session
new_session = DWASession()
new_session.load("my_session") # restores all anchors
What's free vs Pro
| Feature | Free (dwa10-memory) |
Pro (zulfr.com) |
|---|---|---|
| In-session anchor memory | ✅ | ✅ |
| P0/P1/P2 priority classes | ✅ | ✅ |
| Utility-density context packing | ✅ | ✅ |
| Rolling summaries | ✅ | ✅ |
| Manual export/import | ✅ | ✅ |
| LLM-assisted extraction | ❌ | ✅ |
| Cross-session auto-persistence | ❌ | ✅ |
| Multi-agent memory sharing | ❌ | ✅ |
| Dependency graph | ❌ | ✅ |
| Audit logs + team memory | ❌ | ✅ (Corporate) |
Requirements
- Python ≥ 3.9
anthropicSDK ≥ 0.40.0- Anthropic API key
License
Apache 2.0 © 2026 Usman Zafar Ph.D www.zulfr.com
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 dwa10-0.1.0.tar.gz.
File metadata
- Download URL: dwa10-0.1.0.tar.gz
- Upload date:
- Size: 29.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 |
1442146a0c2dd906f9603d662a6f23423e9fc90494ef0401171ff4be360468c5
|
|
| MD5 |
e20030a3cc88fd3510fa968ef84f9286
|
|
| BLAKE2b-256 |
6fd79c749bfcef24383463e5ffa5e59312fa95f964630aebba1a1f10089e2461
|
Provenance
The following attestation bundles were made for dwa10-0.1.0.tar.gz:
Publisher:
publish.yml on usman19zafar/dwa10_memory-0.1.0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dwa10-0.1.0.tar.gz -
Subject digest:
1442146a0c2dd906f9603d662a6f23423e9fc90494ef0401171ff4be360468c5 - Sigstore transparency entry: 1240428237
- Sigstore integration time:
-
Permalink:
usman19zafar/dwa10_memory-0.1.0@07beae57d31407c6573e16c6849d4f8cf7f799e4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/usman19zafar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07beae57d31407c6573e16c6849d4f8cf7f799e4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file dwa10-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dwa10-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.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 |
7d12e4e11e2f1752c780f54294f277ab3bd542e7cbce050dd385cb677647cbb4
|
|
| MD5 |
27c6ef08747a11d8ca14577bdae68cb6
|
|
| BLAKE2b-256 |
89b3ef872ead8f999d41cafd19d38b1d09029d1570e857e976ae06315741e7fa
|
Provenance
The following attestation bundles were made for dwa10-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on usman19zafar/dwa10_memory-0.1.0
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dwa10-0.1.0-py3-none-any.whl -
Subject digest:
7d12e4e11e2f1752c780f54294f277ab3bd542e7cbce050dd385cb677647cbb4 - Sigstore transparency entry: 1240428271
- Sigstore integration time:
-
Permalink:
usman19zafar/dwa10_memory-0.1.0@07beae57d31407c6573e16c6849d4f8cf7f799e4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/usman19zafar
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@07beae57d31407c6573e16c6849d4f8cf7f799e4 -
Trigger Event:
release
-
Statement type: