typed-memory

Implements a four-store typed memory system with a promotion gate governing durable memory writes.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/lakshya4568/DeepContext --skill typed-memory-lakshya4568
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typed-memory
Source: https://github.com/lakshya4568/DeepContext/tree/main/.agents/skills/typed-memory
Command: npx skills add https://github.com/lakshya4568/DeepContext --skill typed-memory-lakshya4568

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Long-running agents need persistent memory, but an undisciplined write path turns memory into noise: overconfident facts, inferred preferences from a single signal, and silent contradictions. This Skill enforces a promotion gate so every write into durable memory is classified, scoped, deduplicated, confidence-scored, and TTL-assigned before it lands. ## Core Features & Use Cases - Four Typed Stores: Separates policy, preference, semantic fact, and episodic summary into distinct tables with distinct retrieval and write rules, plus an append-only events trace for audit. - Promotion Gate: A reference pipeline (classify, scope-check, extract atomic claim, resolve contradictions, assign confidence and TTL) that all writes to memory_fact and memory_preference must pass through. - Contradiction Resolution & TTL: Supersedes old facts instead of deleting them, lowers confidence on ambiguous conflicts, and forces real expiry dates on hedged or speculative observations. - Use Case: A user says "I might use MongoDB for this prototype." Instead of storing "User uses MongoDB" permanently, the gate stores "User is evaluating MongoDB" with confidence 0.55 and a 30-day TTL. ## Quick Start Use the typed-memory skill to evaluate this conversation observation and decide whether it should be promoted into durable memory, with what confidence and TTL.

Frequently Asked Questions about typed-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add long-term memory to an AI agent?

Use typed memory stores rather than one vector table: separate policy, preference, semantic fact, and episodic summary tables with distinct retrieval patterns. Route every write through a promotion gate that classifies the observation, checks scope, extracts the atomic claim, and assigns confidence and TTL before persisting.

How do I prevent an agent from storing wrong facts from conversations?

Gate every memory write through a promotion pipeline that detects hedging language and caps confidence accordingly. Hedged statements like "might" or "probably" get a real TTL instead of permanent storage, and contradictions are resolved by superseding old rows rather than silently overwriting them.

When should inferred user preferences be saved to memory?

Inferred preferences require at least two corroborating observations before promotion; a single signal is staged or stored as a low-confidence fact instead. Explicitly stated preferences can be written immediately with source marked as explicit.

How do I handle contradictory facts in agent memory?

Compare the new claim against existing memory for the same scope, then supersede the lower-confidence row by setting its superseded_by field rather than deleting it. When confidence is genuinely ambiguous, lower both confidences and log the resolution to an append-only events trace for audit.

What are the limitations of the promotion gate reference implementation?

The classification, claim extraction, and contradiction detection steps are heuristic stubs marked for replacement with real LLM and semantic-similarity calls in production. The naive keyword-overlap contradiction check should not be shipped as-is, and a real Postgres client must be wired in for persistence.