> ## 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.

# Knowledge Base CLI

> CLI commands for knowledge base in PraisonAI TypeScript

# Knowledge Base CLI Commands

The `praisonai-ts` CLI provides commands for managing knowledge bases.

## Add Knowledge

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Add a document
praisonai-ts knowledge add document.pdf

# Add text content
praisonai-ts knowledge add "Your text content here"

# Add from URL
praisonai-ts knowledge add https://example.com/article
```

## Search Knowledge

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Search the knowledge base
praisonai-ts knowledge search "query"

# Get JSON output
praisonai-ts knowledge search "query" --json
```

## List Knowledge

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

## SDK Usage

For programmatic knowledge management:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { KnowledgeBase } from 'praisonai';

const kb = new KnowledgeBase({
  embeddings: 'openai/text-embedding-3-small'
});

// Add content
await kb.add({ content: 'Your document content...' });

// Search
const results = await kb.search('query', { topK: 5 });
```

For more details, see the [Knowledge Base SDK documentation](/docs/js/knowledge-base).
