Knowledge Base CLI

CLI commands for knowledge base in PraisonAI TypeScript

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

Diagram

User

CLI

Knowledge Base

Quick Start

  1. Simple Usage
    bash
    praisonai-ts knowledge add document.pdf
  2. With Configuration
    bash
    praisonai-ts knowledge search "query" --json

Add Knowledge

bash
# 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
# Search the knowledge base
praisonai-ts knowledge search "query"

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

List Knowledge

bash
# List all knowledge entries
praisonai-ts knowledge list

SDK Usage

For programmatic knowledge management:

typescript
import { Knowledge } from 'praisonai';

const kb = new Knowledge();

// Add text content
await kb.store('Your document content...', { userId: 'me' });

// Add a file
await kb.add('document.pdf', { userId: 'me' });

// Search
const found = await kb.search('query', { userId: 'me', limit: 5 });
console.log(found.results.map(r => r.text));

For more details, see the Knowledge Base SDK documentation.

Related