r2r.toml 8.7 KB

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