episodic-memory-algorithms

Design algorithms and data structures for AI agent episodic memory and retrieval.

2|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/curiositech/port-daddy --skill episodic-memory-algorithms
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: episodic-memory-algorithms
Source: https://github.com/curiositech/port-daddy/tree/main/skills/episodic-memory-algorithms
Command: npx skills add https://github.com/curiositech/port-daddy --skill episodic-memory-algorithms

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Agents struggle to remember, retrieve, and forget information reliably over time, which causes inconsistent behavior, hallucinations, token budget waste, and failures to meet compliance or audit requirements. This Skill provides the decision logic and algorithmic tradeoffs needed to build memory systems that balance recall accuracy, latency, storage cost, and token efficiency across short- and long-term horizons.

Core Features & Use Cases

  • Algorithm selection & scaling: Guidance on choosing and tuning HNSW, IVF-PQ, PQ, DiskANN, and distributed indices for different memory volumes and latency targets.
  • Temporal & graph storage: Designs for bi-temporal triple stores and hybrids combining knowledge graphs with vector search for relational and multi-hop queries.
  • Retrieval scoring & forgetting: Adaptive ranking combining relevance, recency, and importance plus decay-based, session-scoped, and never-forget policies and consolidation strategies.
  • Failure modes & quality gates: Detection and mitigation steps for retrieval hallucination, token budget overflow, semantic drift, and knowledge graph explosion.
  • Use Case: Build a personal assistant memory that serves 1M memories with sub-200ms P95 retrieval, bi-temporal auditability, and >50% storage reduction via consolidation.

Quick Start

Design an episodic memory system for a personal assistant that uses HNSW for sub-100ms retrieval, a bi-temporal knowledge graph for fact history, and decay-based forgetting policies for low-importance memories.

Frequently Asked Questions about episodic-memory-algorithms

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

FAQPage Schema
How do I design an episodic memory system for AI agents that scales to millions of records?

Design episodic memory for AI agents by selecting scalable vector search indices like HNSW or IVF-PQ, combining them with bi-temporal knowledge graphs to achieve sub-200ms retrieval and historical auditability across millions of records.

What is the best way to implement forgetting policies in a long-running conversational agent?

Implement forgetting policies in a conversational agent using decay-based curves, session-scoped rules, and never-forget strategies to consolidate low-importance memories, preserving token efficiency and ensuring consistent behavior over time.

How does bi-temporal knowledge graph storage work for agent memory retrieval?

Bi-temporal knowledge graph storage works by tracking both event time and transaction time for facts, enabling multi-hop relational queries and precise historical auditing when retrieving memories for long-running agents.

HNSW vs IVF-PQ: which vector search index should I use for agent memory?

Choose HNSW for sub-100ms low-latency retrieval in smaller memory volumes, and choose IVF-PQ or DiskANN for distributed indices when you need to balance storage cost, recall accuracy, and latency across massive memory datasets.

Why does my AI agent hallucinate or overflow its token budget during memory retrieval?

AI agents hallucinate or overflow token budgets during memory retrieval due to semantic drift and unmanaged knowledge graph explosion, which you mitigate by applying adaptive retrieval scoring and token-aware memory selection.

Can I use adaptive retrieval scoring to rank memories by relevance, recency, and importance?

Yes, you can use adaptive retrieval scoring to rank memories by dynamically combining relevance, recency, and importance, ensuring the agent retrieves the most contextually appropriate information within strict latency targets.