# Optimizing Documents for RAG Indexing

**Retrieval Augmented Generation (RAG)** combines the power of **Natural Language Processing (NLP)** with the capabilities of **Large Language Models (LLMs)** to let applications understand natural speech and learn from ingested knowledge.

Even with the best LLM, the model is unlikely to be trained or optimized for your specific use case. Tog get the gest results, you you need to refine your inputs before documents are processed. You will still benefit from NLP and document chunking but some upfront preparation is required.

This section covers everything you need to know about document optimization:

* [When to Optimize Documents](/aisera-platform/adding-data-to-your-tenant/data-ingestion/optimizing-documents-for-rag-indexing/when-to-optimize-documents.md): How to identify when poor RAG results are a content problem and when to act on it.
* [How to Optimize Documents](/aisera-platform/adding-data-to-your-tenant/data-ingestion/optimizing-documents-for-rag-indexing/how-to-optimize-documents.md): Recommendations for structuring and preparing your documents before ingestion.
* [Re-indexing and Testing After Optimization](/aisera-platform/adding-data-to-your-tenant/data-ingestion/optimizing-documents-for-rag-indexing/re-indexing-and-testing-after-optimization.md): How to re-ingest your optimized documents and validate the results.
* [Document Optimization Examples](/aisera-platform/adding-data-to-your-tenant/data-ingestion/optimizing-documents-for-rag-indexing/examples-of-document-optimization.md): Real-world examples showing how optimization strategies apply across different content types.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aisera.com/aisera-platform/adding-data-to-your-tenant/data-ingestion/optimizing-documents-for-rag-indexing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
