🧪 Skills
Agent Memory Persistence
Provide long-term memory persistence for AI agents with SQLite-backed storage, structured metadata, vector embeddings, semantic retrieval, lifecycle manageme...
v0.1.0
Description
name: agent-memory-persistence description: Provide long-term memory persistence for AI agents with SQLite-backed storage, structured metadata, vector embeddings, semantic retrieval, lifecycle management, and queries by user, session, and time.
Agent Memory Persistence
Use this skill when an agent needs durable memory storage across sessions.
What it provides
- SQLite-backed persistence for text, metadata, and embedding vectors
- CRUD operations for memory items
- Semantic retrieval with cosine-similarity vector search
- Memory lifecycle operations including expiration cleanup
- Filters by user, session, type, and time window
Project structure
src/MemoryStore.ts: low-level SQLite storage enginesrc/VectorIndex.ts: vector similarity search over stored embeddingssrc/MemoryManager.ts: high-level API used by agentssrc/types.ts: shared TypeScript contracts
Usage pattern
- Create a
MemoryManagerwith a SQLite path. - Write memories with
content, optionalmetadata, and optionalembedding. - Query memories by session/user or use
searchByVector()for semantic lookup. - Periodically call
cleanupExpired()to delete stale memories.
Notes
- Embeddings are stored as JSON arrays in SQLite.
- Vector search is implemented in TypeScript using cosine similarity, which keeps deployment simple and avoids SQLite extensions.
- If memory volume grows substantially, replace
VectorIndexwith an ANN index or SQLite vector extension while preserving theMemoryManagerAPI.
Reviews (0)
Sign in to write a review.
No reviews yet. Be the first to review!
Comments (0)
No comments yet. Be the first to share your thoughts!