Learn how to configure and manage prompts in your R2R deployment
py/core/providers/prompts/defaults
directory. These default prompts provide a starting point for various tasks within the R2R system.
For example, the default RAG (Retrieval-Augmented Generation) prompt is defined as follows:
Prompt File | Purpose |
---|---|
default_rag.yaml | Default prompt for Retrieval-Augmented Generation (RAG) tasks. It instructs the model to answer queries based on provided context, using line item references. |
few_shot_ner_kg_extraction.yaml | Used for few-shot Named Entity Recognition (NER) and Knowledge Graph (KG) extraction. It provides examples to guide the model in identifying entities and relationships. |
few_shot_ner_kg_extraction_with_spec.yaml | Similar to the above, but includes a specific schema or specification for the extraction process. |
graphrag_community_reports.yaml | Used in GraphRAG to generate reports about communities or clusters in the knowledge graph. |
graphrag_map_system_prompt.yaml | System prompt for the “map” phase in GraphRAG, used to process individual nodes or edges. |
graphrag_reduce_system_prompt.yaml | System prompt for the “reduce” phase in GraphRAG, used to combine or summarize information from multiple sources. |
graphrag_triples_extraction_few_shot.yaml | Few-shot prompt for extracting subject-predicate-object triplets in GraphRAG, with examples. |
graphrag_triples_extraction_few_shot.yaml | Zero-shot prompt for extracting subject-predicate-object triplets in GraphRAG, without examples. |
hyde.yaml | Related to Hypothetical Document Embeddings (HyDE) for improving retrieval performance. |
kg_search.yaml | Used for searching the knowledge graph, possibly to formulate queries or interpret results. |
kg_search_with_spec.yaml | Similar to kg_search.yaml , but with a specific schema or specification for the search process. |
rag_agent.yaml | Defines the behavior and instructions for the RAG agent, which coordinates the retrieval and generation process. |
rag_context.yaml | Used to process or format the context retrieved for RAG tasks. |
rag_fusion.yaml | Used in RAG fusion techniques, possibly for combining information from multiple retrieved passages. |
system.yaml | Contains general system-level prompts or instructions for the R2R system. |
zero_shot_ner_kg_extraction.yaml | Used for zero-shot Named Entity Recognition and Knowledge Graph extraction, without providing examples. |
zero_shot_ner_kg_extraction_with_spec.yaml | Similar to the above, but includes a specific schema or specification for the extraction process. |
R2RPromptProvider
class to manage prompts. This provider handles the storage, retrieval, and manipulation of prompts, leveraging both a PostgreSQL database and YAML files for flexibility and persistence.
Key features of the R2RPromptProvider
: