Skip to main content

Memory CLI Commands

The praisonai-ts CLI provides commands for managing agent memory.

List Memories

# List all memories
praisonai-ts memory list

# Get JSON output
praisonai-ts memory list --json

Add Memory

# Add a memory entry
praisonai-ts memory add "Important information to remember"

Search Memory

# Search memories
praisonai-ts memory search "query"

# Get JSON output
praisonai-ts memory search "TypeScript" --json

Clear Memory

# Clear all memories
praisonai-ts memory clear

SDK Usage

For programmatic memory management:
import { Memory } from 'praisonai';

const mem = new Memory();

// Add entries
await mem.add('Hello', 'user');
await mem.add('Hi there', 'assistant');

// Search
const results = await mem.search('Hello');

// Get recent
const recent = mem.getRecent(5);

// Build context
const context = mem.buildContext();

// Export
const data = mem.toJSON();
For more details, see the Memory SDK documentation.