agent-memory
Implement memory systems for AI agents — short-term context, long-term vector storage, episodic memory, and knowledge graphs. Use when: "add memory to agent", "agent memory", "RAG for agents", "persistent context", "knowledge base", or when agents forget things.
- License 许可
- MIT
- 所属仓库
- kalash33/kstack
- 最近更新
- 2026-05-20
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- agent-memory
- description
- Implement memory systems for AI agents — short-term context, long-term vector storage, episodic memory, and knowledge graphs. Use when: "add memory to agent", "agent memory", "RAG for agents", "persistent context", "knowledge base", or when agents forget things.
03 SKILL.md 正文
/agent-memory — Memory Systems
Agents without memory start from zero every time. Fix that.
When to Use
- Agent keeps forgetting context between sessions
- Need to store and retrieve knowledge
- Building RAG pipelines for agents
- Implementing learning from past interactions
Memory Types
Short-term (Context Window)
- Last N messages in conversation
- Current task state
- Implementation: Simple buffer, sliding window
Long-term (Vector Store)
- Documents, code, past conversations
- Semantic search for relevant context
- Implementation: ChromaDB, Pinecone, pgvector, Qdrant
Episodic (What Happened)
- Key decisions and their outcomes
- Successful/failed approaches
- Implementation: Structured logs with embeddings
Graph (Relationships)
- Entity relationships (user → project → feature)
- Dependency maps
- Implementation: Neo4j, NetworkX, or simple adjacency lists
Implementation Patterns
Pattern 1: RAG Memory
# Store
chunks = split_document(doc, chunk_size=512)
embeddings = embed(chunks)
vector_store.upsert(chunks, embeddings)
# Retrieve
query_embedding = embed(user_query)
relevant = vector_store.search(query_embedding, top_k=5)
context = "\n".join(relevant)
Pattern 2: Conversation Summary
# When context window fills up
summary = llm.summarize(old_messages)
memory = [system_msg, summary_msg] + recent_messages[-5:]
Pattern 3: Tool-Result Cache
# Cache expensive tool calls
cache_key = hash(tool_name + str(args))
if cache_key in memory:
return memory[cache_key]
result = tool.run(args)
memory[cache_key] = result
Chaining
- Before:
/agent-design(decides what memory is needed) - After:
/agent-eval(tests retrieval quality)
04 同仓库更多 Skills
zustand-store-ts
Create Zustand stores with TypeScript, subscribeWithSelector middleware, and proper state/action separation. Use when building React state management, creating global stores, or implementing reacti...
zoom-automation
Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.
zoho-crm-automation
Automate Zoho CRM tasks via Rube MCP (Composio): create/update records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.
zod-validation-expert
Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.
zeroize-audit
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.
zendesk-automation
Automate Zendesk tasks via Rube MCP (Composio): tickets, users, organizations, replies. Always search tools first for current schemas.