r2r.toml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. [app]
  2. # app settings are global available like `r2r_config.agent.app`
  3. # project_name = "r2r_default" # optional, can also set with `R2R_PROJECT_NAME` env var
  4. default_max_documents_per_user = 1_000_000
  5. default_max_chunks_per_user = 10_000_000
  6. default_max_collections_per_user = 1_000_000
  7. # Set the default max upload size to 2 GB for local testing
  8. default_max_upload_size = 2147483648 # 2 GB for anything not explicitly listed
  9. # LLM used for internal operations, like deriving conversation names
  10. fast_llm = "openai/gpt-5-nano"
  11. # LLM used for user-facing output, like RAG replies
  12. quality_llm = "openai/gpt-5-mini"
  13. # LLM used for ingesting visual inputs
  14. vlm = "openai/gpt-5"
  15. # LLM used for transcription
  16. audio_lm = "openai/whisper-1"
  17. # Reasoning model, used for `research` agent
  18. reasoning_llm = "openai/o4-mini"
  19. # Planning model, used for `research` agent
  20. planning_llm = "anthropic/claude-3-7-sonnet-20250219"
  21. [app.max_upload_size_by_type]
  22. # Common text-based formats
  23. txt = 2147483648 # 2 GB
  24. md = 2147483648
  25. tsv = 2147483648
  26. csv = 2147483648
  27. xml = 2147483648
  28. html = 2147483648
  29. # Office docs
  30. doc = 2147483648
  31. docx = 2147483648
  32. ppt = 2147483648
  33. pptx = 2147483648
  34. xls = 2147483648
  35. xlsx = 2147483648
  36. odt = 2147483648
  37. # PDFs
  38. pdf = 2147483648
  39. # E-mail
  40. eml = 2147483648
  41. msg = 2147483648
  42. p7s = 2147483648
  43. # Images
  44. bmp = 2147483648
  45. heic = 2147483648
  46. jpeg = 2147483648
  47. jpg = 2147483648
  48. png = 2147483648
  49. tiff = 2147483648
  50. # E-books and other formats
  51. epub = 2147483648
  52. rtf = 2147483648
  53. rst = 2147483648
  54. org = 2147483648
  55. [agent]
  56. rag_agent_static_prompt = "static_rag_agent"
  57. rag_agent_dynamic_prompt = "dynamic_rag_agent"
  58. #tools = ["search_file_knowledge", "content"]
  59. rag_tools = ["search_file_descriptions", "search_file_knowledge", "get_file_content"] # can add "web_search" | "web_scrape"
  60. # The following tools are available to the `research` agent
  61. research_tools = ["rag", "reasoning", "critique", "python_executor"]
  62. # tool_names = ["local_search", "web_search"] # uncomment to enable web search
  63. #tool_names = ["local_search"]
  64. # [agent.generation_config]
  65. # model = "openai/gpt-4o"
  66. [auth]
  67. provider = "r2r"
  68. access_token_lifetime_in_minutes = 6000 # set a very high default value, for easier testing
  69. refresh_token_lifetime_in_days = 7
  70. require_authentication = false
  71. require_email_verification = false
  72. default_admin_email = "xujiawei@cocorobo.cc"
  73. default_admin_password = "usestudio-1"
  74. [completion]
  75. provider = "r2r"
  76. #fast_llm = "openai/gpt-4o-mini"
  77. concurrent_request_limit = 256000
  78. #fast_llm = "openai/gpt-4.1-mini"
  79. request_timeout = 60
  80. [completion.generation_config]
  81. model = "openai/gpt-4.1-mini"
  82. temperature = 0.1
  83. top_p = 1.0
  84. max_tokens_to_sample = 10_240
  85. stream = false
  86. add_generation_kwargs = { }
  87. [crypto]
  88. provider = "bcrypt"
  89. [file]
  90. #provider = "postgres"
  91. provider = "s3"
  92. bucket_name = "r2r"
  93. endpoint_url = "https://r2r.s3.cn-north-1.amazonaws.com.cn"
  94. region_name = "cn-north-1"
  95. aws_access_key_id = "AKIATLPEDU37YCOTNRHY"
  96. aws_secret_access_key = "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"
  97. [database]
  98. provider = "postgres"
  99. default_collection_name = "Default"
  100. default_collection_description = "Your default collection."
  101. # collection_summary_system_prompt = 'default_system'
  102. # collection_summary_task_prompt = 'default_collection_summary'
  103. # KG settings
  104. batch_size = 64
  105. # PostgreSQL tuning settings
  106. [database.postgres_configuration_settings]
  107. checkpoint_completion_target = 0.7
  108. default_statistics_target = 100
  109. effective_io_concurrency = 4
  110. effective_cache_size = 5242880
  111. huge_pages = "try"
  112. maintenance_work_mem = 655360
  113. max_connections = 2560
  114. max_parallel_workers_per_gather = 16
  115. max_parallel_workers = 4
  116. max_parallel_maintenance_workers = 4
  117. max_wal_size = 102400
  118. max_worker_processes = 8
  119. min_wal_size = 80
  120. shared_buffers = 163840
  121. statement_cache_size = 1000
  122. random_page_cost = 1.1
  123. wal_buffers = 2560
  124. work_mem = 409600
  125. # Graph creation settings
  126. [database.graph_creation_settings]
  127. graph_entity_description_prompt = "graph_entity_description"
  128. graph_extraction_prompt = "graph_extraction"
  129. entity_types = []
  130. relation_types = []
  131. automatic_deduplication = false
  132. # Graph enrichment settings
  133. [database.graph_enrichment_settings]
  134. graph_communities_prompt = "graph_communities"
  135. # (Optional) Graph search settings – add fields as needed
  136. [database.graph_search_settings]
  137. # e.g., search_mode = "default"
  138. # Rate limiting settings
  139. [database.limits]
  140. global_per_min = 60
  141. route_per_min = 20
  142. monthly_limit = 10000
  143. # Route-specific limits (empty by default)
  144. [database.route_limits]
  145. # e.g., "/api/search" = { global_per_min = 30, route_per_min = 10, monthly_limit = 5000 }
  146. # User-specific limits (empty by default)
  147. [database.user_limits]
  148. # e.g., "user_uuid_here" = { global_per_min = 20, route_per_min = 5, monthly_limit = 2000 }
  149. [database.maintenance]
  150. vacuum_schedule = "0 3 * * *" # Run at 3:00 AM daily
  151. [embedding]
  152. provider = "litellm"
  153. # For basic applications, use `openai/text-embedding-3-small` with `base_dimension = 512`
  154. # RECOMMENDED - For advanced applications,
  155. # use `openai/text-embedding-3-large` with `base_dimension = 3072` and binary quantization
  156. #base_model = "openai/text-embedding-3-small"
  157. #base_dimension = 512
  158. base_model = "openai/text-embedding-3-large"
  159. #base_model = "/text-embedding-v3"
  160. base_dimension = 256
  161. rerank_model = ""
  162. rerank_url = ""
  163. # rerank_model = "huggingface/mixedbread-ai/mxbai-rerank-large-v1" # reranking model
  164. batch_size = 256
  165. prefixes = {} # Provide prefix overrides here if needed
  166. add_title_as_prefix = false
  167. concurrent_request_limit = 2560
  168. max_retries = 3
  169. initial_backoff = 1.0
  170. max_backoff = 64.0
  171. # Deprecated fields (if still used)
  172. rerank_dimension = 0
  173. rerank_transformer_type = ""
  174. # Vector quantization settings for embeddings
  175. [embedding.quantization_settings]
  176. quantization_type = "FP32"
  177. # (Additional quantization parameters can be added here)
  178. [completion_embedding]
  179. # Generally this should be the same as the embedding config, but advanced users may want to run with a different provider to reduce latency
  180. provider = "litellm"
  181. base_model = "openai/text-embedding-3-large"
  182. #base_model = "dashscope/text-embedding-v3"
  183. base_dimension = 256
  184. batch_size = 128
  185. concurrent_request_limit = 256
  186. [ingestion]
  187. provider = "r2r"
  188. chunking_strategy = "recursive"
  189. chunk_size = 800
  190. chunk_overlap = 400
  191. excluded_parsers = ["mp4"]
  192. max_concurrent_vlm_tasks=200
  193. vlm_ocr_one_page_per_chunk = true
  194. vlm_batch_size=200
  195. # Ingestion-time document summary parameters
  196. # skip_document_summary = False
  197. # document_summary_system_prompt = 'default_system'
  198. # document_summary_task_prompt = 'default_summary'
  199. # chunks_for_document_summary = 128
  200. document_summary_model = "openai/gpt-4.1-mini"
  201. vision_img_model = "openai/gpt-4.1-mini"
  202. vision_pdf_model = "openai/gpt-4.1-mini"
  203. automatic_extraction = false # enable automatic extraction of entities and relations
  204. parser_overrides = {}
  205. # Chunk enrichment settings
  206. [ingestion.chunk_enrichment_settings]
  207. chunk_enrichment_prompt = "chunk_enrichment"
  208. enable_chunk_enrichment = false
  209. n_chunks = 2
  210. # [ingestion.chunk_enrichment_settings]
  211. # enable_chunk_enrichment = false # disabled by default
  212. # n_chunks = 2 # the number of chunks (both preceeding and succeeding) to use in enrichment
  213. # generation_config = { model = "openai/gpt-4.1-mini" }
  214. [ingestion.extra_parsers]
  215. pdf = ["ocr", "zerox"]
  216. #pdf = "ocr"
  217. [ocr]
  218. provider = "mistral"
  219. model = "mistral-ocr-latest"
  220. [orchestration]
  221. #provider = "no"
  222. max_runs = 2048
  223. kg_creation_concurrency_limit = 32
  224. ingestion_concurrency_limit = 16
  225. kg_concurrency_limit = 4
  226. [prompt]
  227. provider = "r2r"
  228. [email]
  229. provider = "console_mock"
  230. [scheduler]
  231. provider = "apscheduler"