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

# RAG CLI

> Command-line interface for RAG operations

# RAG CLI

The `praisonai rag` command group provides full RAG (Retrieval-Augmented Generation) functionality from the command line.

<Card title="Full RAG CLI Documentation" icon="book" href="/docs/rag/cli">
  See the complete RAG CLI reference with all commands, options, and examples.
</Card>

## Quick Reference

| Command               | Description                                    |
| --------------------- | ---------------------------------------------- |
| `praisonai rag index` | Build or update an index from source documents |
| `praisonai rag query` | One-shot question answering with citations     |
| `praisonai rag chat`  | Interactive RAG chat session                   |
| `praisonai rag eval`  | Evaluate RAG retrieval quality                 |
| `praisonai serve rag` | Start RAG as a microservice API                |

## Key Features

* **Hybrid Retrieval**: Use `--hybrid` to combine dense vectors with BM25 keyword search
* **Reranking**: Use `--rerank` to improve result quality
* **OpenAI-Compatible API**: Use `--openai-compat` with `rag serve` for drop-in compatibility
* **Performance Profiling**: Use `--profile` to measure and optimize performance
* **Config Files**: Use `--config` for reproducible setups with YAML configuration

## Common Examples

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Index documents
praisonai rag index ./documents --collection myproject

# Query with hybrid retrieval
praisonai rag query "What are the key findings?" --hybrid --rerank

# Start interactive chat
praisonai rag chat --collection myproject --hybrid

# Start API server with OpenAI compatibility
praisonai serve rag --openai-compat --hybrid --port 8080
```

## Related

* [Knowledge CLI](/docs/cli/knowledge) - Indexing and search without LLM generation
* [RAG Module](/docs/rag/module) - Python API for RAG
* [RAG Quickstart](/docs/rag/quickstart) - Getting started with RAG
