Overview
The retrieval CLI provides unified commands for indexing documents and querying knowledge bases. These commands are Agent-first and use the same retrieval pipeline as the Python SDK.Commands
praisonai index - Index Documents
Index documents into a knowledge base for later retrieval.
Options
| Option | Description | Default |
|---|---|---|
--collection, -c | Collection/knowledge base name | default |
--config, -f | Config file path (YAML) | None |
--verbose, -v | Verbose output | False |
--profile | Enable performance profiling | False |
--profile-out | Save profile to JSON file | None |
--profile-top | Top N items in profile | 20 |
praisonai query - Query with Answer and Citations
Query the knowledge base and get a structured answer with citations.
Options
| Option | Description | Default |
|---|---|---|
--collection, -c | Collection to query | default |
--top-k, -k | Number of results to retrieve | 5 |
--min-score | Minimum relevance score (0.0-1.0) | 0.0 |
--hybrid | Use hybrid retrieval (dense + keyword) | False |
--rerank | Enable reranking of results | False |
--citations/--no-citations | Include citations | True |
--citations-mode | Citations mode: append, inline, hidden | append |
--max-context-tokens | Maximum context tokens | 4000 |
--config, -f | Config file path | None |
--verbose, -v | Verbose output | False |
--profile | Enable performance profiling | False |
praisonai search - Search Without LLM
Search the knowledge base and return raw results without LLM generation.
Options
| Option | Description | Default |
|---|---|---|
--collection, -c | Collection to search | default |
--top-k, -k | Number of results to retrieve | 5 |
--hybrid | Use hybrid retrieval | False |
--config, -f | Config file path | None |
--verbose, -v | Verbose output | False |
Examples
Complete Workflow
Using Config Files
Create a config fileretrieval.yaml:
Performance Profiling
Profile indexing and query performance:Verbose Mode
Get detailed output for debugging:- Collection being queried
- Retrieval strategy used
- Number of sources found
- Relevance scores
- Elapsed time
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY | OpenAI API key for embeddings and generation |
ANTHROPIC_API_KEY | Anthropic API key (if using Claude) |
Comparison with Legacy Commands
The unified retrieval commands replace the separateknowledge and rag command families:
| Legacy | New Unified |
|---|---|
praisonai knowledge add | praisonai index |
praisonai rag query | praisonai query |
praisonai knowledge search | praisonai search |
Next Steps
- Agent Retrieval (Python) - Use retrieval in Python code
- Knowledge Concepts - Learn about knowledge bases
- CLI Reference - Full CLI documentation

