Skip to main content

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

praisonai query - Query with Answer and Citations

Query the knowledge base and get a structured answer with citations.

Options

praisonai search picks its mode from the flags you pass:
  • Plain query → web search (OpenAI-style). No LLM synthesis; raw results.
  • Query + any KB flag (--collection/-c, --top-k/-k, --hybrid) → knowledge-base search. Runs against the indexed collection with no LLM synthesis.
For LLM-synthesised answers with citations, use praisonai query (above). praisonai search never calls the LLM — it returns raw web hits or raw retrieval hits depending on the flags.

Options — KB-Retrieval Mode

Passing any of --collection, -c, --top-k, -k, or --hybrid switches praisonai search into KB-retrieval mode. The --flag value and --flag=value forms are both accepted.

Options — Web-Search Mode

With no KB-retrieval flag, praisonai search falls back to a web search (the historical default). Only --max-results / -n is honoured; the KB flags are unavailable in this mode.

Examples

Complete Workflow

Using Config Files

Create a config file retrieval.yaml:
Use with commands:

Performance Profiling

Profile indexing and query performance:

Verbose Mode

Get detailed output for debugging:
Output includes:
  • Collection being queried
  • Retrieval strategy used
  • Number of sources found
  • Relevance scores
  • Elapsed time

Environment Variables

Comparison with Legacy Commands

The unified retrieval commands replace the separate knowledge and rag command families: The legacy commands are still available but marked as deprecated. Use the new unified commands for all new projects.

Next Steps