hybrid-code-rag-mcp 0.26.0__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.
- hybrid_code_rag_mcp-0.26.0/.gitignore +71 -0
- hybrid_code_rag_mcp-0.26.0/LICENSE +201 -0
- hybrid_code_rag_mcp-0.26.0/NOTICE +14 -0
- hybrid_code_rag_mcp-0.26.0/PKG-INFO +303 -0
- hybrid_code_rag_mcp-0.26.0/config.py +821 -0
- hybrid_code_rag_mcp-0.26.0/docs/install.md +271 -0
- hybrid_code_rag_mcp-0.26.0/examples/quickstart/config.py +161 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/__init__.py +12 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/__main__.py +4 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/cli.py +434 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/clients.py +71 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/configgen.py +128 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/detect.py +180 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/docker_svc.py +112 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/engine.py +110 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/index_lock.py +50 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/paths.py +64 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/perf.py +20 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/progress.py +121 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/qdrant_bin.py +358 -0
- hybrid_code_rag_mcp-0.26.0/hybrid_code_rag_mcp/settings.py +134 -0
- hybrid_code_rag_mcp-0.26.0/pyproject.toml +64 -0
- hybrid_code_rag_mcp-0.26.0/self-index/config.py +125 -0
- hybrid_code_rag_mcp-0.26.0/src/config_loader.py +590 -0
- hybrid_code_rag_mcp-0.26.0/src/git_pull_all.py +65 -0
- hybrid_code_rag_mcp-0.26.0/src/git_pull_guard.py +407 -0
- hybrid_code_rag_mcp-0.26.0/src/guard_common.py +437 -0
- hybrid_code_rag_mcp-0.26.0/src/index_rag.py +4548 -0
- hybrid_code_rag_mcp-0.26.0/src/qdrant/__init__.py +1 -0
- hybrid_code_rag_mcp-0.26.0/src/qdrant/vector_store.py +265 -0
- hybrid_code_rag_mcp-0.26.0/src/rag_mcp.py +467 -0
- hybrid_code_rag_mcp-0.26.0/src/refresh_guard.py +291 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/__init__.py +13 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/branch_dedup.py +281 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/chunk_pool.py +422 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/cross_encoder.py +354 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/docker_utils.py +815 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/embedding.py +1634 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/fusion.py +357 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/git_ops.py +663 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/gpu_stats.py +342 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/hybrid_embed.py +100 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/index_meta.py +1232 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/index_state.py +483 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/index_write_lock.py +80 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/indexing.py +116 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/log.py +132 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/manifest.py +618 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/manifest_saver.py +426 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/onnx_embedding.py +213 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/openai_embedding.py +218 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/overlay.py +313 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/pending_points.py +147 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/qdrant_client.py +170 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/query_shape.py +376 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/__init__.py +228 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/_base.py +268 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/_structured.py +379 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/cpp_reader.py +2227 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/csharp_reader.py +395 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/dfm_reader.py +514 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/dproj_reader.py +573 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/fr3_reader.py +504 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/go_reader.py +297 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/groovy_reader.py +1011 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/hbm_reader.py +513 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/java_reader.py +1032 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/jrxml_reader.py +467 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/js_reader.py +1307 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/kotlin_reader.py +1093 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/pascal_reader.py +1045 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/pgsql_chunker.py +395 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/php_reader.py +341 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/python_reader.py +367 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/rust_reader.py +744 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/sql_reader.py +267 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/text_reader.py +83 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/tsql_chunker.py +1015 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/readers/ui_reader.py +969 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/rerank_profile.py +183 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/reranker.py +1281 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/retrieval.py +431 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/search.py +346 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/sql_dialect.py +77 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/symbol_policy.py +197 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/upsert_batching.py +126 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/validation/__init__.py +23 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/validation/loader.py +304 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/validation/models.py +160 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/validation/output.py +641 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/validation/runner.py +568 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/version.py +42 -0
- hybrid_code_rag_mcp-0.26.0/src/shared/vram_cap.py +508 -0
- hybrid_code_rag_mcp-0.26.0/src/validate_rag.py +497 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
|
|
23
|
+
# Virtual environments
|
|
24
|
+
.venv/
|
|
25
|
+
venv/
|
|
26
|
+
ENV/
|
|
27
|
+
env/
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.idea/
|
|
31
|
+
.vscode/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
|
|
36
|
+
# Environment files (config lives in config.py, not .env)
|
|
37
|
+
.env
|
|
38
|
+
|
|
39
|
+
# OS
|
|
40
|
+
.DS_Store
|
|
41
|
+
Thumbs.db
|
|
42
|
+
|
|
43
|
+
# Logs
|
|
44
|
+
*.log
|
|
45
|
+
|
|
46
|
+
# generated indexes
|
|
47
|
+
/self-index/index_*
|
|
48
|
+
/project-configs/*
|
|
49
|
+
!/project-configs/.gitkeep
|
|
50
|
+
/test_sources/
|
|
51
|
+
|
|
52
|
+
# tests
|
|
53
|
+
.coverage
|
|
54
|
+
/self-index/qdrant/*
|
|
55
|
+
/hybrid-code-rag-mcp.iml
|
|
56
|
+
|
|
57
|
+
# Local environments, model caches, logs
|
|
58
|
+
.venv*/
|
|
59
|
+
*_model_cache/
|
|
60
|
+
logs/
|
|
61
|
+
NUL
|
|
62
|
+
|
|
63
|
+
# Quickstart local overrides (CUDA tag, GPU index)
|
|
64
|
+
/examples/quickstart/.env
|
|
65
|
+
|
|
66
|
+
# Benchmark raw run logs (keep result tables under bench/django/results/)
|
|
67
|
+
/bench/django/logs/
|
|
68
|
+
/bench/**/raw/
|
|
69
|
+
/bench/**/runs/
|
|
70
|
+
/bench/django/v2/night/decision_log*.tsv
|
|
71
|
+
*.raw.json
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
hybrid-code-rag-mcp
|
|
2
|
+
Copyright 2025-2026 Jakub Stuglik
|
|
3
|
+
|
|
4
|
+
This product includes software developed by Jakub Stuglik:
|
|
5
|
+
https://github.com/jakubstuglik/hybrid-code-rag-mcp
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License").
|
|
8
|
+
You may obtain a copy of the License at
|
|
9
|
+
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
|
|
12
|
+
The entire hybrid-code-rag-mcp codebase in this repository, including
|
|
13
|
+
versions previously distributed under the GNU Affero General Public
|
|
14
|
+
License v3, is available under the Apache License, Version 2.0.
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hybrid-code-rag-mcp
|
|
3
|
+
Version: 0.26.0
|
|
4
|
+
Summary: Local hybrid (dense + BM25) code search MCP server with AST-aware chunking
|
|
5
|
+
Project-URL: Homepage, https://github.com/jakubstuglik/hybrid-code-rag-mcp
|
|
6
|
+
Project-URL: Repository, https://github.com/jakubstuglik/hybrid-code-rag-mcp
|
|
7
|
+
Project-URL: Issues, https://github.com/jakubstuglik/hybrid-code-rag-mcp/issues
|
|
8
|
+
Author: Jakub Stuglik
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
Keywords: bm25,code-search,embeddings,mcp,qdrant,rag
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Topic :: Software Development
|
|
17
|
+
Requires-Python: <3.14,>=3.11
|
|
18
|
+
Requires-Dist: fastembed==0.7.4
|
|
19
|
+
Requires-Dist: llama-index-core==0.14.15
|
|
20
|
+
Requires-Dist: llama-index-vector-stores-qdrant==0.9.1
|
|
21
|
+
Requires-Dist: mcp==1.26.0
|
|
22
|
+
Requires-Dist: onnxruntime<1.25,>=1.24.4
|
|
23
|
+
Requires-Dist: psutil>=7.2
|
|
24
|
+
Requires-Dist: pyyaml>=6.0
|
|
25
|
+
Requires-Dist: qdrant-client==1.17.0
|
|
26
|
+
Requires-Dist: questionary>=2.0
|
|
27
|
+
Requires-Dist: rich>=13.8
|
|
28
|
+
Requires-Dist: tree-sitter-language-pack==0.13.0
|
|
29
|
+
Requires-Dist: tree-sitter==0.25.2
|
|
30
|
+
Requires-Dist: typer>=0.15
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Install with uv (`uvx hybrid-code-rag-mcp`)
|
|
34
|
+
|
|
35
|
+
## Step 0: install uv
|
|
36
|
+
|
|
37
|
+
uv downloads its own Python, so you do not need a separate Python install.
|
|
38
|
+
|
|
39
|
+
Windows (PowerShell):
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Linux and macOS:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then open a **new terminal** and check that it worked:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
uvx --version
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### If `uvx` is missing
|
|
58
|
+
|
|
59
|
+
The installer adds `uv` and `uvx` to your user path, but the terminal that
|
|
60
|
+
ran the installer often does not see them yet. Open a new terminal and run
|
|
61
|
+
`uvx --version` again.
|
|
62
|
+
|
|
63
|
+
Typical errors and the fix (complete Step 0, then open a new terminal):
|
|
64
|
+
|
|
65
|
+
- PowerShell: `uvx : The term 'uvx' is not recognized as the name of a cmdlet, function, script file, or operable program.`
|
|
66
|
+
- CMD: `'uvx' is not recognized as an internal or external command, operable program or batch file.`
|
|
67
|
+
- bash / zsh: `uvx: command not found`
|
|
68
|
+
|
|
69
|
+
### Alternatives: pipx and pip
|
|
70
|
+
|
|
71
|
+
If you already have Python 3.11–3.13 and prefer not to use uv:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
pipx install hybrid-code-rag-mcp
|
|
75
|
+
# or
|
|
76
|
+
pip install hybrid-code-rag-mcp
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Those installs put the `hybrid-code-rag-mcp` command on your `PATH`. The
|
|
80
|
+
commands are the same as with uvx, without the `uvx` prefix:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
hybrid-code-rag-mcp setup
|
|
84
|
+
hybrid-code-rag-mcp add <path>
|
|
85
|
+
hybrid-code-rag-mcp index
|
|
86
|
+
hybrid-code-rag-mcp serve my-app
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`python -m hybrid_code_rag_mcp setup` also works after `pip install`.
|
|
90
|
+
|
|
91
|
+
`hybrid-code-rag-mcp` indexes a code repository into a local Qdrant
|
|
92
|
+
(dense embeddings + BM25) and serves it to AI agents over MCP. This page
|
|
93
|
+
covers the packaged install: no git clone, no Python config files.
|
|
94
|
+
|
|
95
|
+
> **Status:** the package is not on PyPI yet. Until it is, build the wheel
|
|
96
|
+
> from a clone (see [From a clone](#from-a-clone-before-the-pypi-release))
|
|
97
|
+
> and pass it with `--from`.
|
|
98
|
+
|
|
99
|
+
The classic clone workflow (`python src/index_rag.py --config ...`,
|
|
100
|
+
`project-configs/`, `scripts/*.bat|*.sh`) is unchanged and fully supported;
|
|
101
|
+
see the [README](../README.md).
|
|
102
|
+
|
|
103
|
+
## Requirements
|
|
104
|
+
|
|
105
|
+
- [uv](https://docs.astral.sh/uv/) (it brings its own Python 3.11–3.13).
|
|
106
|
+
- Windows 10/11 x64 or Linux x86_64. macOS is not tested yet.
|
|
107
|
+
- Optional: Docker (for TEI, the fastest embedding server) and an NVIDIA GPU.
|
|
108
|
+
|
|
109
|
+
## Quick start
|
|
110
|
+
|
|
111
|
+
The same commands work in PowerShell, CMD and bash.
|
|
112
|
+
|
|
113
|
+
```text
|
|
114
|
+
uvx hybrid-code-rag-mcp setup
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`setup` asks a few questions:
|
|
118
|
+
|
|
119
|
+
1. **Where is your repository?** A git repository root (the current branch
|
|
120
|
+
becomes the indexed main branch) or a plain folder.
|
|
121
|
+
2. **Hardware.** NVIDIA GPUs (via `nvidia-smi`), CPU threads, RAM and
|
|
122
|
+
Docker are detected and shown.
|
|
123
|
+
3. **Embedding engine.**
|
|
124
|
+
- Docker found: TEI in Docker is proposed (GPU image when an NVIDIA GPU
|
|
125
|
+
is usable, otherwise the CPU image capped at 4 GB RAM).
|
|
126
|
+
- No Docker: ONNX Runtime in-process is used, with a warning about speed
|
|
127
|
+
and memory (numbers below). TEI stays available if you install Docker
|
|
128
|
+
and run `setup` again.
|
|
129
|
+
4. **GPU.** Proposed when an NVIDIA GPU is present.
|
|
130
|
+
5. **Qdrant.** A pinned native Qdrant binary is downloaded (SHA-256
|
|
131
|
+
verified), bound to `127.0.0.1` only, and run as one background process.
|
|
132
|
+
With Docker you can pick a Qdrant container instead.
|
|
133
|
+
|
|
134
|
+
Then it indexes the repository with progress bars and prints an MCP client
|
|
135
|
+
snippet, for example:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"mcpServers": {
|
|
140
|
+
"hcr-my-app": {
|
|
141
|
+
"command": "C:\\Users\\you\\.local\\bin\\uvx.exe",
|
|
142
|
+
"args": ["hybrid-code-rag-mcp", "serve", "my-app"]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The command is an absolute path because MCP clients often start servers
|
|
149
|
+
without your shell's `PATH`.
|
|
150
|
+
|
|
151
|
+
Non-interactive: `uvx hybrid-code-rag-mcp setup --repo <path> --yes`
|
|
152
|
+
(add `--embedder onnx|tei-docker`, `--device cpu|cuda`,
|
|
153
|
+
`--qdrant binary|docker|external`, `--no-index` as needed).
|
|
154
|
+
|
|
155
|
+
## Commands
|
|
156
|
+
|
|
157
|
+
| Command | What it does |
|
|
158
|
+
|---|---|
|
|
159
|
+
| `setup` | Wizard: repository, hardware, engine, Qdrant, first index, client snippet. |
|
|
160
|
+
| `add <path>` | Register and index another repository with the same engine. |
|
|
161
|
+
| `list` | Registered repositories. |
|
|
162
|
+
| `index [name] [--all] [--clear]` | Refresh (only changed files are re-embedded) or rebuild. |
|
|
163
|
+
| `serve [name]` | Run the MCP server over stdio (what MCP clients launch). `--transport streamable-http` for HTTP. |
|
|
164
|
+
| `client-config [name] --client claude-desktop\|cursor\|vscode\|claude-code\|codex` | Print a client snippet. |
|
|
165
|
+
| `qdrant start\|stop\|status` | Manage the local Qdrant. |
|
|
166
|
+
| `doctor` | Detected hardware, settings, service health. |
|
|
167
|
+
|
|
168
|
+
## Where things live
|
|
169
|
+
|
|
170
|
+
`HCR_HOME` (default `%LOCALAPPDATA%\hybrid-code-rag-mcp` on Windows,
|
|
171
|
+
`~/.local/share/hybrid-code-rag-mcp` on Linux):
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
settings.toml engine, device, Qdrant mode, ports
|
|
175
|
+
repos/<name>/repo.toml path, branch, extensions, excludes (editable)
|
|
176
|
+
repos/<name>/config.py generated classic config (do not edit)
|
|
177
|
+
repos/<name>/overrides.py optional: your own settings, loaded last
|
|
178
|
+
repos/<name>/index/ manifests and index state
|
|
179
|
+
qdrant-storage/ Qdrant data (binary mode)
|
|
180
|
+
bin/qdrant-<version>/ the Qdrant binary
|
|
181
|
+
models/ ONNX / TEI model cache
|
|
182
|
+
logs/ index logs, qdrant.log
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The generated `config.py` is an ordinary project config, so
|
|
186
|
+
`python src/index_rag.py --config <HCR_HOME>/repos/<name>/config.py` from a
|
|
187
|
+
clone works too. Any setting from [configuration](configuration.md) can go
|
|
188
|
+
in `overrides.py`.
|
|
189
|
+
|
|
190
|
+
Default ports: Qdrant `16333` (HTTP) / `16334` (gRPC), TEI `18080`, all on
|
|
191
|
+
`127.0.0.1`. Change them in `settings.toml`.
|
|
192
|
+
|
|
193
|
+
## Engines: ONNX vs TEI
|
|
194
|
+
|
|
195
|
+
Both run the same model, `jinaai/jina-embeddings-v2-base-code` (768-d).
|
|
196
|
+
|
|
197
|
+
- **ONNX (in-process)**: `EMBED_BACKEND = "onnx"`, ONNX Runtime through
|
|
198
|
+
fastembed. No Docker and no PyTorch. On CPU it uses half the logical cores
|
|
199
|
+
and one chunk per call (faster than padded batches on CPU).
|
|
200
|
+
- **TEI (Docker)**: Hugging Face Text Embeddings Inference. The GPU images are
|
|
201
|
+
the fastest option for large repositories.
|
|
202
|
+
|
|
203
|
+
### Measurements (CPU)
|
|
204
|
+
|
|
205
|
+
Measured on 2026-12-05 on one laptop (24-core / 32-thread Intel CPU, no GPU
|
|
206
|
+
used), embedding all 1 513 chunks of this repository's `src/` and `docs/`
|
|
207
|
+
(95 files, ~1 200 characters per chunk on average):
|
|
208
|
+
|
|
209
|
+
| | ONNX in-process (CPU) | TEI CPU in Docker |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| Throughput, inputs cut at 1 024 tokens (ONNX CPU default) | 2.6 chunks/s | 3.7 chunks/s (indexer run) |
|
|
212
|
+
| Throughput, inputs cut at 4 096 tokens | 2.3 chunks/s (256-chunk sample) | not measured |
|
|
213
|
+
| CPU threads busy | ~16 of 32 | ~32 of 32 |
|
|
214
|
+
| Memory | 1.7 GB peak RSS (1 024 cap); 4 096 cap: 3.1 GB on the sample, ~5 GB seen on a repo with long files | 1.2 GB with `--memory 4g --max-batch-tokens 1024`; ~13 GB after warm-up with TEI defaults and no cap (with defaults and a 4 GB cap it was OOM-killed at warm-up) |
|
|
215
|
+
| Single query, p50 / p95 | 21 / 25 ms | 31 / 56 ms (HTTP included) |
|
|
216
|
+
| Vector parity | cosine ≥ 0.999999 on all 1 513 chunks and 20 queries when both cut inputs at 1 024 tokens (TEI's CPU image runs the same `onnx/model.onnx`) | |
|
|
217
|
+
|
|
218
|
+
On CPU, `setup` writes `ONNX_MAX_LENGTH = 1024` to keep memory bounded
|
|
219
|
+
(set `onnx_max_length` in `settings.toml` to change it, then run
|
|
220
|
+
`hybrid-code-rag-mcp index --clear`). With CUDA the engine default
|
|
221
|
+
(`EMBED_MAX_SEQ_LENGTH`, 4 096) applies.
|
|
222
|
+
|
|
223
|
+
So on CPU, ONNX is about 30% slower than TEI but uses half the cores and
|
|
224
|
+
needs no Docker; both are slow for big repositories (50 000 chunks take
|
|
225
|
+
about 5 hours with ONNX). The setup wizard quotes these numbers.
|
|
226
|
+
|
|
227
|
+
Method: ONNX through `shared.onnx_embedding.OnnxEmbedding` (16 threads, one
|
|
228
|
+
chunk per call, which was about 2x faster than padded batches of 4–16 and
|
|
229
|
+
faster than 8 or 24 threads or the ONNX Runtime default); TEI throughput from a full
|
|
230
|
+
`src/index_rag.py --clear` run (pipeline depth 6, 16 concurrent requests);
|
|
231
|
+
memory from `psutil` RSS sampling (ONNX) and `docker stats` (TEI).
|
|
232
|
+
|
|
233
|
+
GPU numbers are not measured yet.
|
|
234
|
+
|
|
235
|
+
The collection provenance records the backend family (`onnx`, `tei`,
|
|
236
|
+
`pytorch` or `openai`) and an embedding fingerprint. Mixing backends on
|
|
237
|
+
an existing collection is blocked (for example ONNX then TEI, or the
|
|
238
|
+
reverse). A non-empty collection with no recorded backend is treated as
|
|
239
|
+
non-ONNX (ONNX did not exist when those indexes were built); TEI,
|
|
240
|
+
PyTorch and OpenAI keep working as before. Reindex with `index --clear`,
|
|
241
|
+
or switch the config back to the original backend.
|
|
242
|
+
|
|
243
|
+
### NVIDIA GPU without Docker (ONNX on CUDA)
|
|
244
|
+
|
|
245
|
+
ONNX on CUDA needs `onnxruntime-gpu` instead of the CPU `onnxruntime`.
|
|
246
|
+
This path is **not verified yet**. `setup` falls back to CPU when the
|
|
247
|
+
CUDA provider is missing, and a CUDA request that loads only the CPU
|
|
248
|
+
provider is an error, not a silent fallback.
|
|
249
|
+
|
|
250
|
+
## From a clone (before the PyPI release)
|
|
251
|
+
|
|
252
|
+
```text
|
|
253
|
+
git clone https://github.com/jakubstuglik/hybrid-code-rag-mcp.git
|
|
254
|
+
cd hybrid-code-rag-mcp
|
|
255
|
+
uv build --wheel
|
|
256
|
+
uvx --from dist/hybrid_code_rag_mcp-<version>-py3-none-any.whl hybrid-code-rag-mcp setup
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Set `HCR_UVX_FROM=<absolute path to the wheel>` so the printed client
|
|
260
|
+
snippets use the same `--from` argument.
|
|
261
|
+
|
|
262
|
+
uv caches the tool environment by version. After rebuilding a wheel with the
|
|
263
|
+
same version, run `uvx --refresh-package hybrid-code-rag-mcp --from <wheel> hybrid-code-rag-mcp --version`
|
|
264
|
+
once so `uvx` picks up the new build.
|
|
265
|
+
|
|
266
|
+
## Indexer lock and exit codes
|
|
267
|
+
|
|
268
|
+
A write run (`index`, or `python src/index_rag.py` without `--dry-run`)
|
|
269
|
+
takes an exclusive lock at `{index path}/index.lock`. If another writer
|
|
270
|
+
already holds it, the process exits **75** (`EX_TEMPFAIL`) with
|
|
271
|
+
"already being indexed". That is distinct from exit 1 (Qdrant or TEI
|
|
272
|
+
unavailable) and exit 3 (a pending journal that needs a retry after a
|
|
273
|
+
Qdrant problem). `--dry-run`, `--help` and `--version` take no lock.
|
|
274
|
+
`--calculate-histogram` and `--log-to-file` write under the index path,
|
|
275
|
+
so they run after the lock is acquired.
|
|
276
|
+
|
|
277
|
+
The sole owner of the lock is the `index_rag.py` process that writes.
|
|
278
|
+
The installable CLI does not hold the lock: it starts that process and
|
|
279
|
+
maps exit 75 to "already being indexed". If the CLI process is killed,
|
|
280
|
+
the lock stays with the still-running indexer until that writer exits.
|
|
281
|
+
`index --all` returns the first non-75 error, or 75 if every failure was
|
|
282
|
+
a busy lock, or 0 if every repository succeeded.
|
|
283
|
+
|
|
284
|
+
`src/refresh_guard.py` (cron) starts the indexer and returns its exit
|
|
285
|
+
code, including 75. Exit 75 is a temporary failure: the guard does not
|
|
286
|
+
treat it as a stuck run and does not change its skip-counter state.
|
|
287
|
+
|
|
288
|
+
## Troubleshooting
|
|
289
|
+
|
|
290
|
+
- **`uvx` is not recognized / `command not found`**: uv is not installed,
|
|
291
|
+
or this terminal was opened before the install. See [Step 0](#step-0-install-uv).
|
|
292
|
+
- **`Security Violation [pathsec.open]: refusing multiply-linked file`**:
|
|
293
|
+
uv installs packages as hard links to its cache, and NLTK 3.10 refuses
|
|
294
|
+
hard-linked data files. The CLI copies llama-index's bundled NLTK data to
|
|
295
|
+
`HCR_HOME/nltk_cache` and points `NLTK_DATA` at it. In a manual
|
|
296
|
+
environment, install with `uv pip install --link-mode copy ...`.
|
|
297
|
+
- **`already being indexed` (exit 75)**: another `index` or
|
|
298
|
+
`python src/index_rag.py` is writing this collection. Wait for it to
|
|
299
|
+
finish and retry. This is a temporary failure, not a Qdrant/TEI error.
|
|
300
|
+
- **Qdrant port busy**: another process uses `16333`; set `qdrant_port` in
|
|
301
|
+
`settings.toml`.
|
|
302
|
+
- **Windows SmartScreen / antivirus** may block the downloaded Qdrant
|
|
303
|
+
binary; choose the Docker Qdrant in `setup` or allow the file.
|