agentic-graphrag 0.0.4__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. agentic_graphrag-0.0.6/PKG-INFO +319 -0
  2. agentic_graphrag-0.0.6/README.md +251 -0
  3. agentic_graphrag-0.0.6/agrag/agents/__init__.py +36 -0
  4. agentic_graphrag-0.0.6/agrag/agents/build.py +427 -0
  5. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/ledger.py +2 -18
  6. agentic_graphrag-0.0.6/agrag/agents/middleware.py +265 -0
  7. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/model.py +8 -6
  8. agentic_graphrag-0.0.6/agrag/agents/prompts.py +27 -0
  9. agentic_graphrag-0.0.6/agrag/agents/result.py +45 -0
  10. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/settings.py +9 -10
  11. agentic_graphrag-0.0.6/agrag/agents/tools/__init__.py +1 -0
  12. agentic_graphrag-0.0.6/agrag/agents/tools/core.py +544 -0
  13. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/tracing.py +2 -3
  14. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/verification.py +11 -13
  15. agentic_graphrag-0.0.6/agrag/candidates/__init__.py +36 -0
  16. agentic_graphrag-0.0.6/agrag/candidates/errors.py +12 -0
  17. agentic_graphrag-0.0.6/agrag/candidates/patch.py +281 -0
  18. agentic_graphrag-0.0.6/agrag/candidates/review.py +445 -0
  19. agentic_graphrag-0.0.6/agrag/candidates/search.py +41 -0
  20. agentic_graphrag-0.0.6/agrag/chunking/__init__.py +22 -0
  21. agentic_graphrag-0.0.6/agrag/chunking/_edge_orders.py +31 -0
  22. agentic_graphrag-0.0.6/agrag/chunking/_tables.py +42 -0
  23. agentic_graphrag-0.0.6/agrag/chunking/chunker.py +469 -0
  24. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/__init__.py +22 -5
  25. agentic_graphrag-0.0.6/agrag/common/data_models/agent_answer.py +27 -0
  26. agentic_graphrag-0.0.6/agrag/common/data_models/candidate.py +171 -0
  27. agentic_graphrag-0.0.6/agrag/common/data_models/candidate_review.py +214 -0
  28. agentic_graphrag-0.0.6/agrag/common/data_models/chunk.py +182 -0
  29. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/community.py +6 -6
  30. agentic_graphrag-0.0.6/agrag/common/data_models/cutover_job.py +18 -0
  31. agentic_graphrag-0.0.6/agrag/common/data_models/decision.py +358 -0
  32. agentic_graphrag-0.0.6/agrag/common/data_models/default_schema.py +123 -0
  33. agentic_graphrag-0.0.6/agrag/common/data_models/document.py +416 -0
  34. agentic_graphrag-0.0.6/agrag/common/data_models/dropped.py +69 -0
  35. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/entity.py +36 -24
  36. agentic_graphrag-0.0.6/agrag/common/data_models/entity_search.py +197 -0
  37. agentic_graphrag-0.0.6/agrag/common/data_models/evidence.py +449 -0
  38. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/extraction.py +24 -8
  39. agentic_graphrag-0.0.6/agrag/common/data_models/graph_record.py +180 -0
  40. agentic_graphrag-0.0.6/agrag/common/data_models/graph_schema.py +620 -0
  41. agentic_graphrag-0.0.6/agrag/common/data_models/memory_result.py +43 -0
  42. agentic_graphrag-0.0.6/agrag/common/data_models/navigation.py +112 -0
  43. agentic_graphrag-0.0.6/agrag/common/data_models/presets.py +100 -0
  44. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/provenance.py +27 -1
  45. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/resolved_entity.py +2 -2
  46. agentic_graphrag-0.0.6/agrag/common/data_models/retention.py +23 -0
  47. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/search_result.py +2 -7
  48. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/stage_failure.py +3 -3
  49. agentic_graphrag-0.0.6/agrag/common/data_models/structure.py +241 -0
  50. agentic_graphrag-0.0.6/agrag/common/data_models/task.py +325 -0
  51. agentic_graphrag-0.0.6/agrag/common/data_models/update_decision.py +19 -0
  52. agentic_graphrag-0.0.6/agrag/common/data_models/vector_record.py +38 -0
  53. agentic_graphrag-0.0.6/agrag/common/fingerprint.py +19 -0
  54. agentic_graphrag-0.0.6/agrag/common/graph_rows.py +43 -0
  55. agentic_graphrag-0.0.6/agrag/common/schema_fingerprint.py +228 -0
  56. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/validation.py +13 -58
  57. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/_pending_filter.py +23 -0
  58. agentic_graphrag-0.0.6/agrag/cypher/candidate_conversion.py +185 -0
  59. agentic_graphrag-0.0.6/agrag/cypher/candidate_review.py +145 -0
  60. agentic_graphrag-0.0.6/agrag/cypher/candidate_search.py +42 -0
  61. agentic_graphrag-0.0.6/agrag/cypher/candidates.py +163 -0
  62. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/community_read.py +14 -1
  63. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/cutover_job_read.py +12 -9
  64. agentic_graphrag-0.0.6/agrag/cypher/cutover_job_write.py +459 -0
  65. agentic_graphrag-0.0.6/agrag/cypher/documents.py +332 -0
  66. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/entities.py +193 -140
  67. agentic_graphrag-0.0.6/agrag/cypher/evidence.py +474 -0
  68. agentic_graphrag-0.0.6/agrag/cypher/memory.py +423 -0
  69. agentic_graphrag-0.0.6/agrag/cypher/memory_review.py +178 -0
  70. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/relations.py +259 -119
  71. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/resolution_read.py +53 -34
  72. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/resolution_write.py +28 -58
  73. agentic_graphrag-0.0.6/agrag/cypher/retention.py +136 -0
  74. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/schema.py +144 -23
  75. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/embedding/__init__.py +8 -11
  76. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/embedding/base.py +7 -7
  77. agentic_graphrag-0.0.6/agrag/embedding/fastembed_dense.py +208 -0
  78. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/embedding/sentence_transformers.py +38 -32
  79. agentic_graphrag-0.0.6/agrag/embedding/settings.py +38 -0
  80. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/__init__.py +0 -6
  81. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/answer.py +33 -56
  82. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/extraction.py +4 -2
  83. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/resolution.py +4 -2
  84. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/settings.py +6 -8
  85. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/trajectory.py +18 -97
  86. agentic_graphrag-0.0.6/agrag/evidence/__init__.py +25 -0
  87. agentic_graphrag-0.0.6/agrag/evidence/_shared.py +285 -0
  88. agentic_graphrag-0.0.6/agrag/evidence/citation.py +146 -0
  89. agentic_graphrag-0.0.6/agrag/evidence/discover.py +335 -0
  90. agentic_graphrag-0.0.6/agrag/evidence/entities.py +648 -0
  91. agentic_graphrag-0.0.6/agrag/evidence/fetch.py +246 -0
  92. agentic_graphrag-0.0.6/agrag/evidence/ids.py +89 -0
  93. agentic_graphrag-0.0.6/agrag/evidence/navigate.py +380 -0
  94. agentic_graphrag-0.0.6/agrag/evidence/render.py +119 -0
  95. agentic_graphrag-0.0.6/agrag/evidence/source_status.py +111 -0
  96. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/graphdb/base.py +123 -25
  97. agentic_graphrag-0.0.6/agrag/graphdb/entities.py +61 -0
  98. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/graphdb/errors.py +10 -12
  99. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/graphdb/neo4j.py +336 -74
  100. agentic_graphrag-0.0.6/agrag/graphdb/serialize.py +189 -0
  101. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/__init__.py +8 -2
  102. agentic_graphrag-0.0.6/agrag/ingestion/_candidate_conversion.py +506 -0
  103. agentic_graphrag-0.0.6/agrag/ingestion/_candidate_stage.py +232 -0
  104. agentic_graphrag-0.0.6/agrag/ingestion/_cutover.py +662 -0
  105. agentic_graphrag-0.0.6/agrag/ingestion/_deferred.py +127 -0
  106. agentic_graphrag-0.0.6/agrag/ingestion/_document_lifecycle.py +215 -0
  107. agentic_graphrag-0.0.6/agrag/ingestion/_escalation.py +363 -0
  108. agentic_graphrag-0.0.6/agrag/ingestion/_gliner_decode.py +341 -0
  109. agentic_graphrag-0.0.6/agrag/ingestion/_ingest.py +1243 -0
  110. agentic_graphrag-0.0.6/agrag/ingestion/_ingest_pipeline.py +1089 -0
  111. agentic_graphrag-0.0.6/agrag/ingestion/_job_cleanup.py +184 -0
  112. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/_lexical_backbone.py +20 -49
  113. agentic_graphrag-0.0.6/agrag/ingestion/_mentions.py +88 -0
  114. agentic_graphrag-0.0.6/agrag/ingestion/_merge_stage.py +559 -0
  115. agentic_graphrag-0.0.6/agrag/ingestion/_pending_rows.py +114 -0
  116. agentic_graphrag-0.0.6/agrag/ingestion/_resolution_maintenance.py +507 -0
  117. agentic_graphrag-0.0.6/agrag/ingestion/_resolve_stage.py +87 -0
  118. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/_resume.py +77 -77
  119. agentic_graphrag-0.0.6/agrag/ingestion/_stage_context.py +32 -0
  120. agentic_graphrag-0.0.6/agrag/ingestion/_storage.py +509 -0
  121. agentic_graphrag-0.0.6/agrag/ingestion/_structure.py +320 -0
  122. agentic_graphrag-0.0.6/agrag/ingestion/_walk.py +135 -0
  123. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/community.py +187 -70
  124. agentic_graphrag-0.0.6/agrag/ingestion/extract.py +1048 -0
  125. agentic_graphrag-0.0.6/agrag/ingestion/graph.py +1024 -0
  126. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/merge.py +111 -290
  127. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/reports/__init__.py +4 -0
  128. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/reports/add_result.py +7 -27
  129. agentic_graphrag-0.0.6/agrag/ingestion/reports/consolidation_report.py +38 -0
  130. agentic_graphrag-0.0.6/agrag/ingestion/reports/conversion_report.py +25 -0
  131. agentic_graphrag-0.0.6/agrag/ingestion/reports/escalation_report.py +87 -0
  132. agentic_graphrag-0.0.6/agrag/ingestion/reports/reevaluation_report.py +41 -0
  133. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/reports/update_result.py +5 -2
  134. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/__init__.py +16 -2
  135. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/batch_validation.py +9 -6
  136. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/candidate_source.py +97 -89
  137. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/exact_groups.py +1 -1
  138. agentic_graphrag-0.0.6/agrag/ingestion/resolve/resolution.py +632 -0
  139. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/resolver.py +148 -84
  140. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/zone_classifier.py +11 -35
  141. agentic_graphrag-0.0.6/agrag/ingestion/resolved_embeddings.py +155 -0
  142. agentic_graphrag-0.0.4/agrag/ingestion/materialize.py → agentic_graphrag-0.0.6/agrag/ingestion/resolved_entities.py +268 -123
  143. agentic_graphrag-0.0.6/agrag/ingestion/settings.py +129 -0
  144. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/stats/__init__.py +3 -2
  145. agentic_graphrag-0.0.6/agrag/ingestion/stats/chunking.py +53 -0
  146. agentic_graphrag-0.0.6/agrag/ingestion/stats/dropped.py +18 -0
  147. agentic_graphrag-0.0.6/agrag/ingestion/stats/extraction.py +39 -0
  148. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/stats/ingest.py +1 -0
  149. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/stats/merge.py +9 -6
  150. agentic_graphrag-0.0.6/agrag/ingestion/stats/resolution.py +32 -0
  151. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/async_client.py +9 -50
  152. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/inlinedbaml.py +1 -2
  153. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/parser.py +0 -12
  154. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/stream_types.py +9 -6
  155. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/sync_client.py +9 -49
  156. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/type_builder.py +99 -34
  157. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/type_map.py +3 -0
  158. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/types.py +9 -6
  159. agentic_graphrag-0.0.6/agrag/llm/baml_src/extraction.baml +78 -0
  160. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/client_config.py +10 -5
  161. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/client_registry.py +9 -2
  162. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/retry.py +49 -10
  163. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/loaders/__init__.py +14 -18
  164. {agentic_graphrag-0.0.4/agrag/loaders/corpus → agentic_graphrag-0.0.6/agrag/loaders}/base.py +24 -6
  165. {agentic_graphrag-0.0.4/agrag/loaders/corpus/readers → agentic_graphrag-0.0.6/agrag/loaders}/chat.py +28 -23
  166. agentic_graphrag-0.0.4/agrag/loaders/corpus/readers/_common.py → agentic_graphrag-0.0.6/agrag/loaders/common.py +112 -38
  167. {agentic_graphrag-0.0.4/agrag/loaders/corpus → agentic_graphrag-0.0.6/agrag/loaders}/decode.py +3 -4
  168. agentic_graphrag-0.0.6/agrag/loaders/defaults.py +37 -0
  169. agentic_graphrag-0.0.6/agrag/loaders/docling/__init__.py +10 -0
  170. agentic_graphrag-0.0.6/agrag/loaders/docling/_converters.py +96 -0
  171. agentic_graphrag-0.0.6/agrag/loaders/docling/_sections.py +292 -0
  172. agentic_graphrag-0.0.6/agrag/loaders/docling/loader.py +187 -0
  173. {agentic_graphrag-0.0.4/agrag/loaders/corpus → agentic_graphrag-0.0.6/agrag/loaders}/errors.py +3 -5
  174. agentic_graphrag-0.0.6/agrag/loaders/loader_registry.py +64 -0
  175. agentic_graphrag-0.0.6/agrag/loaders/prose.py +111 -0
  176. {agentic_graphrag-0.0.4/agrag/loaders/corpus/readers → agentic_graphrag-0.0.6/agrag/loaders}/records.py +37 -21
  177. {agentic_graphrag-0.0.4/agrag/loaders/corpus → agentic_graphrag-0.0.6/agrag/loaders}/types.py +23 -16
  178. agentic_graphrag-0.0.4/agrag/loaders/corpus/_walk.py → agentic_graphrag-0.0.6/agrag/loaders/walk.py +39 -22
  179. agentic_graphrag-0.0.6/agrag/mcp_server/__init__.py +41 -0
  180. agentic_graphrag-0.0.6/agrag/mcp_server/__main__.py +54 -0
  181. agentic_graphrag-0.0.6/agrag/mcp_server/errors.py +16 -0
  182. agentic_graphrag-0.0.6/agrag/mcp_server/read_tools.py +289 -0
  183. agentic_graphrag-0.0.6/agrag/mcp_server/results.py +50 -0
  184. agentic_graphrag-0.0.6/agrag/mcp_server/server.py +459 -0
  185. agentic_graphrag-0.0.6/agrag/mcp_server/settings.py +82 -0
  186. agentic_graphrag-0.0.6/agrag/mcp_server/write_tools.py +279 -0
  187. agentic_graphrag-0.0.6/agrag/memory/__init__.py +7 -0
  188. agentic_graphrag-0.0.6/agrag/memory/decisions.py +1104 -0
  189. agentic_graphrag-0.0.6/agrag/memory/retention.py +223 -0
  190. agentic_graphrag-0.0.6/agrag/memory/tasks.py +874 -0
  191. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/__init__.py +0 -4
  192. agentic_graphrag-0.0.6/agrag/retrieval/chunking.py +69 -0
  193. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/community_context.py +10 -22
  194. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/filters.py +2 -22
  195. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/fusion.py +10 -13
  196. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/methods/traversal.py +8 -12
  197. agentic_graphrag-0.0.6/agrag/retrieval/methods/vector.py +95 -0
  198. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/recipes.py +0 -1
  199. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/rerank/cross_encoder.py +0 -1
  200. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/rerank/node_distance.py +2 -8
  201. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/resolved_entities.py +13 -25
  202. agentic_graphrag-0.0.6/agrag/retrieval/retrievers/__init__.py +1 -0
  203. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/retrievers/base.py +1 -1
  204. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/retrievers/bfs.py +5 -21
  205. agentic_graphrag-0.0.6/agrag/retrieval/retrievers/chunk.py +130 -0
  206. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/retrievers/community.py +22 -27
  207. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/retrievers/entity.py +90 -147
  208. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/search_engine.py +51 -51
  209. agentic_graphrag-0.0.6/agrag/retrieval/settings.py +56 -0
  210. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/tracing.py +0 -33
  211. agentic_graphrag-0.0.6/agrag/schema/__init__.py +14 -0
  212. agentic_graphrag-0.0.6/agrag/schema/canonical.py +64 -0
  213. agentic_graphrag-0.0.6/agrag/schema/errors.py +67 -0
  214. agentic_graphrag-0.0.6/agrag/schema/formats/__init__.py +26 -0
  215. agentic_graphrag-0.0.6/agrag/schema/formats/_iri.py +90 -0
  216. agentic_graphrag-0.0.6/agrag/schema/formats/dispatch.py +56 -0
  217. agentic_graphrag-0.0.6/agrag/schema/formats/errors.py +18 -0
  218. agentic_graphrag-0.0.6/agrag/schema/formats/json_schema.py +207 -0
  219. agentic_graphrag-0.0.6/agrag/schema/formats/jsonld.py +149 -0
  220. agentic_graphrag-0.0.6/agrag/schema/formats/owl.py +812 -0
  221. agentic_graphrag-0.0.6/agrag/schema/formats/pydantic_models.py +297 -0
  222. agentic_graphrag-0.0.6/agrag/schema/formats/result.py +38 -0
  223. agentic_graphrag-0.0.6/agrag/schema/formats/shacl.py +223 -0
  224. agentic_graphrag-0.0.6/agrag/schema/loader.py +780 -0
  225. agentic_graphrag-0.0.6/agrag/schema/shorthand.py +608 -0
  226. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/pyproject.toml +56 -24
  227. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/pyproject.toml.orig +60 -18
  228. agentic_graphrag-0.0.4/PKG-INFO +0 -418
  229. agentic_graphrag-0.0.4/README.md +0 -344
  230. agentic_graphrag-0.0.4/agrag/agents/__init__.py +0 -19
  231. agentic_graphrag-0.0.4/agrag/agents/build.py +0 -276
  232. agentic_graphrag-0.0.4/agrag/agents/middleware.py +0 -289
  233. agentic_graphrag-0.0.4/agrag/agents/prompts.py +0 -91
  234. agentic_graphrag-0.0.4/agrag/agents/result.py +0 -21
  235. agentic_graphrag-0.0.4/agrag/agents/subagents.py +0 -79
  236. agentic_graphrag-0.0.4/agrag/agents/tools/__init__.py +0 -91
  237. agentic_graphrag-0.0.4/agrag/agents/tools/aggregate.py +0 -66
  238. agentic_graphrag-0.0.4/agrag/agents/tools/search.py +0 -465
  239. agentic_graphrag-0.0.4/agrag/agents/tools/traversal.py +0 -333
  240. agentic_graphrag-0.0.4/agrag/chunking/__init__.py +0 -38
  241. agentic_graphrag-0.0.4/agrag/chunking/_docling_adapters.py +0 -69
  242. agentic_graphrag-0.0.4/agrag/chunking/_text.py +0 -159
  243. agentic_graphrag-0.0.4/agrag/chunking/base.py +0 -239
  244. agentic_graphrag-0.0.4/agrag/chunking/docling.py +0 -200
  245. agentic_graphrag-0.0.4/agrag/chunking/extras.py +0 -182
  246. agentic_graphrag-0.0.4/agrag/chunking/heading.py +0 -137
  247. agentic_graphrag-0.0.4/agrag/chunking/parent_child.py +0 -105
  248. agentic_graphrag-0.0.4/agrag/chunking/recursive.py +0 -72
  249. agentic_graphrag-0.0.4/agrag/chunking/rules.py +0 -119
  250. agentic_graphrag-0.0.4/agrag/chunking/sentence.py +0 -51
  251. agentic_graphrag-0.0.4/agrag/chunking/token.py +0 -49
  252. agentic_graphrag-0.0.4/agrag/chunking/turns.py +0 -115
  253. agentic_graphrag-0.0.4/agrag/common/data_models/chunk.py +0 -189
  254. agentic_graphrag-0.0.4/agrag/common/data_models/cutover_job.py +0 -63
  255. agentic_graphrag-0.0.4/agrag/common/data_models/document.py +0 -317
  256. agentic_graphrag-0.0.4/agrag/common/data_models/graph_record.py +0 -148
  257. agentic_graphrag-0.0.4/agrag/common/data_models/graph_schema.py +0 -183
  258. agentic_graphrag-0.0.4/agrag/common/data_models/query_value.py +0 -13
  259. agentic_graphrag-0.0.4/agrag/common/data_models/vector_record.py +0 -74
  260. agentic_graphrag-0.0.4/agrag/cypher/cutover_job_write.py +0 -319
  261. agentic_graphrag-0.0.4/agrag/cypher/safety.py +0 -141
  262. agentic_graphrag-0.0.4/agrag/embedding/fastembed_bm25.py +0 -162
  263. agentic_graphrag-0.0.4/agrag/embedding/settings.py +0 -35
  264. agentic_graphrag-0.0.4/agrag/embedding/sparse_base.py +0 -53
  265. agentic_graphrag-0.0.4/agrag/graphdb/serialize.py +0 -227
  266. agentic_graphrag-0.0.4/agrag/ingestion/_cutover.py +0 -482
  267. agentic_graphrag-0.0.4/agrag/ingestion/_document_lifecycle.py +0 -115
  268. agentic_graphrag-0.0.4/agrag/ingestion/_ingest_pipeline.py +0 -1690
  269. agentic_graphrag-0.0.4/agrag/ingestion/extract.py +0 -834
  270. agentic_graphrag-0.0.4/agrag/ingestion/graph.py +0 -2079
  271. agentic_graphrag-0.0.4/agrag/ingestion/reports/consolidation_report.py +0 -26
  272. agentic_graphrag-0.0.4/agrag/ingestion/reports/reevaluation_report.py +0 -28
  273. agentic_graphrag-0.0.4/agrag/ingestion/resolved_embeddings.py +0 -418
  274. agentic_graphrag-0.0.4/agrag/ingestion/settings.py +0 -24
  275. agentic_graphrag-0.0.4/agrag/ingestion/stats/chunking.py +0 -77
  276. agentic_graphrag-0.0.4/agrag/ingestion/stats/extraction.py +0 -27
  277. agentic_graphrag-0.0.4/agrag/ingestion/stats/resolution.py +0 -22
  278. agentic_graphrag-0.0.4/agrag/llm/baml_src/extraction.baml +0 -74
  279. agentic_graphrag-0.0.4/agrag/llm/baml_src/retrieval.baml +0 -31
  280. agentic_graphrag-0.0.4/agrag/loaders/corpus/__init__.py +0 -41
  281. agentic_graphrag-0.0.4/agrag/loaders/corpus/readers/html.py +0 -64
  282. agentic_graphrag-0.0.4/agrag/loaders/corpus/readers/prose.py +0 -220
  283. agentic_graphrag-0.0.4/agrag/loaders/corpus/registry.py +0 -104
  284. agentic_graphrag-0.0.4/agrag/loaders/docling/__init__.py +0 -34
  285. agentic_graphrag-0.0.4/agrag/loaders/docling/loader.py +0 -139
  286. agentic_graphrag-0.0.4/agrag/retrieval/identity.py +0 -98
  287. agentic_graphrag-0.0.4/agrag/retrieval/methods/vector.py +0 -131
  288. agentic_graphrag-0.0.4/agrag/retrieval/retrievers/__init__.py +0 -1
  289. agentic_graphrag-0.0.4/agrag/retrieval/retrievers/chunk.py +0 -252
  290. agentic_graphrag-0.0.4/agrag/retrieval/retrievers/text2cypher.py +0 -737
  291. agentic_graphrag-0.0.4/agrag/retrieval/settings.py +0 -86
  292. agentic_graphrag-0.0.4/agrag/vectordb/__init__.py +0 -85
  293. agentic_graphrag-0.0.4/agrag/vectordb/base.py +0 -252
  294. agentic_graphrag-0.0.4/agrag/vectordb/errors.py +0 -44
  295. agentic_graphrag-0.0.4/agrag/vectordb/milvus.py +0 -933
  296. agentic_graphrag-0.0.4/agrag/vectordb/qdrant.py +0 -869
  297. agentic_graphrag-0.0.4/agrag/vectordb/settings.py +0 -136
  298. agentic_graphrag-0.0.4/agrag/vectordb/weaviate.py +0 -691
  299. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/LICENSE +0 -0
  300. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/__init__.py +0 -0
  301. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/errors.py +0 -0
  302. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/agents/harness.py +0 -0
  303. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/__init__.py +0 -0
  304. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/data_point.py +0 -0
  305. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/normalization.py +0 -0
  306. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/data_models/relation.py +0 -0
  307. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/common/text.py +0 -0
  308. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/__init__.py +0 -0
  309. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/cypher/community_write.py +0 -0
  310. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/embedding/errors.py +0 -0
  311. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/adapter.py +0 -0
  312. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/judge.py +0 -0
  313. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/eval/verifier.py +0 -0
  314. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/graphdb/__init__.py +0 -0
  315. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/graphdb/settings.py +0 -0
  316. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/_clustering.py +0 -0
  317. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/reports/community_detection_report.py +0 -0
  318. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/resolve/comparators.py +0 -0
  319. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/ingestion/stats/storage.py +0 -0
  320. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/__init__.py +0 -0
  321. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/config.py +0 -0
  322. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/globals.py +0 -0
  323. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/runtime.py +0 -0
  324. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/tracing.py +0 -0
  325. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_client/watchers.py +0 -0
  326. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_src/community.baml +0 -0
  327. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_src/generators.baml +0 -0
  328. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_src/merge.baml +0 -0
  329. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/baml_src/resolution.baml +0 -0
  330. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/llm/tracing.py +0 -0
  331. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/observability.py +0 -0
  332. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/py.typed +0 -0
  333. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/errors.py +0 -0
  334. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/methods/__init__.py +0 -0
  335. {agentic_graphrag-0.0.4 → agentic_graphrag-0.0.6}/agrag/retrieval/rerank/__init__.py +0 -0
@@ -0,0 +1,319 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-graphrag
3
+ Version: 0.0.6
4
+ Summary: Context graphs that give AI agents memory they can trace to its sources.
5
+ Keywords: agent-memory,context-graph,knowledge-graph,graphrag,ai-agents,mcp,neo4j,provenance
6
+ Author: Ashwin Mathur, Varun Mathur
7
+ Author-email: Ashwin Mathur <ashwinm400@gmail.com>, Varun Mathur <varunm500@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
12
+ Requires-Dist: pydantic>=2.0
13
+ Requires-Dist: pydantic-settings>=2.0
14
+ Requires-Dist: python-dotenv>=1.0
15
+ Requires-Dist: chonkie>=1.7
16
+ Requires-Dist: opentelemetry-api>=1.20
17
+ Requires-Dist: openinference-semantic-conventions
18
+ Requires-Dist: charset-normalizer>=3.4
19
+ Requires-Dist: selectolax>=0.3.21,<1
20
+ Requires-Dist: docling-slim[convert-core,format-markdown,format-html,format-docx,format-pptx,format-xlsx]>=2.135
21
+ Requires-Dist: rapidfuzz>=3.0
22
+ Requires-Dist: scipy>=1.14
23
+ Requires-Dist: fastembed>=0.8.0
24
+ Requires-Dist: jsonschema>=4.0
25
+ Requires-Dist: pyyaml>=6.0
26
+ Requires-Dist: langgraph>=1.2 ; extra == 'agents'
27
+ Requires-Dist: deepagents>=0.7.15 ; extra == 'agents'
28
+ Requires-Dist: langchain-openai>=1.0 ; extra == 'agents'
29
+ Requires-Dist: graspologic-native>=1.2.5 ; extra == 'community'
30
+ Requires-Dist: docling>=2.135 ; extra == 'docling'
31
+ Requires-Dist: sentence-transformers>=5 ; extra == 'embed-local'
32
+ Requires-Dist: deepeval>=4.2.6 ; extra == 'eval'
33
+ Requires-Dist: agentevals>=0.0.9 ; extra == 'eval'
34
+ Requires-Dist: er-evaluation>=2.3.0 ; extra == 'eval'
35
+ Requires-Dist: scikit-learn>=1.5 ; extra == 'eval'
36
+ Requires-Dist: langchain-openai>=1.0 ; extra == 'eval'
37
+ Requires-Dist: opentelemetry-sdk>=1.20 ; extra == 'eval'
38
+ Requires-Dist: openinference-instrumentation-langchain>=0.1.76,<0.2 ; extra == 'eval'
39
+ Requires-Dist: gliner2[local] ; extra == 'extract'
40
+ Requires-Dist: transformers<4.56 ; extra == 'extract'
41
+ Requires-Dist: protobuf ; extra == 'extract'
42
+ Requires-Dist: baml-py>=0.226.1,<0.227 ; extra == 'llm'
43
+ Requires-Dist: mcp>=2.3,<3 ; extra == 'mcp'
44
+ Requires-Dist: neo4j>=5.22 ; extra == 'neo4j'
45
+ Requires-Dist: opentelemetry-sdk>=1.20 ; extra == 'observability'
46
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20 ; extra == 'observability'
47
+ Requires-Dist: opentelemetry-instrumentation-asyncio ; extra == 'observability'
48
+ Requires-Dist: openinference-instrumentation-langchain>=0.1.76,<0.2 ; extra == 'observability'
49
+ Requires-Dist: rdflib>=7.1 ; extra == 'schema-formats'
50
+ Maintainer: Ashwin Mathur, Varun Mathur
51
+ Maintainer-email: Ashwin Mathur <ashwinm400@gmail.com>, Varun Mathur <varunm500@gmail.com>
52
+ Requires-Python: >=3.11
53
+ Project-URL: Documentation, https://ontogr.github.io/agentic-graphrag/
54
+ Project-URL: Issues, https://github.com/ontogr/agentic-graphrag/issues
55
+ Project-URL: Source, https://github.com/ontogr/agentic-graphrag
56
+ Provides-Extra: agents
57
+ Provides-Extra: community
58
+ Provides-Extra: docling
59
+ Provides-Extra: embed-local
60
+ Provides-Extra: eval
61
+ Provides-Extra: extract
62
+ Provides-Extra: llm
63
+ Provides-Extra: mcp
64
+ Provides-Extra: neo4j
65
+ Provides-Extra: observability
66
+ Provides-Extra: schema-formats
67
+ Description-Content-Type: text/markdown
68
+
69
+ <h1 align="center"><a href="https://github.com/ontogr/agentic-graphrag">Agentic GraphRAG</a></h1>
70
+
71
+ <h3 align="center">Context graphs that give AI agents memory they can trace to its sources.</h3>
72
+ <h4 align="center"><a href="https://ontogr.github.io/agentic-graphrag/">Documentation</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/get-started/quickstart">Quickstart</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/concepts/architecture">Concepts</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/guides/ingest-documents">Guides</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/api/">API reference</a></h4>
73
+
74
+
75
+ <div align="center">
76
+
77
+ [![PyPI](https://img.shields.io/pypi/v/agentic-graphrag.svg)](https://pypi.org/project/agentic-graphrag/)
78
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://pypi.org/project/agentic-graphrag/)
79
+ [![Downloads](https://static.pepy.tech/badge/agentic-graphrag)](https://pepy.tech/project/agentic-graphrag)
80
+ [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?logo=readthedocs)](https://ontogr.github.io/agentic-graphrag/)
81
+ [![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ontogr/agentic-graphrag)
82
+ [![License](https://img.shields.io/github/license/ontogr/agentic-graphrag?color=green)](https://github.com/ontogr/agentic-graphrag/blob/main/LICENSE)
83
+
84
+ </div>
85
+
86
+ <div align="center">
87
+
88
+ [![CI](https://img.shields.io/github/actions/workflow/status/ontogr/agentic-graphrag/ci.yml?branch=main&label=CI&logo=githubactions)](https://github.com/ontogr/agentic-graphrag/actions/workflows/ci.yml)
89
+ [![Integration tests](https://img.shields.io/github/actions/workflow/status/ontogr/agentic-graphrag/integration.yml?branch=main&label=integration%20tests&logo=pytest)](https://github.com/ontogr/agentic-graphrag/actions/workflows/integration.yml)
90
+ [![Codecov](https://codecov.io/gh/ontogr/agentic-graphrag/branch/main/graph/badge.svg)](https://codecov.io/gh/ontogr/agentic-graphrag)
91
+
92
+ </div>
93
+
94
+ Agentic GraphRAG is an open source Python framework that connects your documents, agent activity, and decisions in one graph. Your agents can find evidence, continue work across sessions, and revisit decisions when their sources change.
95
+
96
+ Turn documents into searchable knowledge shaped by your own schema. Give agents tools to follow relationships, read source passages, and cite what they use. Keep decisions linked to the evidence behind them. Use the Python library, connect your agent through MCP, or start with the built-in agent.
97
+
98
+ For example, a contract-review agent can record a recommendation with passages from a contract and a policy. A later session retrieves the task and its decision. When the policy changes, the decision is flagged for review against the new evidence.
99
+
100
+ ## Features
101
+
102
+ ### One graph for documents, tasks, and decisions
103
+
104
+ Documents, agent work, and decisions live together, so every answer can be traced back to its source.
105
+
106
+ <p align="center">
107
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/graph3d.png" alt="Three stacked graph layers. Enterprise knowledge holds documents, sections, chunks and entities. Conversation history holds tasks, events and steps. Decision traces point up to the passages and events they rely on." width="860">
108
+ </p>
109
+
110
+ - **Three connected layers.** The first layer holds your documents, with their sections, tables, and passages, and the people, organizations, products, and other entities found in them. The second holds named tasks, the steps agents take, and a log of what happened. The third holds the decisions agents make.
111
+ - **Every passage knows where it came from.** A passage records its document, its place in the document's structure, and the exact version it came from, with page positions for PDFs.
112
+ - **Relations can point to their evidence.** A relation links to the passages that support it when evidence exists, and a decision links to the text it was based on.
113
+ - **Old citations keep working.** The graph keeps the history of each document, so a citation to an older version still leads to the text that was cited.
114
+
115
+ ### Build the graph around your own schema
116
+
117
+ You decide which things matter, and the graph is built around them.
118
+
119
+ <p align="center">
120
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/schema-pipeline.png" alt="Extraction reads each chunk with a local model, sends uncertain chunks to an LLM, and checks the result against your schema. Entities and relationships outside the schema are saved for review. Resolution then compares entities in steps, from cheap checks to an LLM, and stores each match as a link." width="860">
121
+ </p>
122
+
123
+ - **Describe your own entities and relations.** Name the kinds of things that matter to you, such as people, contracts, or products, and the relations between them. Write the schema in code or in a configuration file, or start from a ready-made preset and extend it.
124
+ - **Extraction runs on your machine first.** You can build a graph without an LLM. When the local model is unsure about a passage, an LLM can read it, and you decide how much of each batch the LLM may read.
125
+ - **Nothing outside your schema is lost.** Anything the models find that your schema does not cover is saved for review. Approved items become part of your schema and your graph.
126
+ - **Duplicates are merged with care.** Agentic GraphRAG recognizes that "Acme Corp" and "Acme Corporation" are the same company. It starts with cheap checks and asks an LLM only about the pairs that remain unclear.
127
+ - **Every match can be undone.** A match is stored as a link between two entities, so the originals stay in the graph. You can preview a cleanup of the whole graph before you apply it.
128
+
129
+ ### Search your documents and read the evidence
130
+
131
+ Agents find passages, read the exact text, and move around a document the way a person would.
132
+
133
+ <p align="center">
134
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/search-evidence.png" alt="A query runs full-text, semantic, or hybrid search over the chunks of the documents you allow. Hits carry evidence ids, and a fetch returns the exact passage text with a citation. Optional steps navigate the document tree, search entities, and explore relationships." width="860">
135
+ </p>
136
+
137
+ - **Full-text, semantic, and hybrid search.** Full-text search matches keywords, semantic search compares embeddings, and hybrid search fuses both rankings with reciprocal rank fusion. A search returns short previews, each with an evidence id for its passage, and a separate step fetches the exact text.
138
+ - **You set the boundary outside the model.** You decide which documents an agent may read, and the model can only work inside that choice.
139
+ - **Source text stays findable.** Search reads the passages directly, so a passage is still found when extraction missed the fact it contains.
140
+ - **Move around a passage.** From any passage, an agent can reach the surrounding section, the neighboring passages, or the rows around a table cell, which keep their column headers.
141
+ - **Follow entities back to text.** An agent can look up an entity, see the passages that mention it, and follow its relations a few steps out. Each relation is marked as backed by a passage or as a connection without direct text.
142
+ - **Incomplete results say so.** Every result states when something was cut off or part of the search failed, so an incomplete result is never mistaken for an empty one.
143
+
144
+ ### Remember tasks and decisions
145
+
146
+ The memory layer records an agent's work and decisions as it runs, keeps them current when sources change, and recalls them to inform later decisions.
147
+
148
+ <p align="center">
149
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/task-resume.png" alt="The agent records events, steps, and decisions in the memory layer as it works. A decision cites passages, events, and earlier decisions. When a cited document changes, the decision is flagged for review. The agent recalls the task and searches past decisions to inform new ones." width="860">
150
+ </p>
151
+
152
+ - **Work is recorded as it happens.** The built-in agent saves each message, tool call, and tool result as a task event, and it tracks progress as steps. Repeating a write after a failure never records it twice.
153
+ - **Decisions are saved as traces.** A decision records a conclusion, the reasoning, the assumptions, and the open questions, along with the passages, events, or earlier decisions it relies on.
154
+ - **Source changes flag decisions.** When a document behind a decision is updated or removed, the decision is flagged for review, and so are the decisions that depend on it.
155
+ - **Reviews end in a clear action.** A reviewer can reaffirm a decision after reading the current text, or replace it with a new one that explains the change. The earlier version stays in the history.
156
+ - **Tasks resume with the full picture.** When a task resumes, the agent sees the goal, the progress so far, and the decisions already made, including any that need review. It reuses finished work that is still valid, and a step that was interrupted is marked as unknown so that it can be run again.
157
+ - **Past decisions inform new ones.** Agents can search earlier decisions in the same project. The built-in agent's search leaves out decisions that need review, and the agent cannot cite one as support.
158
+
159
+ ### Use the built-in agent or any MCP client
160
+
161
+ Use the agent that ships with the library, or connect your own through MCP.
162
+
163
+ <p align="center">
164
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/full-flow.png" alt="Documents are loaded, chunked, extracted, and resolved into a graph with three layers: enterprise knowledge, conversation history, and decision traces. A changed document flags the decisions that cite it. An agent searches and reads the graph and records its events, steps, and decisions. Its answer passes a citation check and returns with numbered sources." width="860">
165
+ </p>
166
+
167
+ - **Answers cite numbered sources.** The built-in agent searches your documents, reads passages, and answers with numbered sources.
168
+ - **Every citation is checked.** The passage must have been read during that run, it must belong to the documents the agent may use, and it must match the version cited. If a citation fails the check, the agent gets one chance to fix it.
169
+ - **Every run ends with a status.** The status tells you whether the agent answered, found too little evidence, or reached a limit. You set how many steps and tool calls a run may use.
170
+ - **Choose your model.** Use Anthropic, OpenAI, Google, or any OpenAI-compatible model, with fallback between them.
171
+ - **The same tools work through MCP.** A local MCP server gives other agents the same tools. It starts read-only and shows only the documents you choose, and you decide whether a client may record tasks and decisions.
172
+ - **Trace and evaluate your runs.** Runs can be traced with OpenTelemetry, and the evaluation tools score answers, citations, and agent runs on your own questions.
173
+
174
+ See the [features page](https://ontogr.github.io/agentic-graphrag/stable/get-started/features) for the complete list, including supported file formats, chunking, keeping the graph current as documents change, and community summaries.
175
+
176
+ ## Quickstart
177
+
178
+ In this example you add one document, ask a question about it, and get an answer with numbered sources. You need Python 3.11 or newer, a running Neo4j database, and an OpenAI-compatible LLM endpoint. See the [quickstart guide](https://ontogr.github.io/agentic-graphrag/stable/get-started/quickstart) for starting Neo4j with Docker or Neo4j Aura.
179
+
180
+ ### 1. Install
181
+
182
+ Install the package from PyPI into a fresh virtual environment:
183
+
184
+ ```bash
185
+ uv venv
186
+ source .venv/bin/activate
187
+ uv pip install "agentic-graphrag[neo4j,extract,agents]" --torch-backend=auto
188
+ ```
189
+
190
+ See [Installation](https://ontogr.github.io/agentic-graphrag/stable/get-started/installation) for other package managers and the optional parts you can add.
191
+
192
+ ### 2. Add your settings
193
+
194
+ Create a file named `.env` in the folder where you will run the example. Replace the values with your own, and keep the file out of version control.
195
+
196
+ ```dotenv
197
+ NEO4J_URI=bolt://localhost:7687
198
+ NEO4J_USERNAME=neo4j
199
+ NEO4J_PASSWORD=your-neo4j-password
200
+ AGENT_LLM_BASE_URL=https://your-endpoint.example.com/v1
201
+ AGENT_LLM_API_KEY=your-api-key
202
+ AGENT_LLM_MODEL_ID=your-model-id
203
+ ```
204
+
205
+ The last three lines are the address, key, and model of your OpenAI-compatible LLM endpoint. For a Neo4j database on another machine, see [Configuration](https://ontogr.github.io/agentic-graphrag/stable/reference/configuration).
206
+
207
+ ### 3. Run the example
208
+
209
+ Put any Markdown or text file in the same folder and name it `your-document.md`. Save the following as `example.py` and run `python example.py`.
210
+
211
+ ```python
212
+ import asyncio
213
+ from pathlib import Path
214
+
215
+ from agrag.agents import AgentLLMSettings, build_agent
216
+ from agrag.embedding import build_embedder
217
+ from agrag.graphdb import build_graph_store
218
+ from agrag.ingestion import ExtractionSettings, Graph
219
+
220
+ # Any Markdown or text file you have.
221
+ DOCUMENT = Path("your-document.md").resolve()
222
+
223
+
224
+ async def main() -> None:
225
+ # Connect to the database and load the model that turns text into vectors.
226
+ store = build_graph_store("neo4j")
227
+ embedder = build_embedder("ibm-granite/granite-embedding-small-english-r2")
228
+ try:
229
+ # Read the document into the graph. This step runs on your machine.
230
+ graph = await Graph.open(
231
+ schema="operations",
232
+ graph_store=store,
233
+ embedder=embedder,
234
+ extraction_settings=ExtractionSettings(mode="gliner"),
235
+ max_llm_pairs=0,
236
+ )
237
+ await graph.add(DOCUMENT)
238
+
239
+ # Create an agent that may read only this document.
240
+ agent = build_agent(
241
+ graph_store=store,
242
+ embedder=embedder,
243
+ scope=frozenset({str(DOCUMENT)}),
244
+ project_id="my-project",
245
+ agent_id="researcher",
246
+ llm_settings=AgentLLMSettings.from_openai_compatible_env(),
247
+ )
248
+
249
+ # Ask a question about the document.
250
+ result = await agent.ainvoke({
251
+ "task_name": "first-question",
252
+ "question": "What are the main points of this document? Cite your sources.",
253
+ })
254
+ print(result["answer"])
255
+ finally:
256
+ await store.close()
257
+
258
+
259
+ asyncio.run(main())
260
+ ```
261
+
262
+ The script prints an answer that ends with a numbered list of sources. Run it again with the same task name and the agent continues where it stopped.
263
+
264
+ ### Next steps
265
+
266
+ - See [Record decisions and review them](https://ontogr.github.io/agentic-graphrag/stable/guides/connected-memory) for tying a decision to its evidence and reviewing it when a document changes.
267
+ - See [Find and cite evidence](https://ontogr.github.io/agentic-graphrag/stable/guides/find-and-cite-evidence) for searching passages and checking citations from your own code.
268
+ - See the [features page](https://ontogr.github.io/agentic-graphrag/stable/get-started/features) for everything else Agentic GraphRAG does.
269
+
270
+ ## Use MCP
271
+
272
+ Run `agrag-mcp` to give any MCP client tools that search your documents, read exact passages, check citations, and keep task and decision memory.
273
+
274
+ Install the server in the same virtual environment as before:
275
+
276
+ ```bash
277
+ uv pip install "agentic-graphrag[neo4j,mcp]"
278
+ ```
279
+
280
+ Then add the server to your MCP client. Replace the document path with the full path of a file you added to the graph.
281
+
282
+ ```json
283
+ {
284
+ "mcpServers": {
285
+ "agrag": {
286
+ "command": "agrag-mcp",
287
+ "env": {
288
+ "NEO4J_URI": "bolt://localhost:7687",
289
+ "NEO4J_USERNAME": "neo4j",
290
+ "NEO4J_PASSWORD": "your-neo4j-password",
291
+ "AGRAG_MCP_SCOPE_DOCUMENT_KEYS": "/full/path/to/your-document.md",
292
+ "AGRAG_MCP_PROJECT_ID": "my-project",
293
+ "AGRAG_MCP_AGENT_ID": "researcher"
294
+ }
295
+ }
296
+ }
297
+ }
298
+ ```
299
+
300
+ If your client cannot find `agrag-mcp`, use its full path inside the virtual environment, for example `/full/path/to/.venv/bin/agrag-mcp`. The server starts read-only and reads only the documents you list. The project and agent IDs enable task and decision memory tools; writes remain disabled until you change the server settings. See the [MCP server guide](https://ontogr.github.io/agentic-graphrag/stable/guides/run-the-mcp-server) for the other settings.
301
+
302
+ ## Contributing
303
+
304
+ We welcome bug fixes, new features, documentation improvements, and other contributions. Please read our [Contributing guide](CONTRIBUTING.md) before submitting a pull request.
305
+
306
+ ## Acknowledgements
307
+
308
+ Agentic GraphRAG builds on the work behind these papers and projects.
309
+
310
+ - [Graphiti](https://github.com/getzep/graphiti) for layered graph search and entity-aware retrieval
311
+ - [Cognee](https://github.com/topoteretes/cognee) for data pipelines, graph memory, and consolidation
312
+ - [FalkorDB GraphRAG SDK](https://github.com/FalkorDB/GraphRAG-SDK) for graph-native retrieval and entity resolution
313
+ - [Neo4j GraphRAG](https://github.com/neo4j/neo4j-graphrag-python) for Neo4j retrieval and vector integration
314
+ - [GLiNER](https://arxiv.org/abs/2311.08526) for generalist zero-shot information extraction
315
+ - [BAML](https://boundaryml.com/), [Docling](https://github.com/docling-project/docling), and [Chonkie](https://github.com/chonkie-inc/chonkie) for typed LLM calls, document parsing, and chunk splitting
316
+
317
+ ## License
318
+
319
+ Agentic GraphRAG is licensed under the [Apache License 2.0](https://github.com/ontogr/agentic-graphrag/blob/main/LICENSE).
@@ -0,0 +1,251 @@
1
+ <h1 align="center"><a href="https://github.com/ontogr/agentic-graphrag">Agentic GraphRAG</a></h1>
2
+
3
+ <h3 align="center">Context graphs that give AI agents memory they can trace to its sources.</h3>
4
+ <h4 align="center"><a href="https://ontogr.github.io/agentic-graphrag/">Documentation</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/get-started/quickstart">Quickstart</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/concepts/architecture">Concepts</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/guides/ingest-documents">Guides</a> · <a href="https://ontogr.github.io/agentic-graphrag/stable/api/">API reference</a></h4>
5
+
6
+
7
+ <div align="center">
8
+
9
+ [![PyPI](https://img.shields.io/pypi/v/agentic-graphrag.svg)](https://pypi.org/project/agentic-graphrag/)
10
+ [![Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://pypi.org/project/agentic-graphrag/)
11
+ [![Downloads](https://static.pepy.tech/badge/agentic-graphrag)](https://pepy.tech/project/agentic-graphrag)
12
+ [![Docs](https://img.shields.io/badge/docs-GitHub%20Pages-blue?logo=readthedocs)](https://ontogr.github.io/agentic-graphrag/)
13
+ [![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ontogr/agentic-graphrag)
14
+ [![License](https://img.shields.io/github/license/ontogr/agentic-graphrag?color=green)](https://github.com/ontogr/agentic-graphrag/blob/main/LICENSE)
15
+
16
+ </div>
17
+
18
+ <div align="center">
19
+
20
+ [![CI](https://img.shields.io/github/actions/workflow/status/ontogr/agentic-graphrag/ci.yml?branch=main&label=CI&logo=githubactions)](https://github.com/ontogr/agentic-graphrag/actions/workflows/ci.yml)
21
+ [![Integration tests](https://img.shields.io/github/actions/workflow/status/ontogr/agentic-graphrag/integration.yml?branch=main&label=integration%20tests&logo=pytest)](https://github.com/ontogr/agentic-graphrag/actions/workflows/integration.yml)
22
+ [![Codecov](https://codecov.io/gh/ontogr/agentic-graphrag/branch/main/graph/badge.svg)](https://codecov.io/gh/ontogr/agentic-graphrag)
23
+
24
+ </div>
25
+
26
+ Agentic GraphRAG is an open source Python framework that connects your documents, agent activity, and decisions in one graph. Your agents can find evidence, continue work across sessions, and revisit decisions when their sources change.
27
+
28
+ Turn documents into searchable knowledge shaped by your own schema. Give agents tools to follow relationships, read source passages, and cite what they use. Keep decisions linked to the evidence behind them. Use the Python library, connect your agent through MCP, or start with the built-in agent.
29
+
30
+ For example, a contract-review agent can record a recommendation with passages from a contract and a policy. A later session retrieves the task and its decision. When the policy changes, the decision is flagged for review against the new evidence.
31
+
32
+ ## Features
33
+
34
+ ### One graph for documents, tasks, and decisions
35
+
36
+ Documents, agent work, and decisions live together, so every answer can be traced back to its source.
37
+
38
+ <p align="center">
39
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/graph3d.png" alt="Three stacked graph layers. Enterprise knowledge holds documents, sections, chunks and entities. Conversation history holds tasks, events and steps. Decision traces point up to the passages and events they rely on." width="860">
40
+ </p>
41
+
42
+ - **Three connected layers.** The first layer holds your documents, with their sections, tables, and passages, and the people, organizations, products, and other entities found in them. The second holds named tasks, the steps agents take, and a log of what happened. The third holds the decisions agents make.
43
+ - **Every passage knows where it came from.** A passage records its document, its place in the document's structure, and the exact version it came from, with page positions for PDFs.
44
+ - **Relations can point to their evidence.** A relation links to the passages that support it when evidence exists, and a decision links to the text it was based on.
45
+ - **Old citations keep working.** The graph keeps the history of each document, so a citation to an older version still leads to the text that was cited.
46
+
47
+ ### Build the graph around your own schema
48
+
49
+ You decide which things matter, and the graph is built around them.
50
+
51
+ <p align="center">
52
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/schema-pipeline.png" alt="Extraction reads each chunk with a local model, sends uncertain chunks to an LLM, and checks the result against your schema. Entities and relationships outside the schema are saved for review. Resolution then compares entities in steps, from cheap checks to an LLM, and stores each match as a link." width="860">
53
+ </p>
54
+
55
+ - **Describe your own entities and relations.** Name the kinds of things that matter to you, such as people, contracts, or products, and the relations between them. Write the schema in code or in a configuration file, or start from a ready-made preset and extend it.
56
+ - **Extraction runs on your machine first.** You can build a graph without an LLM. When the local model is unsure about a passage, an LLM can read it, and you decide how much of each batch the LLM may read.
57
+ - **Nothing outside your schema is lost.** Anything the models find that your schema does not cover is saved for review. Approved items become part of your schema and your graph.
58
+ - **Duplicates are merged with care.** Agentic GraphRAG recognizes that "Acme Corp" and "Acme Corporation" are the same company. It starts with cheap checks and asks an LLM only about the pairs that remain unclear.
59
+ - **Every match can be undone.** A match is stored as a link between two entities, so the originals stay in the graph. You can preview a cleanup of the whole graph before you apply it.
60
+
61
+ ### Search your documents and read the evidence
62
+
63
+ Agents find passages, read the exact text, and move around a document the way a person would.
64
+
65
+ <p align="center">
66
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/search-evidence.png" alt="A query runs full-text, semantic, or hybrid search over the chunks of the documents you allow. Hits carry evidence ids, and a fetch returns the exact passage text with a citation. Optional steps navigate the document tree, search entities, and explore relationships." width="860">
67
+ </p>
68
+
69
+ - **Full-text, semantic, and hybrid search.** Full-text search matches keywords, semantic search compares embeddings, and hybrid search fuses both rankings with reciprocal rank fusion. A search returns short previews, each with an evidence id for its passage, and a separate step fetches the exact text.
70
+ - **You set the boundary outside the model.** You decide which documents an agent may read, and the model can only work inside that choice.
71
+ - **Source text stays findable.** Search reads the passages directly, so a passage is still found when extraction missed the fact it contains.
72
+ - **Move around a passage.** From any passage, an agent can reach the surrounding section, the neighboring passages, or the rows around a table cell, which keep their column headers.
73
+ - **Follow entities back to text.** An agent can look up an entity, see the passages that mention it, and follow its relations a few steps out. Each relation is marked as backed by a passage or as a connection without direct text.
74
+ - **Incomplete results say so.** Every result states when something was cut off or part of the search failed, so an incomplete result is never mistaken for an empty one.
75
+
76
+ ### Remember tasks and decisions
77
+
78
+ The memory layer records an agent's work and decisions as it runs, keeps them current when sources change, and recalls them to inform later decisions.
79
+
80
+ <p align="center">
81
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/task-resume.png" alt="The agent records events, steps, and decisions in the memory layer as it works. A decision cites passages, events, and earlier decisions. When a cited document changes, the decision is flagged for review. The agent recalls the task and searches past decisions to inform new ones." width="860">
82
+ </p>
83
+
84
+ - **Work is recorded as it happens.** The built-in agent saves each message, tool call, and tool result as a task event, and it tracks progress as steps. Repeating a write after a failure never records it twice.
85
+ - **Decisions are saved as traces.** A decision records a conclusion, the reasoning, the assumptions, and the open questions, along with the passages, events, or earlier decisions it relies on.
86
+ - **Source changes flag decisions.** When a document behind a decision is updated or removed, the decision is flagged for review, and so are the decisions that depend on it.
87
+ - **Reviews end in a clear action.** A reviewer can reaffirm a decision after reading the current text, or replace it with a new one that explains the change. The earlier version stays in the history.
88
+ - **Tasks resume with the full picture.** When a task resumes, the agent sees the goal, the progress so far, and the decisions already made, including any that need review. It reuses finished work that is still valid, and a step that was interrupted is marked as unknown so that it can be run again.
89
+ - **Past decisions inform new ones.** Agents can search earlier decisions in the same project. The built-in agent's search leaves out decisions that need review, and the agent cannot cite one as support.
90
+
91
+ ### Use the built-in agent or any MCP client
92
+
93
+ Use the agent that ships with the library, or connect your own through MCP.
94
+
95
+ <p align="center">
96
+ <img src="https://raw.githubusercontent.com/ontogr/agentic-graphrag/main/docs/static/img/readme/full-flow.png" alt="Documents are loaded, chunked, extracted, and resolved into a graph with three layers: enterprise knowledge, conversation history, and decision traces. A changed document flags the decisions that cite it. An agent searches and reads the graph and records its events, steps, and decisions. Its answer passes a citation check and returns with numbered sources." width="860">
97
+ </p>
98
+
99
+ - **Answers cite numbered sources.** The built-in agent searches your documents, reads passages, and answers with numbered sources.
100
+ - **Every citation is checked.** The passage must have been read during that run, it must belong to the documents the agent may use, and it must match the version cited. If a citation fails the check, the agent gets one chance to fix it.
101
+ - **Every run ends with a status.** The status tells you whether the agent answered, found too little evidence, or reached a limit. You set how many steps and tool calls a run may use.
102
+ - **Choose your model.** Use Anthropic, OpenAI, Google, or any OpenAI-compatible model, with fallback between them.
103
+ - **The same tools work through MCP.** A local MCP server gives other agents the same tools. It starts read-only and shows only the documents you choose, and you decide whether a client may record tasks and decisions.
104
+ - **Trace and evaluate your runs.** Runs can be traced with OpenTelemetry, and the evaluation tools score answers, citations, and agent runs on your own questions.
105
+
106
+ See the [features page](https://ontogr.github.io/agentic-graphrag/stable/get-started/features) for the complete list, including supported file formats, chunking, keeping the graph current as documents change, and community summaries.
107
+
108
+ ## Quickstart
109
+
110
+ In this example you add one document, ask a question about it, and get an answer with numbered sources. You need Python 3.11 or newer, a running Neo4j database, and an OpenAI-compatible LLM endpoint. See the [quickstart guide](https://ontogr.github.io/agentic-graphrag/stable/get-started/quickstart) for starting Neo4j with Docker or Neo4j Aura.
111
+
112
+ ### 1. Install
113
+
114
+ Install the package from PyPI into a fresh virtual environment:
115
+
116
+ ```bash
117
+ uv venv
118
+ source .venv/bin/activate
119
+ uv pip install "agentic-graphrag[neo4j,extract,agents]" --torch-backend=auto
120
+ ```
121
+
122
+ See [Installation](https://ontogr.github.io/agentic-graphrag/stable/get-started/installation) for other package managers and the optional parts you can add.
123
+
124
+ ### 2. Add your settings
125
+
126
+ Create a file named `.env` in the folder where you will run the example. Replace the values with your own, and keep the file out of version control.
127
+
128
+ ```dotenv
129
+ NEO4J_URI=bolt://localhost:7687
130
+ NEO4J_USERNAME=neo4j
131
+ NEO4J_PASSWORD=your-neo4j-password
132
+ AGENT_LLM_BASE_URL=https://your-endpoint.example.com/v1
133
+ AGENT_LLM_API_KEY=your-api-key
134
+ AGENT_LLM_MODEL_ID=your-model-id
135
+ ```
136
+
137
+ The last three lines are the address, key, and model of your OpenAI-compatible LLM endpoint. For a Neo4j database on another machine, see [Configuration](https://ontogr.github.io/agentic-graphrag/stable/reference/configuration).
138
+
139
+ ### 3. Run the example
140
+
141
+ Put any Markdown or text file in the same folder and name it `your-document.md`. Save the following as `example.py` and run `python example.py`.
142
+
143
+ ```python
144
+ import asyncio
145
+ from pathlib import Path
146
+
147
+ from agrag.agents import AgentLLMSettings, build_agent
148
+ from agrag.embedding import build_embedder
149
+ from agrag.graphdb import build_graph_store
150
+ from agrag.ingestion import ExtractionSettings, Graph
151
+
152
+ # Any Markdown or text file you have.
153
+ DOCUMENT = Path("your-document.md").resolve()
154
+
155
+
156
+ async def main() -> None:
157
+ # Connect to the database and load the model that turns text into vectors.
158
+ store = build_graph_store("neo4j")
159
+ embedder = build_embedder("ibm-granite/granite-embedding-small-english-r2")
160
+ try:
161
+ # Read the document into the graph. This step runs on your machine.
162
+ graph = await Graph.open(
163
+ schema="operations",
164
+ graph_store=store,
165
+ embedder=embedder,
166
+ extraction_settings=ExtractionSettings(mode="gliner"),
167
+ max_llm_pairs=0,
168
+ )
169
+ await graph.add(DOCUMENT)
170
+
171
+ # Create an agent that may read only this document.
172
+ agent = build_agent(
173
+ graph_store=store,
174
+ embedder=embedder,
175
+ scope=frozenset({str(DOCUMENT)}),
176
+ project_id="my-project",
177
+ agent_id="researcher",
178
+ llm_settings=AgentLLMSettings.from_openai_compatible_env(),
179
+ )
180
+
181
+ # Ask a question about the document.
182
+ result = await agent.ainvoke({
183
+ "task_name": "first-question",
184
+ "question": "What are the main points of this document? Cite your sources.",
185
+ })
186
+ print(result["answer"])
187
+ finally:
188
+ await store.close()
189
+
190
+
191
+ asyncio.run(main())
192
+ ```
193
+
194
+ The script prints an answer that ends with a numbered list of sources. Run it again with the same task name and the agent continues where it stopped.
195
+
196
+ ### Next steps
197
+
198
+ - See [Record decisions and review them](https://ontogr.github.io/agentic-graphrag/stable/guides/connected-memory) for tying a decision to its evidence and reviewing it when a document changes.
199
+ - See [Find and cite evidence](https://ontogr.github.io/agentic-graphrag/stable/guides/find-and-cite-evidence) for searching passages and checking citations from your own code.
200
+ - See the [features page](https://ontogr.github.io/agentic-graphrag/stable/get-started/features) for everything else Agentic GraphRAG does.
201
+
202
+ ## Use MCP
203
+
204
+ Run `agrag-mcp` to give any MCP client tools that search your documents, read exact passages, check citations, and keep task and decision memory.
205
+
206
+ Install the server in the same virtual environment as before:
207
+
208
+ ```bash
209
+ uv pip install "agentic-graphrag[neo4j,mcp]"
210
+ ```
211
+
212
+ Then add the server to your MCP client. Replace the document path with the full path of a file you added to the graph.
213
+
214
+ ```json
215
+ {
216
+ "mcpServers": {
217
+ "agrag": {
218
+ "command": "agrag-mcp",
219
+ "env": {
220
+ "NEO4J_URI": "bolt://localhost:7687",
221
+ "NEO4J_USERNAME": "neo4j",
222
+ "NEO4J_PASSWORD": "your-neo4j-password",
223
+ "AGRAG_MCP_SCOPE_DOCUMENT_KEYS": "/full/path/to/your-document.md",
224
+ "AGRAG_MCP_PROJECT_ID": "my-project",
225
+ "AGRAG_MCP_AGENT_ID": "researcher"
226
+ }
227
+ }
228
+ }
229
+ }
230
+ ```
231
+
232
+ If your client cannot find `agrag-mcp`, use its full path inside the virtual environment, for example `/full/path/to/.venv/bin/agrag-mcp`. The server starts read-only and reads only the documents you list. The project and agent IDs enable task and decision memory tools; writes remain disabled until you change the server settings. See the [MCP server guide](https://ontogr.github.io/agentic-graphrag/stable/guides/run-the-mcp-server) for the other settings.
233
+
234
+ ## Contributing
235
+
236
+ We welcome bug fixes, new features, documentation improvements, and other contributions. Please read our [Contributing guide](CONTRIBUTING.md) before submitting a pull request.
237
+
238
+ ## Acknowledgements
239
+
240
+ Agentic GraphRAG builds on the work behind these papers and projects.
241
+
242
+ - [Graphiti](https://github.com/getzep/graphiti) for layered graph search and entity-aware retrieval
243
+ - [Cognee](https://github.com/topoteretes/cognee) for data pipelines, graph memory, and consolidation
244
+ - [FalkorDB GraphRAG SDK](https://github.com/FalkorDB/GraphRAG-SDK) for graph-native retrieval and entity resolution
245
+ - [Neo4j GraphRAG](https://github.com/neo4j/neo4j-graphrag-python) for Neo4j retrieval and vector integration
246
+ - [GLiNER](https://arxiv.org/abs/2311.08526) for generalist zero-shot information extraction
247
+ - [BAML](https://boundaryml.com/), [Docling](https://github.com/docling-project/docling), and [Chonkie](https://github.com/chonkie-inc/chonkie) for typed LLM calls, document parsing, and chunk splitting
248
+
249
+ ## License
250
+
251
+ Agentic GraphRAG is licensed under the [Apache License 2.0](https://github.com/ontogr/agentic-graphrag/blob/main/LICENSE).
@@ -0,0 +1,36 @@
1
+ """Agentic layer: one task-scoped evidence agent over the graph.
2
+
3
+ ``build_agent`` is imported lazily because it needs the optional ``agents``
4
+ extra. Importing this package does not require that extra.
5
+ """
6
+
7
+ from typing import TYPE_CHECKING, Any
8
+
9
+ from agrag.agents.errors import AgentMissingExtraError
10
+ from agrag.agents.ledger import Ledger
11
+ from agrag.agents.result import AgentRunResult
12
+ from agrag.agents.settings import AgentLLMSettings, AgentSettings
13
+
14
+
15
+ if TYPE_CHECKING:
16
+ from agrag.agents.build import build_agent
17
+
18
+
19
+ def __getattr__(name: str) -> Any:
20
+ """Load the optional agent builder when a caller requests it."""
21
+ if name != "build_agent":
22
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
23
+
24
+ from agrag.agents.build import build_agent # noqa: PLC0415
25
+
26
+ return build_agent
27
+
28
+
29
+ __all__ = [
30
+ "AgentLLMSettings",
31
+ "AgentMissingExtraError",
32
+ "AgentRunResult",
33
+ "AgentSettings",
34
+ "Ledger",
35
+ "build_agent",
36
+ ]