Skip to content

Introduces the zosma-mem package — a tag-based, salience-driven memory system for OpenZosma agent sessions. #81

Merged
arjun-zosma merged 15 commits intozosmaai:mainfrom
Shanvit7:feat/memory-pkg
Apr 13, 2026
Merged

Introduces the zosma-mem package — a tag-based, salience-driven memory system for OpenZosma agent sessions. #81
arjun-zosma merged 15 commits intozosmaai:mainfrom
Shanvit7:feat/memory-pkg

Conversation

@Shanvit7
Copy link
Copy Markdown
Contributor

@Shanvit7 Shanvit7 commented Apr 10, 2026

Summary

Core memory engine

  • Entity store with stable deterministic IDs (SHA-based content hash)
  • Co-access graph for boosting related entities during retrieval
  • Two-pass retrieval: tag overlap + salience scoring, then co-access re-rank
  • Ingestion pipeline for extracting and storing facts from agent turns
  • Salience decay + GC to prune low-value entities over time
  • Reinforcement signals (used / ignored / influenced_decision)

Bridge

  • createMemoryBridge wires the engine to the pi-mono session via a
    loadContext / ingestFacts / recordUsage interface
  • Memory directory scoped per agent config
    (workspace/agents/<agentConfigId>/memory/)

Eval pipeline

  • SQuAD v1.1 validation set used as a benchmark (fetched from HF)
  • Content-based precision metric: scores 1 if retrieved context contains
    the expected answer substring — more honest than ID-based precision for
    a topK retrieval system
  • CLI: zosma-mem-eval run with configurable case count

Baseline scores (100 cases, topK=8)

Metric Value
Recall 72%
Precision 77%*
F1 72%

*ID-based precision ceiling is 1/8 = 12.5% by construction.
Content-based precision (new metric) reflects real usefulness.

Related issue

Checklist

  • pnpm run check passes
  • pnpm run lint passes
  • Tests added or updated (if applicable)
  • Documentation updated (if applicable)

@arjun-zosma arjun-zosma self-requested a review April 13, 2026 09:23
@arjun-zosma arjun-zosma merged commit 2b8be35 into zosmaai:main Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants