> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory CLI

> CLI commands for memory management in PraisonAI TypeScript

# Memory CLI Commands

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

## List Memories

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List all memories
praisonai-ts memory list

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

## Add Memory

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Add a memory entry
praisonai-ts memory add "Important information to remember"
```

## Search Memory

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Search memories
praisonai-ts memory search "query"

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

## Clear Memory

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Clear all memories
praisonai-ts memory clear
```

## SDK Usage

For programmatic memory management:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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](/docs/js/memory).
