Knowledge CLI Commands
Thepraisonai knowledge command group provides CLI access to knowledge base management.
Commands Overview
Index Command
Add documents to a knowledge base.Arguments
Options
Examples
Exit Codes
Chain commands with
praisonai knowledge index … && … to run the next step only when every source indexes successfully.
Search Command
Search/retrieve from a knowledge base without LLM generation.Arguments
Options
Examples
Output
Results print as a Rich table with#, Score, Source, and Content columns:
search consistently returns No results found. for content you just indexed, the embedding call likely failed silently on an older build. Upgrade to the latest release (PR #2823), where indexing errors exit non-zero and print ✗ Failed to index …. See Troubleshooting.
Result normalisation
The CLI accepts results from all three backend return shapes — a typedSearchResult, a legacy dict with a "results" key, or a plain list. Custom backends don’t have to pick one format; the command normalises them all before display.
See Search Results for the SearchResult shape and how to consume it from Python.
List Command
List available knowledge bases/collections.Options
Example
Scope Identifiers
When to Use Each Scope
Backend Selection
mem0 (Default)
Best for production apps with multi-user support:Chroma
Best for local development:Internal
Lightweight built-in storage:Configuration File
You can provide a YAML configuration file:Environment Variables
Custom embedders configured via
--config knowledge-config.yaml (see Configuration File) take precedence over OPENAI_EMBEDDING_MODEL — the env var is a convenience for the default OpenAI path only.Profiling
Enable profiling to measure performance:- Wall time
- Peak memory usage
- Modules imported
- Top functions by time
Related Commands
praisonai rag query- Answer questions with citationspraisonai chat- Interactive chat with knowledge retrieval

