Works with the AI Agents you already use
Long-Term AI Agent Memory Engineer
Architect production-grade long-term memory systems for AI agents with robust schemas, retrieval pipelines, and privacy.
$69.99
Long-Term AI Agent Memory Engineer
Example session with this skill installed
Design a memory system for a personal finance agent that remembers user goals and budget preferences across sessions. We use Node.js, PostgreSQL with pgvector, and LangChain.
- Read your context and instructions
- Compiled the long-term ai agent
I have designed a memory architecture for your finance agent using PostgreSQL and pgvector. This design prioritizes data privacy and fact consistency across user sessions.
Finance Agent Memory Architecture
Memory Taxonomy
| Class | Example | Capture Rule | Retention |
|---|---|---|---|
| Semantic | "User wants to save $500/mo" | Extract on explicit goal setting | Indefinite |
| Episodic | "Reviewed grocery spend on 2024-05-10" | Auto-summarize session | 90 Days |
| Task State | Current budget calculation progress | Save on session pause | Session end |
Data Model (SQL)
CREATE TABLE agent_memories (
memory_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
memory_type VARCHAR(20) CHECK (memory_type IN ('semantic', 'episodic', 'task')),
content TEXT NOT NULL,
embedding VECTOR(1536), -- For OpenAI embeddings
metadata JSONB, -- { "source": "conv_123", "confidence": 0.95 }
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
expires_at TIMESTAMP WITH TIME ZONE,
status VARCHAR(20) DEFAULT 'active' -- active, superseded, deleted
);
CREATE INDEX ON agent_memories USING ivfflat (embedding vector_cosine_ops);
CREATE INDEX ON agent_memories (user_id, status);
Retrieval Strategy
- Filter: Apply
WHERE user_id = ? AND status = 'active'first to ensure isolation.
Hybrid Search: Combine vector similarity search with keyword filters for specific financial entities (e.g., "401k").
3.
Context Packing: Select top 3 semantic goals and top 5 recent episodic summaries to fit within a 2k token context budget.
Next steps
- Implement a LangChain
PostgresChatMessageHistorywrapper using the provided schema. - Define the
extraction_logicto filter out sensitive PII like full account numbers. - Set up a cron job to purge records where
expires_at < NOW().
Connects securely to your tools. The creator never sees your data.
About this skill
Building an AI assistant that actually remembers users is easy. Building one that manages fact conflicts, tenant isolation, and GDPR-compliant deletion at scale is not. This skill prevents the common pitfalls of naive RAG by providing a rigorous engineering framework for persistent agent memory. It moves beyond simple vector search to address the complexities of episodic vs. semantic memory, entity resolution, and data decay.
What it does
- Memory Taxonomy classifies data into episodic, semantic, and procedural layers to optimize retrieval.
- Ingestion Pipelines designs extraction logic with confidence scoring, deduplication, and sensitivity filtering.
- Schema Engineering provides structured data models for SQL, NoSQL, or Graph stores including provenance and TTL.
- Retrieval Orchestration builds multi-stage pipelines covering query rewriting, metadata filtering, and reranking.
- Lifecycle Management defines deterministic rules for handling conflicting facts, supersessions, and user deletion requests.
- Production Readiness audits the architecture for tenant isolation, encryption, and auditability.
How it works
- Requirements Discovery identifies your agent's use case, scale needs, latency targets, and existing tech stack.
- Policy Definition maps out exactly what gets stored, for how long, and under what privacy constraints.
- Architecture Design generates a component blueprint covering capture gateways, storage, and context packing.
- Implementation Planning delivers API contracts, schema examples, and an evaluation suite for testing recall and precision.
Frameworks & tools
This skill is vendor-neutral and works with any stack including LangChain, LlamaIndex, Pinecone, Weaviate, PostgreSQL (pgvector), and MongoDB. It produces implementation-ready SQL, JSON, and Mermaid diagrams.
Why this beats prompting it yourself
General-purpose LLMs often suggest "storing everything in a vector DB," which leads to context window flooding and hallucinations. This skill enforces strict data modeling, tenant boundaries, and conflict resolution rules that generic prompts miss.
Use cases
- Personalizing SaaS assistants based on multi-session user preferences.
- Building agents that remember complex multi-step workflows and procedural history.
- Implementing compliant memory systems with verifiable "right to be forgotten" triggers.
- Scaling agent infrastructure to handle millions of unique user memory profiles.
Known limitations
Does not provision infrastructure or execute database migrations. Requires the developer to provide specific scale and latency requirements for accurate architectural recommendations.
Requires user-provided latency and scale targets for optimization. Does not execute code, provision infrastructure, or perform live database migrations.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Permissions
No special permissions declared or detected