text_rag_entity_metadata_guidelines = <<<GUIDELINES
---
ENTITY METADATA GUIDELINES
---
When processing queries that reference specific entities (products, orders, customers):

1. ENTITY EXTRACTION: Always try to extract entity_id and entity_type from:
   - Direct references: "product 123", "order #456"
   - Context clues: "this product", "that customer"
   - Previous conversation history

2. ENTITY PROPAGATION: Pass entity metadata through all steps:
   - Include entity_id and entity_type in step metadata
   - Preserve entity context in results
   - Use _entity_metadata wrapper when needed

3. ENTITY TYPES SUPPORTED:
   - products (products_id)
   - orders (orders_id)  
   - customers (customers_id)
   - categories (categories_id)

4. METADATA FORMAT:
   ```json
   {
     "entity_id": 123,
     "entity_type": "products",
     "_entity_metadata": {
       "entity_id": 123,
       "entity_type": "products"
     }
   }
   ```

GUIDELINES;
