Skip to main content

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:

  1. Pre-call — decay old anchors, score by utility density, inject top-K into context
  2. Post-call — extract new anchors from response (heuristic NER + patterns)
  3. 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
  • anthropic SDK ≥ 0.40.0
  • Anthropic API key

License

Apache 2.0 © 2026 Usman Zafar Ph.D www.zulfr.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dwa10-0.1.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dwa10-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

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

Hashes for dwa10-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1442146a0c2dd906f9603d662a6f23423e9fc90494ef0401171ff4be360468c5
MD5 e20030a3cc88fd3510fa968ef84f9286
BLAKE2b-256 6fd79c749bfcef24383463e5ffa5e59312fa95f964630aebba1a1f10089e2461

See more details on using hashes here.

Provenance

The following attestation bundles were made for dwa10-0.1.0.tar.gz:

Publisher: publish.yml on usman19zafar/dwa10_memory-0.1.0

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for dwa10-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d12e4e11e2f1752c780f54294f277ab3bd542e7cbce050dd385cb677647cbb4
MD5 27c6ef08747a11d8ca14577bdae68cb6
BLAKE2b-256 89b3ef872ead8f999d41cafd19d38b1d09029d1570e857e976ae06315741e7fa

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page