🧠
pai AI & Intelligence
ai-memory
Persistent agent memory for PascalAI. Save and load memory entries, search by semantic similarity, forget old memories, and summarize conversation history.
Install ppm install ai-memory
Usage Example
uses ai_memory; // Save a memory entry SaveMemory(ctx, 'user_preference', 'dark_mode'); SaveMemory(ctx, 'last_topic', 'machine learning'); // Load a specific memory var pref := LoadMemory(ctx, 'user_preference'); // 'dark_mode' // Semantic search across memories var results := SearchMemory(ctx, 'what does the user prefer?'); for r in results do WriteLn(r.Key + ': ' + r.Value); // Forget a specific memory ForgetMemory(ctx, 'last_topic'); // Summarize conversation history var summary := SummarizeHistory(ctx, last := 20); WriteLn(summary);
Features
SaveMemory: persist key-value memories scoped to an agent context
LoadMemory: retrieve a specific memory by key
SearchMemory: semantic similarity search over all memories
ForgetMemory: delete a specific memory entry
ForgetAll: clear all memories for a context
SummarizeHistory: LLM-powered conversation summarization
Persistent across agent restarts
← Back to Package Index