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

# Memory CLI

> CLI commands for memory management in PraisonAI TypeScript

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

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Svc[Memory]

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Svc agent
    class User,CLI tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

```

## Quick Start

**1. Simple Usage**

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

**2. With Configuration**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts memory search "important" --json
```

## 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](https://praison.ai/docs/js/memory.md).

## Related

> [card] [Memory](https://praison.ai/docs/js/memory.md)
>
> Memory overview

> [card] [Sessions](https://praison.ai/docs/js/sessions.md)
>
> Sessions overview


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.