AgentDB Memory Patterns
하는 일
이 스킬은 AgentDB 저장소를 사용해 세션 사이에도 유지되는 메모리를 AI 에이전트에 주는 방법을 보여 줍니다. 챗봇 어시스턴트와 상태를 유지하는 에이전트를 만드는 사람을 위한 것입니다.
사용하는 경우
- ✓챗봇이 이전 대화에서 사용자가 말한 내용을 기억하게 하고 싶을 때.
- ✓여러 세션에 걸쳐 에이전트가 맥락을 유지해야 할 때.
- ✓과거 상호작용에서 패턴을 배우는 어시스턴트를 만들 때.
스킬 링크
https://github.com/ruvnet/RuView/blob/main/.claude/skills/agentdb-memory-patterns/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 어시스턴트가 각 고객의 선호를 다음 대화 때 기억하도록 메모리를 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 AgentDB 데이터베이스를 시작하고, 세션 세부 정보, 장기 메모, 학습된 패턴을 저장합니다. 에이전트는 새 대화에 필요한 맥락을 찾을 때 이것들을 조회합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
AgentDB Memory Patterns
What This Skill Does
Provides memory management patterns for AI agents using AgentDB's persistent storage and ReasoningBank integration. Enables agents to remember conversations, learn from interactions, and maintain context across sessions.
Performance: 150x-12,500x faster than traditional solutions with 100% backward compatibility.
Prerequisites
- Node.js 18+
- AgentDB v1.0.7+ (via agentic-flow or standalone)
- Understanding of agent architectures
Quick Start with CLI
Initialize AgentDB
# Initialize vector database
npx agentdb@latest init ./agents.db
# Or with custom dimensions
npx agentdb@latest init ./agents.db --dimension 768
# Use preset configurations
npx agentdb@latest init ./agents.db --preset large
# In-memory database for testing
npx agentdb@latest init ./memory.db --in-memory
Start MCP Server for Claude Code
# Start MCP server (integrates with Claude Code)
npx agentdb@latest mcp
# Add to Claude Code (one-time setup)
claude mcp add agentdb npx agentdb@latest mcp
Create Learning Plugin
# Interactive plugin wizard
npx agentdb@latest create-plugin
# Use template directly
npx agentdb@latest create-plugin -t decision-transformer -n my-agent
# Available templates:
# - decision-transformer (sequence modeling RL)
# - q-learning (value-based learning)
# - sarsa (on-policy TD learning)
# - actor-critic (policy gradient)
# - curiosity-driven (exploration-based)
Quick Start with API
import { createAgentDBAdapter } from 'agentic-flow/reasoningbank';
// Initialize with default configuration
const adapter = await createAgentDBAdapter({
dbPath: '.agentdb/reasoningbank.db',
enableLearning: true, // Enable learning plugins
enableReasoning: true, // Enable reasoning agents
quantizationType: 'scalar', // binary | scalar | product | none
cacheSize: 1000, // In-memory cache
});
// Store interaction memory
const patternId = await adapter.insertPattern({
id: '',
type: 'pattern',
domain: 'conversation',
pattern_data: JSON.stringify({
embedding: await computeEmbedding('What is the capital of France?'),
pattern: {
user: 'What is the capital of France?',
assistant: 'The capital of France is Paris.',
timestamp: Date.now()
}
}),
confidence: 0.95,
usage_count: 1,
success_count: 1,
created_at: Date.now(),
last_used: Date.now(),
});
// Retrieve context with reasoning
const context = await adapter.retrieveWithReasoning(queryEmbedding, {
domain: 'conversation',
k: 10,
useMMR: true, // Maximal Marginal Relevance
synthesizeContext: true, // Generate rich context
});
Memory Patterns
1. Session Memory
class SessionMemory {
async storeMessage(role: string, content: string) {
return await db.storeMemory({
sessionId: this.sessionId,
role,
content,
timestamp: Date.now()
});
}
async getSessionHistory(limit = 20) {
return await db.query({
filters: { sessionId: this.sessionId },
orderBy: 'timestamp',
limit
});
}
}
2. Long-Term Memory
// Store important facts
await db.storeFact({
category: 'user_preference',
key: 'language',
value: 'English',
confidence: 1.0,
source: 'explicit'
});
// Retrieve facts
const prefs = await db.getFacts({
category: 'user_preference'
});
3. Pattern Learning
// Learn from successful interactions
await db.storePattern({
trigger: 'user_asks_time',
response: 'provide_formatted_time',
success: true,
context: { timezone: 'UTC' }
});
// Apply learned patterns
const pattern = await db.matchPattern(currentContext);
Advanced Patterns
Hierarchical Memory
// Organize memory in hierarchy
await memory.organize({
immediate: recentMessages, // Last 10 messages
shortTerm: sessionContext, // Current session
longTerm: importantFacts, // Persistent facts
semantic: embeddedKnowledge // Vector search
});
Memory Consolidation
// Periodically consolidate memories
await memory.consolidate({
strategy: 'importance', // Keep important memories
maxSize: 10000, // Size limit
minScore: 0.5 // Relevance threshold
});
CLI Operations
Query Database
# Query with vector embedding
npx agentdb@latest query ./agents.db "[0.1,0.2,0.3,...]"
# Top-k
자주 묻는 질문
메모리는 어디에 저장되나요?
AgentDB 데이터베이스 파일에 저장됩니다. 테스트용 메모리 내 옵션도 있습니다.
Claude Code에 연결할 수 있나요?
네. 스킬은 AgentDB MCP 서버를 시작하고 Claude Code에 추가하는 방법을 보여 줍니다.
시작하기 전에 무엇이 필요한가요?
Node.js 18 이상과 AgentDB 1.0.7 이상 버전입니다.
상세 정보
작성자의 원본 설명
Implement persistent memory patterns for AI agents using AgentDB. Includes session memory, long-term storage, pattern learning, and context management. Use when building stateful agents, chat systems, or intelligent assistants.
repo: ruvnet/RuView
인기도
- GitHub 스타
- 102k
- 순위
- #825
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
AgentDB Advanced Features
102k여러 컴퓨터 간 데이터베이스 동기화, 벡터 검색과 메타데이터 필터 결합 같은 AgentDB 고급 기능을 에이전트에게 보여 줍니다.
AgentDB Learning Plugins
102k과거 경험을 바탕으로 개선되는 강화 학습 방법을 사용해, AgentDB용 학습 플러그인을 만들고 훈련하도록 에이전트를 돕습니다.
AgentDB Performance Optimization
102k압축, 빠른 검색 인덱스, 캐싱을 사용해 AgentDB 검색 속도를 높이고 메모리 사용을 줄이는 방법을 에이전트에게 보여 줍니다.
AgentDB Vector Search
102k정확한 단어가 아니라 의미로 문서를 검색하도록 에이전트를 돕습니다. 질의응답과 지식 베이스에 알맞습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.