code-graph-rag 0.0.345__tar.gz → 0.0.421__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 (245) hide show
  1. {code_graph_rag-0.0.345/code_graph_rag.egg-info → code_graph_rag-0.0.421}/PKG-INFO +21 -4
  2. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/PYPI_README.md +12 -2
  3. code_graph_rag-0.0.421/README.md +189 -0
  4. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421/code_graph_rag.egg-info}/PKG-INFO +21 -4
  5. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/code_graph_rag.egg-info/SOURCES.txt +26 -0
  6. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/code_graph_rag.egg-info/requires.txt +10 -1
  7. code_graph_rag-0.0.421/codebase_rag/analyzers/__init__.py +4 -0
  8. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_analyzer.py +201 -0
  9. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/patterns/javascript.yaml +28 -0
  10. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/patterns/python.yaml +49 -0
  11. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/patterns/tsx.yaml +28 -0
  12. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/patterns/typescript.yaml +28 -0
  13. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/security/javascript.yaml +35 -0
  14. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/security/python.yaml +71 -0
  15. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/security/tsx.yaml +35 -0
  16. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/security/typescript.yaml +35 -0
  17. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/smells/javascript.yaml +22 -0
  18. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/smells/python.yaml +33 -0
  19. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/smells/tsx.yaml +22 -0
  20. code_graph_rag-0.0.421/codebase_rag/analyzers/ast_grep_rules/smells/typescript.yaml +22 -0
  21. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/capture.py +6 -6
  22. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/cli.py +157 -28
  23. code_graph_rag-0.0.421/codebase_rag/cli_help.py +238 -0
  24. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/config.py +50 -17
  25. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/__init__.py +2 -1
  26. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_cpp.py +60 -41
  27. code_graph_rag-0.0.421/codebase_rag/constants/ast_csharp.py +317 -0
  28. code_graph_rag-0.0.421/codebase_rag/constants/ast_dart.py +142 -0
  29. code_graph_rag-0.0.421/codebase_rag/constants/ast_go.py +83 -0
  30. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_java.py +38 -28
  31. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_js.py +71 -55
  32. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_lua.py +5 -5
  33. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_nodes.py +45 -35
  34. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_php.py +7 -7
  35. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_python.py +38 -23
  36. code_graph_rag-0.0.421/codebase_rag/constants/ast_rust.py +182 -0
  37. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/ast_scala.py +5 -5
  38. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/build.py +4 -4
  39. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/cli.py +23 -23
  40. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/core.py +36 -34
  41. code_graph_rag-0.0.421/codebase_rag/constants/deadcode_roots.py +217 -0
  42. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/deps.py +15 -15
  43. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/fqn_specs.py +64 -60
  44. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/graph.py +74 -49
  45. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/health.py +1 -1
  46. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/lang_tooling.py +10 -10
  47. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/languages.py +56 -23
  48. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/mcp.py +16 -10
  49. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/providers.py +29 -9
  50. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/security.py +9 -9
  51. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/constants/stdlib_types.py +38 -38
  52. code_graph_rag-0.0.421/codebase_rag/constants/structural.py +69 -0
  53. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/cypher_queries.py +29 -13
  54. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/dead_code.py +96 -96
  55. code_graph_rag-0.0.421/codebase_rag/embedder.py +329 -0
  56. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/exceptions.py +24 -9
  57. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/graph_audit.py +15 -15
  58. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/graph_updater.py +384 -172
  59. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/language_spec.py +48 -37
  60. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/logs.py +110 -60
  61. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/main.py +48 -4
  62. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/mcp/server.py +73 -4
  63. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/mcp/tools.py +85 -2
  64. code_graph_rag-0.0.421/codebase_rag/parser_fingerprint.py +71 -0
  65. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parser_loader.py +143 -40
  66. code_graph_rag-0.0.421/codebase_rag/parsers/ast_grep_patterns/ruby.yaml +21 -0
  67. code_graph_rag-0.0.421/codebase_rag/parsers/ast_grep_tier.py +275 -0
  68. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/call_processor.py +1467 -805
  69. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/call_resolver.py +434 -385
  70. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/cpp_modules.py +3 -3
  71. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/identity.py +3 -3
  72. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/method_override.py +54 -54
  73. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/mixin.py +401 -219
  74. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/parent_extraction.py +84 -62
  75. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/relationships.py +25 -24
  76. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/utils.py +4 -4
  77. code_graph_rag-0.0.421/codebase_rag/parsers/cpp/preproc_recovery.py +262 -0
  78. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp/type_inference.py +123 -81
  79. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp/utils.py +124 -20
  80. code_graph_rag-0.0.421/codebase_rag/parsers/cpp_frontend/constants.py +44 -0
  81. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp_frontend/frontend.py +125 -125
  82. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp_frontend/qn.py +22 -22
  83. code_graph_rag-0.0.421/codebase_rag/parsers/csharp/type_inference.py +1364 -0
  84. code_graph_rag-0.0.421/codebase_rag/parsers/csharp/utils.py +273 -0
  85. code_graph_rag-0.0.421/codebase_rag/parsers/csharp_frontend/__init__.py +23 -0
  86. code_graph_rag-0.0.421/codebase_rag/parsers/csharp_frontend/frontend.py +391 -0
  87. code_graph_rag-0.0.421/codebase_rag/parsers/csharp_frontend/roslyn/Frontend.cs +583 -0
  88. code_graph_rag-0.0.421/codebase_rag/parsers/csharp_frontend/roslyn/Frontend.csproj +36 -0
  89. code_graph_rag-0.0.421/codebase_rag/parsers/csharp_frontend/roslyn/Program.cs +22 -0
  90. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/dart/__init__.py +8 -0
  91. code_graph_rag-0.0.421/codebase_rag/parsers/dart/type_inference.py +263 -0
  92. code_graph_rag-0.0.421/codebase_rag/parsers/dart/utils.py +272 -0
  93. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/definition_processor.py +131 -79
  94. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/dependency_parser.py +8 -8
  95. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/export_detection.py +113 -64
  96. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/factory.py +10 -1
  97. code_graph_rag-0.0.421/codebase_rag/parsers/flow_access/processor.py +2061 -0
  98. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/function_ingest.py +462 -224
  99. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/go/__init__.py +2 -0
  100. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/go/module_paths.py +12 -12
  101. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/go/type_inference.py +28 -28
  102. code_graph_rag-0.0.421/codebase_rag/parsers/go/utils.py +93 -0
  103. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/import_processor.py +196 -195
  104. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/io_access/__init__.py +14 -0
  105. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/io_access/constants.py +12 -12
  106. code_graph_rag-0.0.421/codebase_rag/parsers/io_access/descriptor.py +392 -0
  107. code_graph_rag-0.0.421/codebase_rag/parsers/io_access/extract.py +427 -0
  108. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/io_access/models.py +14 -0
  109. code_graph_rag-0.0.421/codebase_rag/parsers/io_access/processor.py +1664 -0
  110. code_graph_rag-0.0.421/codebase_rag/parsers/io_access/registry.py +974 -0
  111. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/method_resolver.py +58 -58
  112. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/type_inference.py +8 -7
  113. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/type_resolver.py +18 -18
  114. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/utils.py +24 -24
  115. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/variable_analyzer.py +15 -15
  116. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/js_ts/ingest.py +36 -34
  117. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/js_ts/module_system.py +13 -12
  118. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/js_ts/type_inference.py +4 -4
  119. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/js_ts/utils.py +2 -1
  120. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/ast_analyzer.py +25 -25
  121. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/expression_analyzer.py +23 -25
  122. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/type_inference.py +8 -8
  123. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/utils.py +22 -22
  124. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/variable_analyzer.py +24 -24
  125. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/python_source_roots.py +25 -25
  126. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/rs/type_inference.py +66 -66
  127. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/rs/utils.py +14 -14
  128. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/stdlib_extractor.py +8 -8
  129. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/structure_processor.py +7 -3
  130. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/type_inference.py +219 -75
  131. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/utils.py +146 -121
  132. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/prompts.py +16 -4
  133. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/providers/base.py +7 -7
  134. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/providers/litellm.py +1 -2
  135. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/readme_sections.py +29 -0
  136. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/filtering.py +4 -4
  137. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/graph_service.py +8 -8
  138. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/stack/cli.py +11 -6
  139. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tool_errors.py +9 -9
  140. code_graph_rag-0.0.421/codebase_rag/tools/ast_grep_service.py +218 -0
  141. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/health_checker.py +1 -1
  142. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/language.py +18 -5
  143. code_graph_rag-0.0.421/codebase_rag/tools/structural_editor.py +58 -0
  144. code_graph_rag-0.0.421/codebase_rag/tools/structural_search.py +46 -0
  145. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/tool_descriptions.py +48 -2
  146. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/types_defs.py +75 -18
  147. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/unixcoder.py +9 -9
  148. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/dependencies.py +28 -1
  149. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/path_utils.py +29 -16
  150. code_graph_rag-0.0.421/codebase_rag/vector_store.py +496 -0
  151. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/workspaces/cli.py +20 -7
  152. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/pyproject.toml +20 -3
  153. code_graph_rag-0.0.345/README.md +0 -1058
  154. code_graph_rag-0.0.345/codebase_rag/cli_help.py +0 -248
  155. code_graph_rag-0.0.345/codebase_rag/constants/ast_csharp.py +0 -243
  156. code_graph_rag-0.0.345/codebase_rag/constants/ast_dart.py +0 -68
  157. code_graph_rag-0.0.345/codebase_rag/constants/ast_go.py +0 -63
  158. code_graph_rag-0.0.345/codebase_rag/constants/ast_rust.py +0 -172
  159. code_graph_rag-0.0.345/codebase_rag/constants/deadcode_roots.py +0 -217
  160. code_graph_rag-0.0.345/codebase_rag/embedder.py +0 -223
  161. code_graph_rag-0.0.345/codebase_rag/parser_fingerprint.py +0 -44
  162. code_graph_rag-0.0.345/codebase_rag/parsers/cpp/preproc_recovery.py +0 -129
  163. code_graph_rag-0.0.345/codebase_rag/parsers/cpp_frontend/constants.py +0 -44
  164. code_graph_rag-0.0.345/codebase_rag/parsers/csharp/type_inference.py +0 -579
  165. code_graph_rag-0.0.345/codebase_rag/parsers/csharp/utils.py +0 -205
  166. code_graph_rag-0.0.345/codebase_rag/parsers/dart/utils.py +0 -81
  167. code_graph_rag-0.0.345/codebase_rag/parsers/flow_access/processor.py +0 -1247
  168. code_graph_rag-0.0.345/codebase_rag/parsers/go/utils.py +0 -63
  169. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/descriptor.py +0 -289
  170. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/extract.py +0 -203
  171. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/processor.py +0 -1038
  172. code_graph_rag-0.0.345/codebase_rag/parsers/io_access/registry.py +0 -410
  173. code_graph_rag-0.0.345/codebase_rag/vector_store.py +0 -180
  174. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/LICENSE +0 -0
  175. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/cgr/__init__.py +0 -0
  176. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/code_graph_rag.egg-info/dependency_links.txt +0 -0
  177. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/code_graph_rag.egg-info/entry_points.txt +0 -0
  178. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/code_graph_rag.egg-info/top_level.txt +0 -0
  179. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/__init__.py +0 -0
  180. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/cgr_state.py +0 -0
  181. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/decorators.py +0 -0
  182. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/docker-compose.yaml +0 -0
  183. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/graph_loader.py +0 -0
  184. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/mcp/__init__.py +0 -0
  185. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/mcp/client.py +0 -0
  186. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/models.py +0 -0
  187. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/__init__.py +0 -0
  188. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
  189. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/class_ingest/node_type.py +0 -0
  190. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp/__init__.py +0 -0
  191. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/cpp_frontend/__init__.py +0 -0
  192. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/csharp/__init__.py +0 -0
  193. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/flow_access/__init__.py +0 -0
  194. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/flow_access/constants.py +0 -0
  195. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/__init__.py +0 -0
  196. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/base.py +0 -0
  197. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/cpp.py +0 -0
  198. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/java.py +0 -0
  199. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/js_ts.py +0 -0
  200. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/lua.py +0 -0
  201. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/php.py +0 -0
  202. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/protocol.py +0 -0
  203. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/python.py +0 -0
  204. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/registry.py +0 -0
  205. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/handlers/rust.py +0 -0
  206. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/java/__init__.py +0 -0
  207. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/js_ts/__init__.py +0 -0
  208. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/lua/__init__.py +0 -0
  209. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/lua/type_inference.py +0 -0
  210. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/lua/utils.py +0 -0
  211. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/py/__init__.py +0 -0
  212. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/parsers/rs/__init__.py +0 -0
  213. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/providers/__init__.py +0 -0
  214. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/schema_builder.py +0 -0
  215. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/schemas.py +0 -0
  216. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/__init__.py +0 -0
  217. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/anthropic_token_counter.py +0 -0
  218. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/llm.py +0 -0
  219. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/services/protobuf_service.py +0 -0
  220. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/stack/__init__.py +0 -0
  221. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/stack/constants.py +0 -0
  222. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/stack/health.py +0 -0
  223. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/stack/manager.py +0 -0
  224. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/__init__.py +0 -0
  225. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/code_retrieval.py +0 -0
  226. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/codebase_query.py +0 -0
  227. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/directory_lister.py +0 -0
  228. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/file_editor.py +0 -0
  229. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/file_reader.py +0 -0
  230. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/file_writer.py +0 -0
  231. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/semantic_search.py +0 -0
  232. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/tools/shell_command.py +0 -0
  233. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/__init__.py +0 -0
  234. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/fqn_resolver.py +0 -0
  235. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/rich_markdown.py +0 -0
  236. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/source_extraction.py +0 -0
  237. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/utils/token_utils.py +0 -0
  238. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/workspaces/__init__.py +0 -0
  239. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/workspaces/constants.py +0 -0
  240. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/workspaces/models.py +0 -0
  241. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codebase_rag/workspaces/storage.py +0 -0
  242. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codec/__init__.py +0 -0
  243. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codec/schema_pb2.py +0 -0
  244. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/codec/schema_pb2.pyi +0 -0
  245. {code_graph_rag-0.0.345 → code_graph_rag-0.0.421}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.345
3
+ Version: 0.0.421
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -19,7 +19,7 @@ Requires-Python: >=3.12
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: loguru>=0.7.3
22
- Requires-Dist: mcp>=1.25.0
22
+ Requires-Dist: mcp>=1.28.1
23
23
  Requires-Dist: pydantic-ai>=1.102.0
24
24
  Requires-Dist: pydantic-settings>=2.12.0
25
25
  Requires-Dist: pymgclient>=1.5.1
@@ -47,6 +47,8 @@ Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
47
47
  Requires-Dist: testcontainers>=4.9.0; extra == "test"
48
48
  Requires-Dist: libclang>=18.1.1; extra == "test"
49
49
  Requires-Dist: filelock>=3.12; extra == "test"
50
+ Requires-Dist: ast-grep-py>=0.44.0; extra == "test"
51
+ Requires-Dist: pyyaml>=6.0; extra == "test"
50
52
  Provides-Extra: treesitter-full
51
53
  Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
52
54
  Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
@@ -65,11 +67,16 @@ Provides-Extra: semantic
65
67
  Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
66
68
  Requires-Dist: torch>=2.6.0; extra == "semantic"
67
69
  Requires-Dist: transformers>=4.0.0; extra == "semantic"
70
+ Provides-Extra: milvus
71
+ Requires-Dist: pymilvus[milvus-lite]>=3.0.0; extra == "milvus"
72
+ Provides-Extra: ast-grep
73
+ Requires-Dist: ast-grep-py>=0.44.0; extra == "ast-grep"
74
+ Requires-Dist: pyyaml>=6.0; extra == "ast-grep"
68
75
  Dynamic: license-file
69
76
 
70
77
  # Code-Graph-RAG
71
78
 
72
- A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimization.
79
+ A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimisation.
73
80
 
74
81
  ## Install
75
82
 
@@ -89,6 +96,16 @@ With semantic code search (UniXcoder embeddings):
89
96
  pip install 'code-graph-rag[semantic]'
90
97
  ```
91
98
 
99
+ Qdrant is the default vector store for semantic search. To use Milvus Lite,
100
+ install `code-graph-rag[semantic,milvus]`, then set
101
+ `CGR_VECTOR_STORE_BACKEND=milvus` and `MILVUS_URI=./.milvus_code_embeddings.db`
102
+ before indexing.
103
+
104
+ To compute embeddings on an OpenAI-compatible endpoint (OpenAI, Ollama, vLLM)
105
+ instead of locally, set `CGR_EMBEDDING_PROVIDER=openai` with
106
+ `OPENAI_EMBEDDING_BASE_URL` and `OPENAI_EMBEDDING_MODEL`; torch and
107
+ transformers are then not required locally.
108
+
92
109
  ### Prerequisites
93
110
 
94
111
  - Python 3.12+
@@ -120,7 +137,7 @@ cgr index -o ./index-output --repo-path ./my-project
120
137
  cgr export -o graph.json
121
138
  ```
122
139
 
123
- **AI-guided optimization:**
140
+ **AI-guided optimisation:**
124
141
 
125
142
  ```bash
126
143
  cgr optimize python --repo-path ./my-project
@@ -1,6 +1,6 @@
1
1
  # Code-Graph-RAG
2
2
 
3
- A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimization.
3
+ A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimisation.
4
4
 
5
5
  ## Install
6
6
 
@@ -20,6 +20,16 @@ With semantic code search (UniXcoder embeddings):
20
20
  pip install 'code-graph-rag[semantic]'
21
21
  ```
22
22
 
23
+ Qdrant is the default vector store for semantic search. To use Milvus Lite,
24
+ install `code-graph-rag[semantic,milvus]`, then set
25
+ `CGR_VECTOR_STORE_BACKEND=milvus` and `MILVUS_URI=./.milvus_code_embeddings.db`
26
+ before indexing.
27
+
28
+ To compute embeddings on an OpenAI-compatible endpoint (OpenAI, Ollama, vLLM)
29
+ instead of locally, set `CGR_EMBEDDING_PROVIDER=openai` with
30
+ `OPENAI_EMBEDDING_BASE_URL` and `OPENAI_EMBEDDING_MODEL`; torch and
31
+ transformers are then not required locally.
32
+
23
33
  ### Prerequisites
24
34
 
25
35
  - Python 3.12+
@@ -51,7 +61,7 @@ cgr index -o ./index-output --repo-path ./my-project
51
61
  cgr export -o graph.json
52
62
  ```
53
63
 
54
- **AI-guided optimization:**
64
+ **AI-guided optimisation:**
55
65
 
56
66
  ```bash
57
67
  cgr optimize python --repo-path ./my-project
@@ -0,0 +1,189 @@
1
+ <div align="center">
2
+ <!-- Bitbucket strips <picture>/<source> tags, so we use a single light-mode <img>. Restore the theme-aware <picture> block below when the GitHub account is reinstated:
3
+ <picture>
4
+ <source srcset="assets/logo-dark-any.png" media="(prefers-color-scheme: dark)">
5
+ <source srcset="assets/logo-light-any.png" media="(prefers-color-scheme: light)">
6
+ <img src="assets/logo-dark-any.png" alt="Code-Graph-RAG Logo" width="480">
7
+ </picture>
8
+ -->
9
+ <img src="assets/logo-light-any.png" alt="Code-Graph-RAG Logo" width="480">
10
+
11
+ <p>
12
+ <!-- Badges below are commented out while the GitHub account is suspended. Restore them when the account is reinstated.
13
+ Stars/Forks: shields.io hits GitHub's API (returns "repo not found" for suspended accounts).
14
+ gitcgr: indexes from GitHub (shows "not indexed" while unavailable).
15
+ MseeP.ai: badge PNG ignores inline height on Bitbucket and renders as a full-size tile.
16
+ <a href="https://github.com/vitali87/code-graph-rag/stargazers">
17
+ <img src="https://img.shields.io/github/stars/vitali87/code-graph-rag?style=social" alt="GitHub stars" />
18
+ </a>
19
+ <a href="https://github.com/vitali87/code-graph-rag/network/members">
20
+ <img src="https://img.shields.io/github/forks/vitali87/code-graph-rag?style=social" alt="GitHub forks" />
21
+ </a>
22
+ -->
23
+ <!-- Codecov, SonarCloud, and OpenSSF Scorecard badges are fed by GitHub-side CI. Uncomment once that CI is confirmed to publish to these services again.
24
+ <a href="https://codecov.io/gh/vitali87/code-graph-rag">
25
+ <img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" />
26
+ </a>
27
+ <a href="https://sonarcloud.io/summary/overall?id=vitali87_code-graph-rag">
28
+ <img src="https://sonarcloud.io/api/project_badges/measure?project=vitali87_code-graph-rag&metric=alert_status" alt="Quality Gate Status" />
29
+ </a>
30
+ -->
31
+ <!--
32
+ <a href="https://mseep.ai/app/vitali87-code-graph-rag">
33
+ <img src="https://mseep.net/pr/vitali87-code-graph-rag-badge.png" alt="MseeP.ai Security Assessment" height="20" />
34
+ </a>
35
+ -->
36
+ <a href="https://code-graph-rag.com">
37
+ <img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" />
38
+ </a>
39
+ <a href="https://pepy.tech/projects/code-graph-rag">
40
+ <img src="https://static.pepy.tech/personalized-badge/code-graph-rag?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads" />
41
+ </a>
42
+ <!-- OpenSSF Scorecard only tracks GitHub-hosted repos. Uncomment once the Scorecard workflow is confirmed running on the authoritative GitHub repo.
43
+ <a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag">
44
+ <img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" />
45
+ </a>
46
+ -->
47
+ <!--
48
+ <a href="https://gitcgr.com/vitali87/code-graph-rag">
49
+ <img src="https://gitcgr.com/badge/vitali87/code-graph-rag.svg" alt="gitcgr" />
50
+ </a>
51
+ -->
52
+ </p>
53
+ </div>
54
+
55
+ # Code-Graph-RAG
56
+
57
+ Code-Graph-RAG parses a multi-language codebase with Tree-sitter, builds a knowledge graph of its structure in Memgraph, and lets you query, edit, and optimise that code in plain English. It works across a monorepo of mixed languages under one unified graph schema.
58
+
59
+ <p align="center">
60
+ <img src="./assets/demo.gif" alt="demo">
61
+ </p>
62
+
63
+ ## Latest News 🔥
64
+
65
+ <!-- SECTION:latest_news -->
66
+ - **Ruby Support**: Ruby joins the graph through a new pluggable ast-grep tier that adds a language from a single YAML pattern file, emitting `Module`, `Function`, and `Class` nodes plus import edges without a hand-written parser.
67
+ - **Structural Search & Replace**: Find and rewrite code by AST pattern with ast-grep, exposed as agent tools so you can match and transform structure across the whole codebase instead of relying on text or regex.
68
+ - **Data-Flow Tracing**: New `FLOWS_TO` taint edges follow values through assignments, function calls, and I/O sinks, with coverage across C#, Java, C, and Go.
69
+ <!-- /SECTION:latest_news -->
70
+
71
+ See [NEWS.md](NEWS.md) for the full history.
72
+
73
+ ## What It Does
74
+
75
+ Point Code-Graph-RAG at a repository and it reads every source file, extracts functions, classes, methods, modules, and the relationships between them, and stores the result as an interconnected graph. Once the graph exists you can:
76
+
77
+ - Ask questions about the codebase in natural language and get answers grounded in the real structure.
78
+ - Retrieve the actual source of any function, class, or method by name or by intent.
79
+ - Edit code through the agent with AST-based surgical patching and a diff preview before anything changes.
80
+ - Optimise code against language best practices or your own coding standards.
81
+ - Find dead code by walking call and reference edges from entry points.
82
+ - Search and rewrite structurally by AST pattern with ast-grep.
83
+
84
+ ## How It Works
85
+
86
+ The system has two components:
87
+
88
+ 1. **Multi-language parser.** A Tree-sitter based parser reads the codebase and ingests functions, classes, methods, modules, and their relationships into Memgraph under a single language-agnostic schema.
89
+ 2. **RAG system** (`codebase_rag/`). An interactive CLI that turns natural language into Cypher queries, retrieves matching code, and drives AI-powered editing and optimisation.
90
+
91
+ ```
92
+ Source Code -> Tree-sitter Parser -> AST Analysis -> Memgraph Knowledge Graph
93
+ |
94
+ User Query -> AI Model (Cypher Gen) -> Cypher Query -> Graph Results -> Response
95
+ ```
96
+
97
+ See the [Architecture Overview](docs/architecture/overview.md) and [Graph Schema](docs/architecture/graph-schema.md) for the full picture.
98
+
99
+ ## Supported Languages
100
+
101
+ Python, TypeScript, TSX, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, and Dart are fully supported. Scala is in development. See the [Language Support](docs/architecture/language-support.md) matrix for per-language capabilities.
102
+
103
+ ## Installation
104
+
105
+ `cgr` is published to PyPI. Install it system-wide with the `treesitter-full` (all languages) and `semantic` (vector search) extras:
106
+
107
+ ```bash
108
+ # with uv (recommended)
109
+ uv tool install "code-graph-rag[treesitter-full,semantic]"
110
+
111
+ # or with pipx
112
+ pipx install "code-graph-rag[treesitter-full,semantic]"
113
+ ```
114
+
115
+ You also need Docker (for Memgraph), `cmake`, and `ripgrep`. Full prerequisites, source installs, and environment setup are in the [Installation](docs/getting-started/installation.md) guide.
116
+
117
+ ## Quick Start
118
+
119
+ ```bash
120
+ # Start the packaged Memgraph + Qdrant stack (no compose file needed)
121
+ cgr daemon up
122
+
123
+ # Parse a repository into the graph, then query it
124
+ cgr start --repo-path /path/to/repo --update-graph --clean
125
+ cgr start --repo-path /path/to/repo
126
+ ```
127
+
128
+ The [Quick Start](docs/getting-started/quickstart.md) guide walks through parsing, querying, and exporting in five minutes.
129
+
130
+ ## MCP Server
131
+
132
+ Code-Graph-RAG runs as an [MCP](https://modelcontextprotocol.io) server so Claude Code and other MCP clients can query and edit your codebase directly. See the [MCP Server](docs/guide/mcp-server.md) guide for setup.
133
+
134
+ ## Documentation
135
+
136
+ **Getting Started**
137
+ - [Installation](docs/getting-started/installation.md)
138
+ - [Quick Start](docs/getting-started/quickstart.md)
139
+ - [Configuration](docs/getting-started/configuration.md)
140
+
141
+ **User Guide**
142
+ - [CLI Reference](docs/guide/cli-reference.md)
143
+ - [Interactive Querying](docs/guide/interactive-querying.md)
144
+ - [Code Optimisation](docs/guide/code-optimization.md)
145
+ - [Dead Code Detection](docs/guide/dead-code.md)
146
+ - [Graph Export](docs/guide/graph-export.md)
147
+ - [Real-Time Updates](docs/guide/realtime-updates.md)
148
+ - [MCP Server](docs/guide/mcp-server.md)
149
+
150
+ **Architecture**
151
+ - [Overview](docs/architecture/overview.md)
152
+ - [Graph Schema](docs/architecture/graph-schema.md)
153
+ - [Language Support](docs/architecture/language-support.md)
154
+ - [Data-Flow Edges](docs/architecture/data-flow-edges.md)
155
+
156
+ **Python SDK**
157
+ - [Overview](docs/sdk/overview.md)
158
+ - [Graph Loader](docs/sdk/graph-loader.md)
159
+ - [Cypher Generator](docs/sdk/cypher-generator.md)
160
+ - [Semantic Search](docs/sdk/semantic-search.md)
161
+
162
+ **Advanced**
163
+ - [Adding Languages](docs/advanced/adding-languages.md)
164
+ - [Ignore Patterns](docs/advanced/ignore-patterns.md)
165
+ - [Building Binaries](docs/advanced/building-binaries.md)
166
+ - [Troubleshooting](docs/advanced/troubleshooting.md)
167
+
168
+ ## Enterprise Services
169
+
170
+ Code-Graph-RAG is open source and free to use. For organisations that need more, we offer **fully managed cloud-hosted solutions** and **on-premise deployments**:
171
+
172
+ - **Cloud-Hosted Deployment**: Managed cloud infrastructure for both the graph database and the AI agent connection. Zero infrastructure overhead, so we handle scaling, updates, and availability while your team focuses on building.
173
+ - **On-Premise & Air-Gapped Deployment**: Deploy Code-Graph-RAG entirely within your own environment, including air-gapped networks. Full data sovereignty for regulated industries and security-sensitive organisations.
174
+
175
+ We also offer custom development, integration consulting, technical support contracts, and team training.
176
+
177
+ **[View plans & pricing at code-graph-rag.com](https://code-graph-rag.com/enterprise)**
178
+
179
+ ## Contributing
180
+
181
+ Please see [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. Good first PRs come from the TODO issues.
182
+
183
+ ## Support
184
+
185
+ For issues or questions, check the [Troubleshooting](docs/advanced/troubleshooting.md) guide first, then open an issue.
186
+
187
+ ## License
188
+
189
+ MIT. See [LICENSE](LICENSE).
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-graph-rag
3
- Version: 0.0.345
3
+ Version: 0.0.421
4
4
  Summary: The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
5
5
  License-Expression: MIT
6
6
  Keywords: rag,retrieval-augmented-generation,knowledge-graph,code-analysis,tree-sitter,mcp,mcp-server,llm,graph-database,semantic-search,codebase,memgraph,developer-tools,monorepo
@@ -19,7 +19,7 @@ Requires-Python: >=3.12
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: loguru>=0.7.3
22
- Requires-Dist: mcp>=1.25.0
22
+ Requires-Dist: mcp>=1.28.1
23
23
  Requires-Dist: pydantic-ai>=1.102.0
24
24
  Requires-Dist: pydantic-settings>=2.12.0
25
25
  Requires-Dist: pymgclient>=1.5.1
@@ -47,6 +47,8 @@ Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
47
47
  Requires-Dist: testcontainers>=4.9.0; extra == "test"
48
48
  Requires-Dist: libclang>=18.1.1; extra == "test"
49
49
  Requires-Dist: filelock>=3.12; extra == "test"
50
+ Requires-Dist: ast-grep-py>=0.44.0; extra == "test"
51
+ Requires-Dist: pyyaml>=6.0; extra == "test"
50
52
  Provides-Extra: treesitter-full
51
53
  Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
52
54
  Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
@@ -65,11 +67,16 @@ Provides-Extra: semantic
65
67
  Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
66
68
  Requires-Dist: torch>=2.6.0; extra == "semantic"
67
69
  Requires-Dist: transformers>=4.0.0; extra == "semantic"
70
+ Provides-Extra: milvus
71
+ Requires-Dist: pymilvus[milvus-lite]>=3.0.0; extra == "milvus"
72
+ Provides-Extra: ast-grep
73
+ Requires-Dist: ast-grep-py>=0.44.0; extra == "ast-grep"
74
+ Requires-Dist: pyyaml>=6.0; extra == "ast-grep"
68
75
  Dynamic: license-file
69
76
 
70
77
  # Code-Graph-RAG
71
78
 
72
- A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimization.
79
+ A graph-based RAG system that parses multi-language codebases with Tree-sitter, builds knowledge graphs in Memgraph, and enables natural language querying, editing, and optimisation.
73
80
 
74
81
  ## Install
75
82
 
@@ -89,6 +96,16 @@ With semantic code search (UniXcoder embeddings):
89
96
  pip install 'code-graph-rag[semantic]'
90
97
  ```
91
98
 
99
+ Qdrant is the default vector store for semantic search. To use Milvus Lite,
100
+ install `code-graph-rag[semantic,milvus]`, then set
101
+ `CGR_VECTOR_STORE_BACKEND=milvus` and `MILVUS_URI=./.milvus_code_embeddings.db`
102
+ before indexing.
103
+
104
+ To compute embeddings on an OpenAI-compatible endpoint (OpenAI, Ollama, vLLM)
105
+ instead of locally, set `CGR_EMBEDDING_PROVIDER=openai` with
106
+ `OPENAI_EMBEDDING_BASE_URL` and `OPENAI_EMBEDDING_MODEL`; torch and
107
+ transformers are then not required locally.
108
+
92
109
  ### Prerequisites
93
110
 
94
111
  - Python 3.12+
@@ -120,7 +137,7 @@ cgr index -o ./index-output --repo-path ./my-project
120
137
  cgr export -o graph.json
121
138
  ```
122
139
 
123
- **AI-guided optimization:**
140
+ **AI-guided optimisation:**
124
141
 
125
142
  ```bash
126
143
  cgr optimize python --repo-path ./my-project
@@ -38,6 +38,20 @@ codebase_rag/tool_errors.py
38
38
  codebase_rag/types_defs.py
39
39
  codebase_rag/unixcoder.py
40
40
  codebase_rag/vector_store.py
41
+ codebase_rag/analyzers/__init__.py
42
+ codebase_rag/analyzers/ast_grep_analyzer.py
43
+ codebase_rag/analyzers/ast_grep_rules/patterns/javascript.yaml
44
+ codebase_rag/analyzers/ast_grep_rules/patterns/python.yaml
45
+ codebase_rag/analyzers/ast_grep_rules/patterns/tsx.yaml
46
+ codebase_rag/analyzers/ast_grep_rules/patterns/typescript.yaml
47
+ codebase_rag/analyzers/ast_grep_rules/security/javascript.yaml
48
+ codebase_rag/analyzers/ast_grep_rules/security/python.yaml
49
+ codebase_rag/analyzers/ast_grep_rules/security/tsx.yaml
50
+ codebase_rag/analyzers/ast_grep_rules/security/typescript.yaml
51
+ codebase_rag/analyzers/ast_grep_rules/smells/javascript.yaml
52
+ codebase_rag/analyzers/ast_grep_rules/smells/python.yaml
53
+ codebase_rag/analyzers/ast_grep_rules/smells/tsx.yaml
54
+ codebase_rag/analyzers/ast_grep_rules/smells/typescript.yaml
41
55
  codebase_rag/constants/__init__.py
42
56
  codebase_rag/constants/ast_cpp.py
43
57
  codebase_rag/constants/ast_csharp.py
@@ -65,11 +79,13 @@ codebase_rag/constants/mcp.py
65
79
  codebase_rag/constants/providers.py
66
80
  codebase_rag/constants/security.py
67
81
  codebase_rag/constants/stdlib_types.py
82
+ codebase_rag/constants/structural.py
68
83
  codebase_rag/mcp/__init__.py
69
84
  codebase_rag/mcp/client.py
70
85
  codebase_rag/mcp/server.py
71
86
  codebase_rag/mcp/tools.py
72
87
  codebase_rag/parsers/__init__.py
88
+ codebase_rag/parsers/ast_grep_tier.py
73
89
  codebase_rag/parsers/call_processor.py
74
90
  codebase_rag/parsers/call_resolver.py
75
91
  codebase_rag/parsers/definition_processor.py
@@ -83,6 +99,7 @@ codebase_rag/parsers/stdlib_extractor.py
83
99
  codebase_rag/parsers/structure_processor.py
84
100
  codebase_rag/parsers/type_inference.py
85
101
  codebase_rag/parsers/utils.py
102
+ codebase_rag/parsers/ast_grep_patterns/ruby.yaml
86
103
  codebase_rag/parsers/class_ingest/__init__.py
87
104
  codebase_rag/parsers/class_ingest/cpp_modules.py
88
105
  codebase_rag/parsers/class_ingest/identity.py
@@ -103,7 +120,13 @@ codebase_rag/parsers/cpp_frontend/qn.py
103
120
  codebase_rag/parsers/csharp/__init__.py
104
121
  codebase_rag/parsers/csharp/type_inference.py
105
122
  codebase_rag/parsers/csharp/utils.py
123
+ codebase_rag/parsers/csharp_frontend/__init__.py
124
+ codebase_rag/parsers/csharp_frontend/frontend.py
125
+ codebase_rag/parsers/csharp_frontend/roslyn/Frontend.cs
126
+ codebase_rag/parsers/csharp_frontend/roslyn/Frontend.csproj
127
+ codebase_rag/parsers/csharp_frontend/roslyn/Program.cs
106
128
  codebase_rag/parsers/dart/__init__.py
129
+ codebase_rag/parsers/dart/type_inference.py
107
130
  codebase_rag/parsers/dart/utils.py
108
131
  codebase_rag/parsers/flow_access/__init__.py
109
132
  codebase_rag/parsers/flow_access/constants.py
@@ -168,6 +191,7 @@ codebase_rag/stack/constants.py
168
191
  codebase_rag/stack/health.py
169
192
  codebase_rag/stack/manager.py
170
193
  codebase_rag/tools/__init__.py
194
+ codebase_rag/tools/ast_grep_service.py
171
195
  codebase_rag/tools/code_retrieval.py
172
196
  codebase_rag/tools/codebase_query.py
173
197
  codebase_rag/tools/directory_lister.py
@@ -178,6 +202,8 @@ codebase_rag/tools/health_checker.py
178
202
  codebase_rag/tools/language.py
179
203
  codebase_rag/tools/semantic_search.py
180
204
  codebase_rag/tools/shell_command.py
205
+ codebase_rag/tools/structural_editor.py
206
+ codebase_rag/tools/structural_search.py
181
207
  codebase_rag/tools/tool_descriptions.py
182
208
  codebase_rag/utils/__init__.py
183
209
  codebase_rag/utils/dependencies.py
@@ -1,5 +1,5 @@
1
1
  loguru>=0.7.3
2
- mcp>=1.25.0
2
+ mcp>=1.28.1
3
3
  pydantic-ai>=1.102.0
4
4
  pydantic-settings>=2.12.0
5
5
  pymgclient>=1.5.1
@@ -20,6 +20,13 @@ huggingface-hub[hf-xet]>=1.7.2
20
20
  griffe<2,>=1.0
21
21
  pathspec>=1.0.4
22
22
 
23
+ [ast-grep]
24
+ ast-grep-py>=0.44.0
25
+ pyyaml>=6.0
26
+
27
+ [milvus]
28
+ pymilvus[milvus-lite]>=3.0.0
29
+
23
30
  [semantic]
24
31
  qdrant-client>=1.9.0
25
32
  torch>=2.6.0
@@ -33,6 +40,8 @@ pytest-xdist>=3.8.0
33
40
  testcontainers>=4.9.0
34
41
  libclang>=18.1.1
35
42
  filelock>=3.12
43
+ ast-grep-py>=0.44.0
44
+ pyyaml>=6.0
36
45
 
37
46
  [treesitter-full]
38
47
  tree-sitter-python>=0.23.6
@@ -0,0 +1,4 @@
1
+ # ast-grep finding analyzers (issue #413).
2
+ from .ast_grep_analyzer import FindingAnalyzer, load_finding_rules
3
+
4
+ __all__ = ["FindingAnalyzer", "load_finding_rules"]
@@ -0,0 +1,201 @@
1
+ # ast-grep finding analyzer (issue #413). A post-pass over indexed source
2
+ # files that runs categorized ast-grep YAML rules and emits
3
+ # Pattern/CodeSmell/SecurityIssue nodes linked to each file's Module. Rules
4
+ # live in ast_grep_rules/{patterns,smells,security}/<lang>.yaml; a new rule is
5
+ # a YAML entry, no code. The FINDINGS capture group is opt-in, so the analyzer
6
+ # no-ops entirely unless a finding relationship is enabled. Findings link to
7
+ # the Module (not the enclosing Class/Function); the finding node carries the
8
+ # line so the site is still locatable. Symbol-level linkage is a follow-up.
9
+ from __future__ import annotations
10
+
11
+ import logging
12
+ from dataclasses import dataclass
13
+ from pathlib import Path
14
+ from typing import TYPE_CHECKING, Any
15
+
16
+ from .. import constants as cs
17
+ from ..utils.path_utils import cached_relative_path
18
+
19
+ if TYPE_CHECKING:
20
+ from ..capture import CaptureSelection
21
+ from ..services import IngestorProtocol
22
+
23
+ logger = logging.getLogger(__name__)
24
+
25
+ _RULES_DIR = Path(__file__).parent / "ast_grep_rules"
26
+ _SNIPPET_MAX = 200
27
+
28
+ # rule-category directory name -> (finding node label, relationship type).
29
+ _CATEGORY_MAP: dict[str, tuple[cs.NodeLabel, cs.RelationshipType]] = {
30
+ "patterns": (cs.NodeLabel.PATTERN, cs.RelationshipType.IMPLEMENTS_PATTERN),
31
+ "smells": (cs.NodeLabel.CODE_SMELL, cs.RelationshipType.HAS_SMELL),
32
+ "security": (cs.NodeLabel.SECURITY_ISSUE, cs.RelationshipType.HAS_VULNERABILITY),
33
+ }
34
+
35
+
36
+ @dataclass(frozen=True)
37
+ class _Rule:
38
+ rule_id: str
39
+ message: str
40
+ body: dict[str, Any] # ast-grep rule body, splatted into find_all(**body)
41
+ node_label: cs.NodeLabel
42
+ rel_type: cs.RelationshipType
43
+
44
+
45
+ @dataclass(frozen=True)
46
+ class _LangRules:
47
+ ast_grep_id: str
48
+ rules: tuple[_Rule, ...]
49
+
50
+
51
+ def load_finding_rules() -> dict[str, _LangRules]:
52
+ """Load ast_grep_rules/<category>/*.yaml, merged per file extension."""
53
+ lang_id_by_ext: dict[str, str] = {}
54
+ rules_by_ext: dict[str, list[_Rule]] = {}
55
+ for category_dir in sorted(_RULES_DIR.iterdir()):
56
+ mapping = _CATEGORY_MAP.get(category_dir.name)
57
+ if not category_dir.is_dir() or mapping is None:
58
+ continue
59
+ node_label, rel_type = mapping
60
+ for path in sorted(category_dir.glob("*.yaml")):
61
+ ast_grep_id, extensions, rules = _parse_rule_file(
62
+ path, node_label, rel_type
63
+ )
64
+ for ext in extensions:
65
+ lang_id_by_ext[ext] = ast_grep_id
66
+ rules_by_ext.setdefault(ext, []).extend(rules)
67
+ return {
68
+ ext: _LangRules(lang_id_by_ext[ext], tuple(rules))
69
+ for ext, rules in rules_by_ext.items()
70
+ }
71
+
72
+
73
+ def _parse_rule_file(
74
+ path: Path, node_label: cs.NodeLabel, rel_type: cs.RelationshipType
75
+ ) -> tuple[str, list[str], list[_Rule]]:
76
+ import yaml
77
+
78
+ data = yaml.safe_load(path.read_text(encoding="utf-8")) or {}
79
+ ast_grep_id = data.get("ast_grep_id")
80
+ extensions = data.get("extensions")
81
+ if isinstance(extensions, str):
82
+ extensions = [ext.strip() for ext in extensions.split(",") if ext.strip()]
83
+ if not ast_grep_id or not extensions:
84
+ raise ValueError(f"{path.name}: 'ast_grep_id' and 'extensions' are required")
85
+ rules = [
86
+ _Rule(
87
+ rule_id=str(entry["id"]),
88
+ message=str(entry.get("message", entry["id"])),
89
+ body=entry["rule"],
90
+ node_label=node_label,
91
+ rel_type=rel_type,
92
+ )
93
+ for entry in (data.get("rules") or [])
94
+ ]
95
+ return str(ast_grep_id), list(extensions), rules
96
+
97
+
98
+ class FindingAnalyzer:
99
+ """Runs ast-grep finding rules over indexed files and emits finding nodes."""
100
+
101
+ __slots__ = ("_ingestor", "_repo_path", "_enabled", "_rules")
102
+
103
+ def __init__(
104
+ self,
105
+ ingestor: IngestorProtocol,
106
+ repo_path: Path,
107
+ selection: CaptureSelection,
108
+ ) -> None:
109
+ self._ingestor = ingestor
110
+ self._repo_path = repo_path
111
+ finding_rels = cs.CAPTURE_GROUP_RELS[cs.CaptureGroup.FINDINGS]
112
+ self._enabled = any(selection.rel_enabled(rel) for rel in finding_rels)
113
+ self._rules: dict[str, _LangRules] = {}
114
+ if not self._enabled:
115
+ return
116
+ try:
117
+ import ast_grep_py # noqa: F401
118
+
119
+ self._rules = load_finding_rules()
120
+ except ImportError:
121
+ # ast-grep/pyyaml are the [ast-grep] extra; no-op if absent.
122
+ logger.warning("ast-grep-py unavailable; finding analyzer disabled")
123
+ except Exception as exc: # noqa: BLE001
124
+ # a malformed shipped rule file must not crash indexing.
125
+ logger.warning("ast-grep finding analyzer disabled: %s", exc)
126
+
127
+ def analyze(self, module_qn_to_file_path: dict[str, Path]) -> None:
128
+ if not self._enabled or not self._rules:
129
+ return
130
+ from ast_grep_py import SgRoot
131
+
132
+ for module_qn, file_path in module_qn_to_file_path.items():
133
+ lang_rules = self._rules.get(file_path.suffix)
134
+ if lang_rules is None:
135
+ continue
136
+ try:
137
+ raw = file_path.read_bytes()
138
+ except OSError:
139
+ continue
140
+ # decode with replacement so a few malformed bytes don't skip the
141
+ # whole file; ast-grep tolerates U+FFFD in the source.
142
+ source = raw.decode("utf-8", errors="replace")
143
+ try:
144
+ root = SgRoot(source, lang_rules.ast_grep_id).root()
145
+ except (RuntimeError, ValueError) as exc:
146
+ logger.warning("ast-grep failed to parse %s: %s", file_path, exc)
147
+ continue
148
+ relative_path = cached_relative_path(file_path, self._repo_path).as_posix()
149
+ for rule in lang_rules.rules:
150
+ self._emit_rule(root, rule, module_qn, relative_path, file_path)
151
+
152
+ def _emit_rule(
153
+ self,
154
+ root: Any,
155
+ rule: _Rule,
156
+ module_qn: str,
157
+ relative_path: str,
158
+ file_path: Path,
159
+ ) -> None:
160
+ try:
161
+ matches = root.find_all(**rule.body)
162
+ except (RuntimeError, TypeError, ValueError) as exc:
163
+ logger.warning(
164
+ "bad ast-grep rule %r for %s: %s", rule.rule_id, file_path, exc
165
+ )
166
+ return
167
+ for node in matches:
168
+ self._emit_finding(rule, node, module_qn, relative_path)
169
+
170
+ def _emit_finding(
171
+ self, rule: _Rule, node: Any, module_qn: str, relative_path: str
172
+ ) -> None:
173
+ node_range = node.range()
174
+ start_line = node_range.start.line + 1
175
+ end_line = node_range.end.line + 1
176
+ # qn scopes the finding to file+line+column+rule so two matches of one
177
+ # rule on the same line stay distinct, while re-indexing merges the
178
+ # same site idempotently.
179
+ qualified_name = cs.SEPARATOR_DOT.join(
180
+ [module_qn, str(start_line), str(node_range.start.column), rule.rule_id]
181
+ )
182
+ snippet = node.text()
183
+ if len(snippet) > _SNIPPET_MAX:
184
+ snippet = snippet[:_SNIPPET_MAX]
185
+ self._ingestor.ensure_node_batch(
186
+ rule.node_label,
187
+ {
188
+ cs.KEY_QUALIFIED_NAME: qualified_name,
189
+ cs.KEY_NAME: rule.rule_id,
190
+ cs.KEY_MESSAGE: rule.message,
191
+ cs.KEY_START_LINE: start_line,
192
+ cs.KEY_END_LINE: end_line,
193
+ cs.KEY_PATH: relative_path,
194
+ cs.KEY_SNIPPET: snippet,
195
+ },
196
+ )
197
+ self._ingestor.ensure_relationship_batch(
198
+ (cs.NodeLabel.MODULE, cs.KEY_QUALIFIED_NAME, module_qn),
199
+ rule.rel_type,
200
+ (rule.node_label, cs.KEY_QUALIFIED_NAME, qualified_name),
201
+ )