본문으로 건너뛰기
Skillpedia
에이전트102k · #825

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/ruvnet/RuView/blob/main/.claude/skills/agentdb-memory-patterns/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬