code-graph-rag 0.0.148__tar.gz → 0.0.187__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.
- {code_graph_rag-0.0.148/code_graph_rag.egg-info → code_graph_rag-0.0.187}/PKG-INFO +17 -13
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/README.md +114 -25
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187/code_graph_rag.egg-info}/PKG-INFO +17 -13
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/code_graph_rag.egg-info/SOURCES.txt +23 -1
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/code_graph_rag.egg-info/requires.txt +15 -12
- code_graph_rag-0.0.187/codebase_rag/cgr_state.py +57 -0
- code_graph_rag-0.0.187/codebase_rag/cli.py +1164 -0
- code_graph_rag-0.0.187/codebase_rag/cli_help.py +234 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/config.py +41 -6
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/constants.py +414 -78
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/cypher_queries.py +71 -0
- code_graph_rag-0.0.187/codebase_rag/docker-compose.yaml +27 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/embedder.py +11 -1
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/exceptions.py +17 -1
- code_graph_rag-0.0.187/codebase_rag/graph_updater.py +1215 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/language_spec.py +62 -19
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/logs.py +74 -17
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/main.py +684 -86
- code_graph_rag-0.0.187/codebase_rag/mcp/client.py +65 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/mcp/server.py +25 -14
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/mcp/tools.py +158 -3
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/models.py +16 -1
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parser_loader.py +26 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/call_processor.py +1487 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/call_resolver.py +397 -16
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/cpp_modules.py +17 -20
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/identity.py +15 -11
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/mixin.py +197 -40
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/node_type.py +20 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/parent_extraction.py +102 -11
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/relationships.py +6 -2
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/cpp/utils.py +28 -20
- code_graph_rag-0.0.187/codebase_rag/parsers/cpp_frontend/__init__.py +14 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/cpp_frontend/constants.py +39 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/cpp_frontend/frontend.py +364 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/cpp_frontend/qn.py +171 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/definition_processor.py +89 -24
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/factory.py +3 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/function_ingest.py +316 -53
- code_graph_rag-0.0.187/codebase_rag/parsers/go/__init__.py +6 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/go/utils.py +36 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/handlers/php.py +62 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/registry.py +2 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/rust.py +5 -6
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/import_processor.py +105 -5
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/method_resolver.py +75 -5
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/type_inference.py +4 -2
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/utils.py +26 -5
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/variable_analyzer.py +110 -37
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/js_ts/ingest.py +24 -10
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/js_ts/module_system.py +9 -8
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/js_ts/type_inference.py +84 -14
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/js_ts/utils.py +38 -8
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/py/ast_analyzer.py +82 -18
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/py/expression_analyzer.py +11 -2
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/py/type_inference.py +15 -0
- code_graph_rag-0.0.187/codebase_rag/parsers/py/variable_analyzer.py +573 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/rs/utils.py +17 -6
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/stdlib_extractor.py +73 -170
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/structure_processor.py +16 -13
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/type_inference.py +2 -1
- code_graph_rag-0.0.187/codebase_rag/parsers/utils.py +350 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/prompts.py +80 -7
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/providers/base.py +43 -2
- code_graph_rag-0.0.187/codebase_rag/providers/litellm.py +50 -0
- code_graph_rag-0.0.187/codebase_rag/services/anthropic_token_counter.py +154 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/services/graph_service.py +28 -2
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/services/llm.py +53 -17
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/services/protobuf_service.py +42 -27
- code_graph_rag-0.0.187/codebase_rag/stack/__init__.py +21 -0
- code_graph_rag-0.0.187/codebase_rag/stack/cli.py +83 -0
- code_graph_rag-0.0.187/codebase_rag/stack/constants.py +51 -0
- code_graph_rag-0.0.187/codebase_rag/stack/health.py +60 -0
- code_graph_rag-0.0.187/codebase_rag/stack/manager.py +262 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tool_errors.py +3 -20
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/codebase_query.py +16 -1
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/shell_command.py +23 -7
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/tool_descriptions.py +28 -9
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/types_defs.py +50 -3
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/unixcoder.py +2 -3
- code_graph_rag-0.0.187/codebase_rag/utils/path_utils.py +87 -0
- code_graph_rag-0.0.187/codebase_rag/utils/rich_markdown.py +30 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/vector_store.py +12 -1
- code_graph_rag-0.0.187/codebase_rag/workspaces/__init__.py +28 -0
- code_graph_rag-0.0.187/codebase_rag/workspaces/cli.py +102 -0
- code_graph_rag-0.0.187/codebase_rag/workspaces/constants.py +24 -0
- code_graph_rag-0.0.187/codebase_rag/workspaces/models.py +29 -0
- code_graph_rag-0.0.187/codebase_rag/workspaces/storage.py +125 -0
- code_graph_rag-0.0.187/codec/schema_pb2.py +62 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/pyproject.toml +26 -13
- code_graph_rag-0.0.148/codebase_rag/cli.py +0 -588
- code_graph_rag-0.0.148/codebase_rag/cli_help.py +0 -108
- code_graph_rag-0.0.148/codebase_rag/graph_updater.py +0 -644
- code_graph_rag-0.0.148/codebase_rag/parsers/call_processor.py +0 -366
- code_graph_rag-0.0.148/codebase_rag/parsers/py/variable_analyzer.py +0 -301
- code_graph_rag-0.0.148/codebase_rag/parsers/utils.py +0 -179
- code_graph_rag-0.0.148/codebase_rag/tools/document_analyzer.py +0 -171
- code_graph_rag-0.0.148/codebase_rag/utils/path_utils.py +0 -27
- code_graph_rag-0.0.148/codec/schema_pb2.py +0 -61
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/LICENSE +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/PYPI_README.md +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/cgr/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/code_graph_rag.egg-info/dependency_links.txt +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/code_graph_rag.egg-info/entry_points.txt +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/code_graph_rag.egg-info/top_level.txt +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/decorators.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/graph_loader.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/mcp/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/method_override.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/class_ingest/utils.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/cpp/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/dependency_parser.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/base.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/cpp.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/java.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/js_ts.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/lua.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/protocol.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/handlers/python.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/java/type_resolver.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/js_ts/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/lua/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/lua/type_inference.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/lua/utils.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/py/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/py/utils.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/parsers/rs/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/providers/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/readme_sections.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/schema_builder.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/schemas.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/services/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/code_retrieval.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/directory_lister.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/file_editor.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/file_reader.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/file_writer.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/health_checker.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/language.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/tools/semantic_search.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/utils/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/utils/dependencies.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/utils/fqn_resolver.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/utils/source_extraction.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codebase_rag/utils/token_utils.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codec/__init__.py +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/codec/schema_pb2.pyi +0 -0
- {code_graph_rag-0.0.148 → code_graph_rag-0.0.187}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.187
|
|
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
|
|
@@ -14,34 +14,37 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
18
|
Requires-Python: >=3.12
|
|
18
19
|
Description-Content-Type: text/markdown
|
|
19
20
|
License-File: LICENSE
|
|
20
21
|
Requires-Dist: loguru>=0.7.3
|
|
21
|
-
Requires-Dist: mcp>=1.
|
|
22
|
-
Requires-Dist: pydantic-ai>=1.
|
|
23
|
-
Requires-Dist: pydantic-settings>=2.
|
|
24
|
-
Requires-Dist: pymgclient>=1.
|
|
25
|
-
Requires-Dist: python-dotenv>=1.1
|
|
22
|
+
Requires-Dist: mcp>=1.25.0
|
|
23
|
+
Requires-Dist: pydantic-ai>=1.102.0
|
|
24
|
+
Requires-Dist: pydantic-settings>=2.12.0
|
|
25
|
+
Requires-Dist: pymgclient>=1.5.1
|
|
26
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
26
27
|
Requires-Dist: tiktoken>=0.12.0
|
|
27
28
|
Requires-Dist: toml>=0.10.2
|
|
28
|
-
Requires-Dist: tree-sitter-python>=0.
|
|
29
|
+
Requires-Dist: tree-sitter-python>=0.25.0
|
|
29
30
|
Requires-Dist: tree-sitter==0.25.2
|
|
30
31
|
Requires-Dist: watchdog>=6.0.0
|
|
31
|
-
Requires-Dist: typer>=0.
|
|
32
|
-
Requires-Dist: rich>=
|
|
33
|
-
Requires-Dist: prompt-toolkit>=3.0.
|
|
32
|
+
Requires-Dist: typer>=0.21.1
|
|
33
|
+
Requires-Dist: rich>=14.2.0
|
|
34
|
+
Requires-Dist: prompt-toolkit>=3.0.52
|
|
34
35
|
Requires-Dist: diff-match-patch>=20241021
|
|
35
|
-
Requires-Dist: click>=8.
|
|
36
|
-
Requires-Dist: protobuf>=
|
|
36
|
+
Requires-Dist: click>=8.3.1
|
|
37
|
+
Requires-Dist: protobuf>=6.33.5
|
|
37
38
|
Requires-Dist: defusedxml>=0.7.1
|
|
38
|
-
Requires-Dist: huggingface-hub[hf-xet]>=
|
|
39
|
+
Requires-Dist: huggingface-hub[hf-xet]>=1.7.2
|
|
40
|
+
Requires-Dist: griffe<2,>=1.0
|
|
39
41
|
Provides-Extra: test
|
|
40
42
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
41
43
|
Requires-Dist: pytest-asyncio>=1.0.0; extra == "test"
|
|
42
44
|
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
43
45
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
44
46
|
Requires-Dist: testcontainers>=4.9.0; extra == "test"
|
|
47
|
+
Requires-Dist: libclang>=18.1.1; extra == "test"
|
|
45
48
|
Provides-Extra: treesitter-full
|
|
46
49
|
Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
|
|
47
50
|
Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
|
|
@@ -53,6 +56,7 @@ Requires-Dist: tree-sitter-java>=0.23.5; extra == "treesitter-full"
|
|
|
53
56
|
Requires-Dist: tree-sitter-c>=0.24.1; extra == "treesitter-full"
|
|
54
57
|
Requires-Dist: tree-sitter-cpp>=0.23.0; extra == "treesitter-full"
|
|
55
58
|
Requires-Dist: tree-sitter-lua>=0.0.19; extra == "treesitter-full"
|
|
59
|
+
Requires-Dist: tree-sitter-php>=0.24.1; extra == "treesitter-full"
|
|
56
60
|
Provides-Extra: semantic
|
|
57
61
|
Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
|
|
58
62
|
Requires-Dist: torch>=2.6.0; extra == "semantic"
|
|
@@ -1,38 +1,54 @@
|
|
|
1
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:
|
|
2
3
|
<picture>
|
|
3
4
|
<source srcset="assets/logo-dark-any.png" media="(prefers-color-scheme: dark)">
|
|
4
5
|
<source srcset="assets/logo-light-any.png" media="(prefers-color-scheme: light)">
|
|
5
6
|
<img src="assets/logo-dark-any.png" alt="Code-Graph-RAG Logo" width="480">
|
|
6
7
|
</picture>
|
|
8
|
+
-->
|
|
9
|
+
<img src="assets/logo-light-any.png" alt="Code-Graph-RAG Logo" width="480">
|
|
7
10
|
|
|
8
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.
|
|
9
16
|
<a href="https://github.com/vitali87/code-graph-rag/stargazers">
|
|
10
17
|
<img src="https://img.shields.io/github/stars/vitali87/code-graph-rag?style=social" alt="GitHub stars" />
|
|
11
18
|
</a>
|
|
12
19
|
<a href="https://github.com/vitali87/code-graph-rag/network/members">
|
|
13
20
|
<img src="https://img.shields.io/github/forks/vitali87/code-graph-rag?style=social" alt="GitHub forks" />
|
|
14
21
|
</a>
|
|
22
|
+
-->
|
|
23
|
+
<!-- Codecov, SonarCloud, and OpenSSF Scorecard badges were fed by GitHub-side CI. They no longer update after the move to Codeberg. Restore once equivalent CI is in place on Codeberg (Woodpecker).
|
|
15
24
|
<a href="https://codecov.io/gh/vitali87/code-graph-rag">
|
|
16
25
|
<img src="https://codecov.io/gh/vitali87/code-graph-rag/graph/badge.svg" alt="Codecov" />
|
|
17
26
|
</a>
|
|
18
27
|
<a href="https://sonarcloud.io/summary/overall?id=vitali87_code-graph-rag">
|
|
19
28
|
<img src="https://sonarcloud.io/api/project_badges/measure?project=vitali87_code-graph-rag&metric=alert_status" alt="Quality Gate Status" />
|
|
20
29
|
</a>
|
|
30
|
+
-->
|
|
31
|
+
<!--
|
|
21
32
|
<a href="https://mseep.ai/app/vitali87-code-graph-rag">
|
|
22
33
|
<img src="https://mseep.net/pr/vitali87-code-graph-rag-badge.png" alt="MseeP.ai Security Assessment" height="20" />
|
|
23
34
|
</a>
|
|
35
|
+
-->
|
|
24
36
|
<a href="https://code-graph-rag.com">
|
|
25
37
|
<img src="https://img.shields.io/badge/Enterprise-Support%20%26%20Services-6366f1" alt="Enterprise Support" />
|
|
26
38
|
</a>
|
|
27
39
|
<a href="https://pepy.tech/projects/code-graph-rag">
|
|
28
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" />
|
|
29
41
|
</a>
|
|
42
|
+
<!-- OpenSSF Scorecard only tracks GitHub-hosted repos. Restore if the project is mirrored back to GitHub or scorecard.dev adds Codeberg support.
|
|
30
43
|
<a href="https://scorecard.dev/viewer/?uri=github.com/vitali87/code-graph-rag">
|
|
31
44
|
<img src="https://api.scorecard.dev/projects/github.com/vitali87/code-graph-rag/badge" alt="OpenSSF Scorecard" />
|
|
32
45
|
</a>
|
|
46
|
+
-->
|
|
47
|
+
<!--
|
|
33
48
|
<a href="https://gitcgr.com/vitali87/code-graph-rag">
|
|
34
49
|
<img src="https://gitcgr.com/badge/vitali87/code-graph-rag.svg" alt="gitcgr" />
|
|
35
50
|
</a>
|
|
51
|
+
-->
|
|
36
52
|
</p>
|
|
37
53
|
</div>
|
|
38
54
|
|
|
@@ -47,9 +63,9 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
|
|
|
47
63
|
|
|
48
64
|
## Latest News 🔥
|
|
49
65
|
|
|
66
|
+
- **PHP Language Support**: Full PHP language support added — classes, interfaces, traits, enums, namespaces, PHP 8 attributes, and call graph analysis. Contributed by [@rs-ipps](https://github.com/rs-ipps).
|
|
50
67
|
- **C Language Support**: Full C language support added — functions, structs, unions, enums, preprocessor includes, and call graph analysis. Contributed by [@dj0nes](https://github.com/dj0nes).
|
|
51
68
|
- **Visualise any GitHub repo instantly!** Just change `github.com` to `gitcgr.com` in any repo URL — that's it, only 3 letters! Get an interactive graph of the entire codebase structure. Try it now: [gitcgr.com](https://gitcgr.com)
|
|
52
|
-
- **MCP Server Integration**: Code-Graph-RAG now works as an MCP server with Claude Code! Query and edit your codebase using natural language directly from Claude Code. [Setup Guide](docs/claude-code-setup.md)
|
|
53
69
|
|
|
54
70
|
## 🚀 Features
|
|
55
71
|
|
|
@@ -63,12 +79,11 @@ An accurate Retrieval-Augmented Generation (RAG) system that analyzes multi-lang
|
|
|
63
79
|
| Java | Fully Supported | .java | ✓ | ✓ | ✓ | - | Generics, annotations, modern features (records/sealed classes), concurrency, reflection |
|
|
64
80
|
| JavaScript | Fully Supported | .js, .jsx | ✓ | ✓ | ✓ | - | ES6 modules, CommonJS, prototype methods, object methods, arrow functions |
|
|
65
81
|
| Lua | Fully Supported | .lua | ✓ | - | ✓ | - | Local/global functions, metatables, closures, coroutines |
|
|
82
|
+
| PHP | Fully Supported | .php | ✓ | ✓ | ✓ | - | Classes, interfaces, traits, enums, namespaces, PHP 8 attributes |
|
|
66
83
|
| Python | Fully Supported | .py | ✓ | ✓ | ✓ | ✓ | Type inference, decorators, nested functions |
|
|
67
84
|
| Rust | Fully Supported | .rs | ✓ | ✓ | ✓ | ✓ | impl blocks, associated functions |
|
|
68
85
|
| TypeScript | Fully Supported | .ts, .tsx | ✓ | ✓ | ✓ | - | Interfaces, type aliases, enums, namespaces, ES6/CommonJS modules |
|
|
69
|
-
| C# | In Development | .cs | ✓ | ✓ | ✓ | - | Classes, interfaces, generics (planned) |
|
|
70
86
|
| Go | In Development | .go | ✓ | ✓ | ✓ | - | Methods, type declarations |
|
|
71
|
-
| PHP | In Development | .php | ✓ | ✓ | ✓ | - | Classes, functions, namespaces |
|
|
72
87
|
| Scala | In Development | .scala, .sc | ✓ | ✓ | ✓ | - | Case classes, objects |
|
|
73
88
|
<!-- /SECTION:supported_languages -->
|
|
74
89
|
- **🌳 Tree-sitter Parsing**: Uses Tree-sitter for robust, language-agnostic AST parsing
|
|
@@ -125,9 +140,54 @@ sudo dnf install ripgrep
|
|
|
125
140
|
|
|
126
141
|
## 🛠️ Installation
|
|
127
142
|
|
|
143
|
+
### System-wide install (recommended for end users)
|
|
144
|
+
|
|
145
|
+
`cgr` is published to PyPI and can be installed system-wide so it works from any
|
|
146
|
+
target repo without activating a project virtualenv. Install with the
|
|
147
|
+
`treesitter-full` (all languages) and `semantic` (vector search) extras:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# with uv (recommended)
|
|
151
|
+
uv tool install "code-graph-rag[treesitter-full,semantic]"
|
|
152
|
+
|
|
153
|
+
# or with pipx
|
|
154
|
+
pipx install "code-graph-rag[treesitter-full,semantic]"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
For a Python-only install, omit the extras. For local development from a clone,
|
|
158
|
+
use `uv tool install --editable "/path/to/code-graph-rag[treesitter-full,semantic]"`.
|
|
159
|
+
|
|
160
|
+
After install, `cgr` is on PATH. From any repository, run:
|
|
161
|
+
|
|
128
162
|
```bash
|
|
129
|
-
|
|
163
|
+
cd ~/path/to/some-target-repo
|
|
164
|
+
cgr daemon up # one-time: start the shared memgraph + qdrant stack
|
|
165
|
+
cgr start # auto-sync the current repo and drop into the agent
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`cgr start` defaults `--repo-path` to the current directory and auto-syncs the
|
|
169
|
+
graph incrementally on entry. Pass `--no-sync` to skip the sync, or
|
|
170
|
+
`--no-start-stack` if memgraph/qdrant already run elsewhere.
|
|
171
|
+
|
|
172
|
+
Useful subcommands:
|
|
173
|
+
|
|
174
|
+
| Command | Purpose |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `cgr daemon up/down/status/restart/logs` | Manage the shared docker stack |
|
|
177
|
+
| `cgr stop` | Alias for `cgr daemon down` |
|
|
178
|
+
| `cgr status` | Show stack state + per-project last-sync timestamp |
|
|
179
|
+
| `cgr workspace create/list/show/delete` | Manage named bundles of repos |
|
|
180
|
+
| `cgr workspace add-repo / remove-repo` | Edit a workspace's repo set |
|
|
181
|
+
| `cgr start --workspace mono` | Open the agent over every project in the workspace |
|
|
182
|
+
| `cgr start --projects a,b,c` | Scope agent queries to the listed projects |
|
|
183
|
+
|
|
184
|
+
Indexed data persists across `cgr daemon down` thanks to named memgraph + qdrant
|
|
185
|
+
volumes (`memgraph_data`, `memgraph_log`, `qdrant_storage`).
|
|
186
|
+
|
|
187
|
+
### Local development install
|
|
130
188
|
|
|
189
|
+
```bash
|
|
190
|
+
git clone https://codeberg.org/vitali87/code-graph-rag.git
|
|
131
191
|
cd code-graph-rag
|
|
132
192
|
```
|
|
133
193
|
|
|
@@ -232,9 +292,20 @@ ollama pull llama3.2
|
|
|
232
292
|
|
|
233
293
|
4. **Start Memgraph database**:
|
|
234
294
|
```bash
|
|
235
|
-
docker
|
|
295
|
+
docker compose up -d
|
|
236
296
|
```
|
|
237
297
|
|
|
298
|
+
5. **Verify installation**:
|
|
299
|
+
```bash
|
|
300
|
+
# If installed from PyPI:
|
|
301
|
+
cgr --help
|
|
302
|
+
|
|
303
|
+
# If running from source:
|
|
304
|
+
uv run cgr --help
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
> **Note**: When running from source (cloned repo), prefix all `cgr` commands below with `uv run`, e.g., `uv run cgr start ...`
|
|
308
|
+
|
|
238
309
|
## 🛠️ Makefile Commands
|
|
239
310
|
|
|
240
311
|
Use the Makefile for common development tasks:
|
|
@@ -298,12 +369,23 @@ The system automatically detects and processes files for all supported languages
|
|
|
298
369
|
|
|
299
370
|
### Step 2: Query the Codebase
|
|
300
371
|
|
|
372
|
+
**Interactive mode:**
|
|
373
|
+
|
|
301
374
|
Start the interactive RAG CLI:
|
|
302
375
|
|
|
303
376
|
```bash
|
|
304
377
|
cgr start --repo-path /path/to/your/repo
|
|
305
378
|
```
|
|
306
379
|
|
|
380
|
+
**Non-interactive mode (single query):**
|
|
381
|
+
|
|
382
|
+
Run a single query and exit, with output sent to stdout (useful for scripting):
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
python -m codebase_rag.main start --repo-path /path/to/your/repo \
|
|
386
|
+
--ask-agent "What functions call UserService.create_user?"
|
|
387
|
+
```
|
|
388
|
+
|
|
307
389
|
### Step 2.5: Real-Time Graph Updates (Optional)
|
|
308
390
|
|
|
309
391
|
For active development, you can keep your knowledge graph automatically synchronized with code changes using the realtime updater. This is particularly useful when you're actively modifying code and want the AI assistant to always work with the latest codebase structure.
|
|
@@ -546,13 +628,16 @@ claude mcp add --transport stdio code-graph-rag \
|
|
|
546
628
|
| `list_projects` | List all indexed projects in the knowledge graph database. Returns a list of project names that have been indexed. |
|
|
547
629
|
| `delete_project` | Delete a specific project from the knowledge graph database. This removes all nodes associated with the project while preserving other projects. Use list_projects first to see available projects. |
|
|
548
630
|
| `wipe_database` | WARNING: Completely wipe the entire database, removing ALL indexed projects. This cannot be undone. Use delete_project for removing individual projects. |
|
|
549
|
-
| `index_repository` | Parse and ingest the repository into the Memgraph knowledge graph.
|
|
550
|
-
| `
|
|
631
|
+
| `index_repository` | WARNING: Clears all data for the current project including its embeddings. Parse and ingest the repository into the Memgraph knowledge graph. Use update_repository for incremental updates. Only use when explicitly requested. |
|
|
632
|
+
| `update_repository` | Update the repository in the Memgraph knowledge graph without clearing existing data. Use this for incremental updates. |
|
|
633
|
+
| `query_code_graph` | Query the codebase knowledge graph using natural language. Use semantic_search unless you know the exact names of classes/functions you are searching for. Ask questions like 'What functions call UserService.create_user?' or 'Show me all classes that implement the Repository interface'. |
|
|
551
634
|
| `get_code_snippet` | Retrieve source code for a function, class, or method by its qualified name. Returns the source code, file path, line numbers, and docstring. |
|
|
552
635
|
| `surgical_replace_code` | Surgically replace an exact code block in a file using diff-match-patch. Only modifies the exact target block, leaving the rest unchanged. |
|
|
553
636
|
| `read_file` | Read the contents of a file from the project. Supports pagination for large files. |
|
|
554
637
|
| `write_file` | Write content to a file, creating it if it doesn't exist. |
|
|
555
638
|
| `list_directory` | List contents of a directory in the project. |
|
|
639
|
+
| `semantic_search` | Performs a semantic search for functions based on a natural language query describing their purpose, returning a list of potential matches with similarity scores. Requires the 'semantic' extra to be installed. |
|
|
640
|
+
| `ask_agent` | Ask the Code Graph RAG agent a question about the codebase. Uses the full RAG pipeline to analyze the code graph and provide a detailed answer. Use this for general questions about architecture, functionality, and code relationships. |
|
|
556
641
|
<!-- /SECTION:mcp_tools -->
|
|
557
642
|
|
|
558
643
|
### Example Usage
|
|
@@ -575,36 +660,35 @@ The knowledge graph uses the following node types and relationships:
|
|
|
575
660
|
| Label | Properties |
|
|
576
661
|
|-----|----------|
|
|
577
662
|
| Project | `{name: string}` |
|
|
578
|
-
| Package | `{qualified_name: string, name: string, path: string}` |
|
|
579
|
-
| Folder | `{path: string, name: string}` |
|
|
580
|
-
| File | `{path: string, name: string, extension: string}` |
|
|
581
|
-
| Module | `{qualified_name: string, name: string, path: string}` |
|
|
582
|
-
| Class | `{qualified_name: string, name: string, decorators: list[string]}` |
|
|
583
|
-
| Function | `{qualified_name: string, name: string, decorators: list[string]}` |
|
|
584
|
-
| Method | `{qualified_name: string, name: string, decorators: list[string]}` |
|
|
585
|
-
| Interface | `{qualified_name: string, name: string}` |
|
|
586
|
-
| Enum | `{qualified_name: string, name: string}` |
|
|
663
|
+
| Package | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
664
|
+
| Folder | `{path: string, name: string, absolute_path: string}` |
|
|
665
|
+
| File | `{path: string, name: string, extension: string, absolute_path: string}` |
|
|
666
|
+
| Module | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
667
|
+
| Class | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
|
|
668
|
+
| Function | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
|
|
669
|
+
| Method | `{qualified_name: string, name: string, decorators: list[string], path: string, absolute_path: string}` |
|
|
670
|
+
| Interface | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
671
|
+
| Enum | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
587
672
|
| Type | `{qualified_name: string, name: string}` |
|
|
588
673
|
| Union | `{qualified_name: string, name: string}` |
|
|
589
|
-
| ModuleInterface | `{qualified_name: string, name: string, path: string}` |
|
|
590
|
-
| ModuleImplementation | `{qualified_name: string, name: string, path: string, implements_module: string}` |
|
|
674
|
+
| ModuleInterface | `{qualified_name: string, name: string, path: string, absolute_path: string}` |
|
|
675
|
+
| ModuleImplementation | `{qualified_name: string, name: string, path: string, absolute_path: string, implements_module: string}` |
|
|
591
676
|
| ExternalPackage | `{name: string, version_spec: string}` |
|
|
592
677
|
<!-- /SECTION:node_schemas -->
|
|
593
678
|
|
|
594
679
|
### Language-Specific Mappings
|
|
595
680
|
|
|
596
681
|
<!-- SECTION:language_mappings -->
|
|
597
|
-
- **C**: `function_definition`, `struct_specifier`, `union_specifier
|
|
682
|
+
- **C**: `enum_specifier`, `function_definition`, `struct_specifier`, `union_specifier`
|
|
598
683
|
- **C++**: `class_specifier`, `declaration`, `enum_specifier`, `field_declaration`, `function_definition`, `lambda_expression`, `struct_specifier`, `template_declaration`, `union_specifier`
|
|
599
684
|
- **Java**: `annotation_type_declaration`, `class_declaration`, `constructor_declaration`, `enum_declaration`, `interface_declaration`, `method_declaration`, `record_declaration`
|
|
600
685
|
- **JavaScript**: `arrow_function`, `class`, `class_declaration`, `function_declaration`, `function_expression`, `generator_function_declaration`, `method_definition`
|
|
601
686
|
- **Lua**: `function_declaration`, `function_definition`
|
|
687
|
+
- **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `interface_declaration`, `method_declaration`, `trait_declaration`
|
|
602
688
|
- **Python**: `class_definition`, `function_definition`
|
|
603
689
|
- **Rust**: `closure_expression`, `enum_item`, `function_item`, `function_signature_item`, `impl_item`, `struct_item`, `trait_item`, `type_item`, `union_item`
|
|
604
690
|
- **TypeScript**: `abstract_class_declaration`, `arrow_function`, `class`, `class_declaration`, `enum_declaration`, `function_declaration`, `function_expression`, `function_signature`, `generator_function_declaration`, `interface_declaration`, `internal_module`, `method_definition`, `type_alias_declaration`
|
|
605
|
-
- **
|
|
606
|
-
- **Go**: `function_declaration`, `method_declaration`, `type_declaration`
|
|
607
|
-
- **PHP**: `anonymous_function`, `arrow_function`, `class_declaration`, `enum_declaration`, `function_definition`, `function_static_declaration`, `interface_declaration`, `trait_declaration`
|
|
691
|
+
- **Go**: `function_declaration`, `method_declaration`, `type_alias`, `type_spec`
|
|
608
692
|
- **Scala**: `class_definition`, `function_declaration`, `function_definition`, `object_definition`, `trait_definition`
|
|
609
693
|
<!-- /SECTION:language_mappings -->
|
|
610
694
|
|
|
@@ -694,6 +778,7 @@ my_build_output
|
|
|
694
778
|
- **pydantic-settings**: Settings management using Pydantic
|
|
695
779
|
- **pymgclient**: Memgraph database adapter for Python language
|
|
696
780
|
- **python-dotenv**: Read key-value pairs from a .env file and set them as environment variables
|
|
781
|
+
- **tiktoken**: tiktoken is a fast BPE tokeniser for use with OpenAI's models
|
|
697
782
|
- **toml**: Python Library for Tom's Obvious, Minimal Language
|
|
698
783
|
- **tree-sitter-python**: Python grammar for tree-sitter
|
|
699
784
|
- **tree-sitter**: Python bindings to the Tree-sitter parsing library
|
|
@@ -706,6 +791,7 @@ my_build_output
|
|
|
706
791
|
- **protobuf**
|
|
707
792
|
- **defusedxml**: XML bomb protection for Python stdlib modules
|
|
708
793
|
- **huggingface-hub**: Client library to download and publish models, datasets and other repos on the huggingface.co hub
|
|
794
|
+
- **griffe**: Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
|
|
709
795
|
<!-- /SECTION:dependencies -->
|
|
710
796
|
|
|
711
797
|
## 🤖 Agentic Workflow & Tools
|
|
@@ -720,11 +806,10 @@ The agent has access to a suite of tools to understand and interact with the cod
|
|
|
720
806
|
| Tool | Description |
|
|
721
807
|
|----|-----------|
|
|
722
808
|
| `query_graph` | Query the codebase knowledge graph using natural language questions. Ask in plain English about classes, functions, methods, dependencies, or code structure. Examples: 'Find all functions that call each other', 'What classes are in the user module', 'Show me functions with the longest call chains'. |
|
|
723
|
-
| `read_file` | Reads the content of text-based files.
|
|
809
|
+
| `read_file` | Reads the content of text-based files. Images and PDFs the user references are attached inline; read them directly. |
|
|
724
810
|
| `create_file` | Creates a new file with content. IMPORTANT: Check file existence first! Overwrites completely WITHOUT showing diff. Use only for new files, not existing file modifications. |
|
|
725
811
|
| `replace_code` | Surgically replaces specific code blocks in files. Requires exact target code and replacement. Only modifies the specified block, leaving rest of file unchanged. True surgical patching. |
|
|
726
812
|
| `list_directory` | Lists the contents of a directory to explore the codebase. |
|
|
727
|
-
| `analyze_document` | Analyzes documents (PDFs, images) to answer questions about their content. |
|
|
728
813
|
| `execute_shell` | Executes shell commands from allowlist. Read-only commands run without approval; write operations require user confirmation. |
|
|
729
814
|
| `semantic_search` | Performs a semantic search for functions based on a natural language query describing their purpose, returning a list of potential matches with similarity scores. |
|
|
730
815
|
| `get_function_source` | Retrieves the source code for a specific function or method using its internal node ID, typically obtained from a semantic search result. |
|
|
@@ -750,7 +835,7 @@ Code-Graph-RAG makes it easy to add support for any language that has a Tree-sit
|
|
|
750
835
|
|
|
751
836
|
> **⚠️ Recommendation**: While you can add languages yourself, we recommend waiting for official full support to ensure optimal parsing quality, comprehensive feature coverage, and robust integration. The languages marked as "In Development" above will receive dedicated optimization and testing.
|
|
752
837
|
|
|
753
|
-
> **💡 Request Support**: If you want a specific language to be officially supported, please [submit an issue](https://
|
|
838
|
+
> **💡 Request Support**: If you want a specific language to be officially supported, please [submit an issue](https://codeberg.org/vitali87/code-graph-rag/issues) with your language request.
|
|
754
839
|
|
|
755
840
|
#### Quick Start: Add a Language
|
|
756
841
|
|
|
@@ -902,3 +987,7 @@ We also offer custom development, integration consulting, technical support cont
|
|
|
902
987
|
## Star History
|
|
903
988
|
|
|
904
989
|
[](https://www.star-history.com/#vitali87/code-graph-rag&Date)
|
|
990
|
+
|
|
991
|
+
## Fork History
|
|
992
|
+
|
|
993
|
+
[](https://fork-history.site/#vitali87/code-graph-rag)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-graph-rag
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.187
|
|
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
|
|
@@ -14,34 +14,37 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
18
|
Requires-Python: >=3.12
|
|
18
19
|
Description-Content-Type: text/markdown
|
|
19
20
|
License-File: LICENSE
|
|
20
21
|
Requires-Dist: loguru>=0.7.3
|
|
21
|
-
Requires-Dist: mcp>=1.
|
|
22
|
-
Requires-Dist: pydantic-ai>=1.
|
|
23
|
-
Requires-Dist: pydantic-settings>=2.
|
|
24
|
-
Requires-Dist: pymgclient>=1.
|
|
25
|
-
Requires-Dist: python-dotenv>=1.1
|
|
22
|
+
Requires-Dist: mcp>=1.25.0
|
|
23
|
+
Requires-Dist: pydantic-ai>=1.102.0
|
|
24
|
+
Requires-Dist: pydantic-settings>=2.12.0
|
|
25
|
+
Requires-Dist: pymgclient>=1.5.1
|
|
26
|
+
Requires-Dist: python-dotenv>=1.2.1
|
|
26
27
|
Requires-Dist: tiktoken>=0.12.0
|
|
27
28
|
Requires-Dist: toml>=0.10.2
|
|
28
|
-
Requires-Dist: tree-sitter-python>=0.
|
|
29
|
+
Requires-Dist: tree-sitter-python>=0.25.0
|
|
29
30
|
Requires-Dist: tree-sitter==0.25.2
|
|
30
31
|
Requires-Dist: watchdog>=6.0.0
|
|
31
|
-
Requires-Dist: typer>=0.
|
|
32
|
-
Requires-Dist: rich>=
|
|
33
|
-
Requires-Dist: prompt-toolkit>=3.0.
|
|
32
|
+
Requires-Dist: typer>=0.21.1
|
|
33
|
+
Requires-Dist: rich>=14.2.0
|
|
34
|
+
Requires-Dist: prompt-toolkit>=3.0.52
|
|
34
35
|
Requires-Dist: diff-match-patch>=20241021
|
|
35
|
-
Requires-Dist: click>=8.
|
|
36
|
-
Requires-Dist: protobuf>=
|
|
36
|
+
Requires-Dist: click>=8.3.1
|
|
37
|
+
Requires-Dist: protobuf>=6.33.5
|
|
37
38
|
Requires-Dist: defusedxml>=0.7.1
|
|
38
|
-
Requires-Dist: huggingface-hub[hf-xet]>=
|
|
39
|
+
Requires-Dist: huggingface-hub[hf-xet]>=1.7.2
|
|
40
|
+
Requires-Dist: griffe<2,>=1.0
|
|
39
41
|
Provides-Extra: test
|
|
40
42
|
Requires-Dist: pytest>=8.4.1; extra == "test"
|
|
41
43
|
Requires-Dist: pytest-asyncio>=1.0.0; extra == "test"
|
|
42
44
|
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
43
45
|
Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
|
|
44
46
|
Requires-Dist: testcontainers>=4.9.0; extra == "test"
|
|
47
|
+
Requires-Dist: libclang>=18.1.1; extra == "test"
|
|
45
48
|
Provides-Extra: treesitter-full
|
|
46
49
|
Requires-Dist: tree-sitter-python>=0.23.6; extra == "treesitter-full"
|
|
47
50
|
Requires-Dist: tree-sitter-javascript>=0.23.1; extra == "treesitter-full"
|
|
@@ -53,6 +56,7 @@ Requires-Dist: tree-sitter-java>=0.23.5; extra == "treesitter-full"
|
|
|
53
56
|
Requires-Dist: tree-sitter-c>=0.24.1; extra == "treesitter-full"
|
|
54
57
|
Requires-Dist: tree-sitter-cpp>=0.23.0; extra == "treesitter-full"
|
|
55
58
|
Requires-Dist: tree-sitter-lua>=0.0.19; extra == "treesitter-full"
|
|
59
|
+
Requires-Dist: tree-sitter-php>=0.24.1; extra == "treesitter-full"
|
|
56
60
|
Provides-Extra: semantic
|
|
57
61
|
Requires-Dist: qdrant-client>=1.9.0; extra == "semantic"
|
|
58
62
|
Requires-Dist: torch>=2.6.0; extra == "semantic"
|
|
@@ -10,12 +10,14 @@ code_graph_rag.egg-info/entry_points.txt
|
|
|
10
10
|
code_graph_rag.egg-info/requires.txt
|
|
11
11
|
code_graph_rag.egg-info/top_level.txt
|
|
12
12
|
codebase_rag/__init__.py
|
|
13
|
+
codebase_rag/cgr_state.py
|
|
13
14
|
codebase_rag/cli.py
|
|
14
15
|
codebase_rag/cli_help.py
|
|
15
16
|
codebase_rag/config.py
|
|
16
17
|
codebase_rag/constants.py
|
|
17
18
|
codebase_rag/cypher_queries.py
|
|
18
19
|
codebase_rag/decorators.py
|
|
20
|
+
codebase_rag/docker-compose.yaml
|
|
19
21
|
codebase_rag/embedder.py
|
|
20
22
|
codebase_rag/exceptions.py
|
|
21
23
|
codebase_rag/graph_loader.py
|
|
@@ -34,6 +36,7 @@ codebase_rag/types_defs.py
|
|
|
34
36
|
codebase_rag/unixcoder.py
|
|
35
37
|
codebase_rag/vector_store.py
|
|
36
38
|
codebase_rag/mcp/__init__.py
|
|
39
|
+
codebase_rag/mcp/client.py
|
|
37
40
|
codebase_rag/mcp/server.py
|
|
38
41
|
codebase_rag/mcp/tools.py
|
|
39
42
|
codebase_rag/parsers/__init__.py
|
|
@@ -59,12 +62,19 @@ codebase_rag/parsers/class_ingest/relationships.py
|
|
|
59
62
|
codebase_rag/parsers/class_ingest/utils.py
|
|
60
63
|
codebase_rag/parsers/cpp/__init__.py
|
|
61
64
|
codebase_rag/parsers/cpp/utils.py
|
|
65
|
+
codebase_rag/parsers/cpp_frontend/__init__.py
|
|
66
|
+
codebase_rag/parsers/cpp_frontend/constants.py
|
|
67
|
+
codebase_rag/parsers/cpp_frontend/frontend.py
|
|
68
|
+
codebase_rag/parsers/cpp_frontend/qn.py
|
|
69
|
+
codebase_rag/parsers/go/__init__.py
|
|
70
|
+
codebase_rag/parsers/go/utils.py
|
|
62
71
|
codebase_rag/parsers/handlers/__init__.py
|
|
63
72
|
codebase_rag/parsers/handlers/base.py
|
|
64
73
|
codebase_rag/parsers/handlers/cpp.py
|
|
65
74
|
codebase_rag/parsers/handlers/java.py
|
|
66
75
|
codebase_rag/parsers/handlers/js_ts.py
|
|
67
76
|
codebase_rag/parsers/handlers/lua.py
|
|
77
|
+
codebase_rag/parsers/handlers/php.py
|
|
68
78
|
codebase_rag/parsers/handlers/protocol.py
|
|
69
79
|
codebase_rag/parsers/handlers/python.py
|
|
70
80
|
codebase_rag/parsers/handlers/registry.py
|
|
@@ -93,15 +103,21 @@ codebase_rag/parsers/rs/__init__.py
|
|
|
93
103
|
codebase_rag/parsers/rs/utils.py
|
|
94
104
|
codebase_rag/providers/__init__.py
|
|
95
105
|
codebase_rag/providers/base.py
|
|
106
|
+
codebase_rag/providers/litellm.py
|
|
96
107
|
codebase_rag/services/__init__.py
|
|
108
|
+
codebase_rag/services/anthropic_token_counter.py
|
|
97
109
|
codebase_rag/services/graph_service.py
|
|
98
110
|
codebase_rag/services/llm.py
|
|
99
111
|
codebase_rag/services/protobuf_service.py
|
|
112
|
+
codebase_rag/stack/__init__.py
|
|
113
|
+
codebase_rag/stack/cli.py
|
|
114
|
+
codebase_rag/stack/constants.py
|
|
115
|
+
codebase_rag/stack/health.py
|
|
116
|
+
codebase_rag/stack/manager.py
|
|
100
117
|
codebase_rag/tools/__init__.py
|
|
101
118
|
codebase_rag/tools/code_retrieval.py
|
|
102
119
|
codebase_rag/tools/codebase_query.py
|
|
103
120
|
codebase_rag/tools/directory_lister.py
|
|
104
|
-
codebase_rag/tools/document_analyzer.py
|
|
105
121
|
codebase_rag/tools/file_editor.py
|
|
106
122
|
codebase_rag/tools/file_reader.py
|
|
107
123
|
codebase_rag/tools/file_writer.py
|
|
@@ -114,8 +130,14 @@ codebase_rag/utils/__init__.py
|
|
|
114
130
|
codebase_rag/utils/dependencies.py
|
|
115
131
|
codebase_rag/utils/fqn_resolver.py
|
|
116
132
|
codebase_rag/utils/path_utils.py
|
|
133
|
+
codebase_rag/utils/rich_markdown.py
|
|
117
134
|
codebase_rag/utils/source_extraction.py
|
|
118
135
|
codebase_rag/utils/token_utils.py
|
|
136
|
+
codebase_rag/workspaces/__init__.py
|
|
137
|
+
codebase_rag/workspaces/cli.py
|
|
138
|
+
codebase_rag/workspaces/constants.py
|
|
139
|
+
codebase_rag/workspaces/models.py
|
|
140
|
+
codebase_rag/workspaces/storage.py
|
|
119
141
|
codec/__init__.py
|
|
120
142
|
codec/schema_pb2.py
|
|
121
143
|
codec/schema_pb2.pyi
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
loguru>=0.7.3
|
|
2
|
-
mcp>=1.
|
|
3
|
-
pydantic-ai>=1.
|
|
4
|
-
pydantic-settings>=2.
|
|
5
|
-
pymgclient>=1.
|
|
6
|
-
python-dotenv>=1.1
|
|
2
|
+
mcp>=1.25.0
|
|
3
|
+
pydantic-ai>=1.102.0
|
|
4
|
+
pydantic-settings>=2.12.0
|
|
5
|
+
pymgclient>=1.5.1
|
|
6
|
+
python-dotenv>=1.2.1
|
|
7
7
|
tiktoken>=0.12.0
|
|
8
8
|
toml>=0.10.2
|
|
9
|
-
tree-sitter-python>=0.
|
|
9
|
+
tree-sitter-python>=0.25.0
|
|
10
10
|
tree-sitter==0.25.2
|
|
11
11
|
watchdog>=6.0.0
|
|
12
|
-
typer>=0.
|
|
13
|
-
rich>=
|
|
14
|
-
prompt-toolkit>=3.0.
|
|
12
|
+
typer>=0.21.1
|
|
13
|
+
rich>=14.2.0
|
|
14
|
+
prompt-toolkit>=3.0.52
|
|
15
15
|
diff-match-patch>=20241021
|
|
16
|
-
click>=8.
|
|
17
|
-
protobuf>=
|
|
16
|
+
click>=8.3.1
|
|
17
|
+
protobuf>=6.33.5
|
|
18
18
|
defusedxml>=0.7.1
|
|
19
|
-
huggingface-hub[hf-xet]>=
|
|
19
|
+
huggingface-hub[hf-xet]>=1.7.2
|
|
20
|
+
griffe<2,>=1.0
|
|
20
21
|
|
|
21
22
|
[semantic]
|
|
22
23
|
qdrant-client>=1.9.0
|
|
@@ -29,6 +30,7 @@ pytest-asyncio>=1.0.0
|
|
|
29
30
|
pytest-cov>=4.0.0
|
|
30
31
|
pytest-xdist>=3.8.0
|
|
31
32
|
testcontainers>=4.9.0
|
|
33
|
+
libclang>=18.1.1
|
|
32
34
|
|
|
33
35
|
[treesitter-full]
|
|
34
36
|
tree-sitter-python>=0.23.6
|
|
@@ -41,3 +43,4 @@ tree-sitter-java>=0.23.5
|
|
|
41
43
|
tree-sitter-c>=0.24.1
|
|
42
44
|
tree-sitter-cpp>=0.23.0
|
|
43
45
|
tree-sitter-lua>=0.0.19
|
|
46
|
+
tree-sitter-php>=0.24.1
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from datetime import UTC, datetime
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import TypedDict
|
|
7
|
+
|
|
8
|
+
from loguru import logger
|
|
9
|
+
|
|
10
|
+
from .config import settings
|
|
11
|
+
|
|
12
|
+
STATE_FILENAME = "state.json"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class _StateShape(TypedDict, total=False):
|
|
16
|
+
last_sync: dict[str, str]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def state_path(home: Path | None = None) -> Path:
|
|
20
|
+
base = (home or settings.CGR_HOME).expanduser()
|
|
21
|
+
return base / STATE_FILENAME
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _load(path: Path) -> _StateShape:
|
|
25
|
+
if not path.exists():
|
|
26
|
+
return _StateShape()
|
|
27
|
+
try:
|
|
28
|
+
with path.open(encoding="utf-8") as f:
|
|
29
|
+
data = json.load(f)
|
|
30
|
+
if isinstance(data, dict):
|
|
31
|
+
return _StateShape(last_sync=data.get("last_sync", {}))
|
|
32
|
+
except (OSError, json.JSONDecodeError) as e:
|
|
33
|
+
logger.warning(f"Failed to load cgr state from {path}: {e}")
|
|
34
|
+
return _StateShape()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _save(path: Path, data: _StateShape) -> None:
|
|
38
|
+
try:
|
|
39
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
40
|
+
with path.open("w", encoding="utf-8") as f:
|
|
41
|
+
json.dump(data, f, indent=2)
|
|
42
|
+
except OSError as e:
|
|
43
|
+
logger.warning(f"Failed to save cgr state to {path}: {e}")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def record_sync(project_name: str, home: Path | None = None) -> None:
|
|
47
|
+
path = state_path(home)
|
|
48
|
+
state = _load(path)
|
|
49
|
+
last_sync = state.get("last_sync", {})
|
|
50
|
+
last_sync[project_name] = datetime.now(UTC).isoformat()
|
|
51
|
+
state["last_sync"] = last_sync
|
|
52
|
+
_save(path, state)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def read_sync_timestamps(home: Path | None = None) -> dict[str, str]:
|
|
56
|
+
state = _load(state_path(home))
|
|
57
|
+
return dict(state.get("last_sync", {}))
|