harborrag 2.0.0a1__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.
@@ -0,0 +1,252 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+ harborrag_control.db
65
+ harborrag_control.db-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ .pybuilder/
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ # For a library or package, you might want to ignore these files since the code is
90
+ # intended to run in multiple environments; otherwise, check them in:
91
+ # .python-version
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ # Pipfile.lock
99
+
100
+ # UV
101
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ # uv.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ # poetry.lock
112
+ # poetry.toml
113
+
114
+ # pdm
115
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
117
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
118
+ # pdm.lock
119
+ # pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # pixi
124
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
125
+ # pixi.lock
126
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
127
+ # in the .venv directory. It is recommended not to include this directory in version control.
128
+ .pixi/*
129
+ !.pixi/config.toml
130
+
131
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
+ __pypackages__/
133
+
134
+ # Celery stuff
135
+ celerybeat-schedule*
136
+ celerybeat.pid
137
+
138
+ # Redis
139
+ *.rdb
140
+ *.aof
141
+ *.pid
142
+
143
+ # RabbitMQ
144
+ mnesia/
145
+ rabbitmq/
146
+ rabbitmq-data/
147
+
148
+ # ActiveMQ
149
+ activemq-data/
150
+
151
+ # SageMath parsed files
152
+ *.sage.py
153
+
154
+ # Environments
155
+ .env
156
+ .envrc
157
+ .venv
158
+ env
159
+ venv/
160
+ ENV/
161
+ env.bak/
162
+ venv.bak/
163
+
164
+ # HarborRAG local runtime state and ingested object data
165
+ /.harborrag/
166
+ /.local/
167
+ # ...and the same, wherever a package nests its own local runtime state.
168
+ **/.local/
169
+
170
+ # Spyder project settings
171
+ .spyderproject
172
+ .spyproject
173
+
174
+ # Rope project settings
175
+ .ropeproject
176
+
177
+ # mkdocs documentation
178
+ /site
179
+
180
+ # mypy
181
+ .mypy_cache/
182
+ .dmypy.json
183
+ dmypy.json
184
+
185
+ # Pyre type checker
186
+ .pyre/
187
+
188
+ # pytype static type analyzer
189
+ .pytype/
190
+
191
+ # Cython debug symbols
192
+ cython_debug/
193
+
194
+ # PyCharm
195
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
196
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
197
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
198
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
199
+ # .idea/
200
+
201
+ # Abstra
202
+ # Abstra is an AI-powered process automation framework.
203
+ # Ignore directories containing user credentials, local state, and settings.
204
+ # Learn more at https://abstra.io/docs
205
+ .abstra/
206
+
207
+ # Visual Studio Code
208
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
209
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
210
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
211
+ # you could uncomment the following to ignore the entire vscode folder
212
+ .vscode/
213
+ # Temporary file for partial code execution
214
+ tempCodeRunnerFile.py
215
+
216
+ # Ruff stuff:
217
+ .ruff_cache/
218
+
219
+ # PyPI configuration file
220
+ .pypirc
221
+
222
+ # Marimo
223
+ marimo/_static/
224
+ marimo/_lsp/
225
+ __marimo__/
226
+
227
+ # Streamlit
228
+ .streamlit/secrets.toml
229
+
230
+ .claude/**
231
+ .agents/
232
+
233
+ examples/
234
+
235
+ # OS / editor noise
236
+ .DS_Store
237
+ .~lock.*#
238
+
239
+ # Generated API contract artifact (exported by make openapi)
240
+ openapi.json
241
+ clients/typescript/src/schema.d.ts
242
+ clients/typescript/dist/
243
+ clients/typescript/node_modules/
244
+
245
+ # Internal architecture working notes (kept out of the repo per team decision)
246
+ docs/developers/architecture/http_backend/
247
+
248
+ # Docling image output (config/parsers.yaml pdf-docling.image_output_dir)
249
+ /data/docling-images/
250
+
251
+ # Local macOS-compatible copy of dev.sh (bash 3.2 / BSD sed tweaks)
252
+ scripts/deployment/dev-mac.sh
@@ -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,177 @@
1
+ Metadata-Version: 2.5
2
+ Name: harborrag
3
+ Version: 2.0.0a1
4
+ Summary: Meta-package public facade for HarborRAG.
5
+ Project-URL: Homepage, https://github.com/cbtw-apac/HarborRAG
6
+ Project-URL: Repository, https://github.com/cbtw-apac/HarborRAG
7
+ Project-URL: Issues, https://github.com/cbtw-apac/HarborRAG/issues
8
+ Author: HarborRAG Contributors
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Typing :: Typed
15
+ Requires-Python: >=3.12
16
+ Requires-Dist: harborrag-core==2.0.0a1
17
+ Requires-Dist: harborrag-runtime==2.0.0a1
18
+ Provides-Extra: all
19
+ Requires-Dist: harborrag-adapters[parsers-all]==2.0.0a1; extra == 'all'
20
+ Requires-Dist: harborrag-app[api]==2.0.0a1; extra == 'all'
21
+ Requires-Dist: harborrag-mcp-server[mcp]==2.0.0a1; extra == 'all'
22
+ Requires-Dist: harborrag-memory==2.0.0a1; extra == 'all'
23
+ Requires-Dist: harborrag-runtime[production,temporal]==2.0.0a1; extra == 'all'
24
+ Provides-Extra: chat
25
+ Requires-Dist: harborrag-adapters[llm]==2.0.0a1; extra == 'chat'
26
+ Provides-Extra: cli
27
+ Requires-Dist: harborrag-app==2.0.0a1; extra == 'cli'
28
+ Provides-Extra: falkordb
29
+ Requires-Dist: harborrag-adapters[falkordb]==2.0.0a1; extra == 'falkordb'
30
+ Provides-Extra: local
31
+ Requires-Dist: harborrag-adapters[chunking,control-plane,falkordb,llm,parsers,pdf-docling,qdrant,s3,tables]==2.0.0a1; extra == 'local'
32
+ Provides-Extra: mcp
33
+ Requires-Dist: harborrag-mcp-server[mcp]==2.0.0a1; extra == 'mcp'
34
+ Provides-Extra: memory
35
+ Requires-Dist: harborrag-memory==2.0.0a1; extra == 'memory'
36
+ Provides-Extra: postgres
37
+ Requires-Dist: harborrag-adapters[control-plane,postgres]==2.0.0a1; extra == 'postgres'
38
+ Provides-Extra: qdrant
39
+ Requires-Dist: harborrag-adapters[qdrant]==2.0.0a1; extra == 'qdrant'
40
+ Provides-Extra: redis
41
+ Requires-Dist: harborrag-adapters[redis]==2.0.0a1; extra == 'redis'
42
+ Provides-Extra: s3
43
+ Requires-Dist: harborrag-adapters[s3]==2.0.0a1; extra == 's3'
44
+ Provides-Extra: server
45
+ Requires-Dist: harborrag-app[api]==2.0.0a1; extra == 'server'
46
+ Requires-Dist: harborrag-runtime[production,temporal]==2.0.0a1; extra == 'server'
47
+ Provides-Extra: temporal
48
+ Requires-Dist: harborrag-runtime[temporal]==2.0.0a1; extra == 'temporal'
49
+ Description-Content-Type: text/markdown
50
+
51
+ # harborrag
52
+
53
+ `harborrag` is the public SDK facade and installation bundle for
54
+ [HarborRAG](https://github.com/cbtw-apac/HarborRAG), a modular, provider-agnostic RAG
55
+ framework for engineering knowledge. Importing it does not initialize provider clients or
56
+ perform network I/O.
57
+
58
+ - Documentation: <https://cbtw-apac.github.io/HarborRAG/>
59
+ - Source: <https://github.com/cbtw-apac/HarborRAG>
60
+
61
+ ## Install
62
+
63
+ ```bash
64
+ pip install "harborrag[all]" # everything
65
+ pip install "harborrag[local]" # local end-to-end ingestion and retrieval
66
+ pip install "harborrag[cli,qdrant]" # or just what you need
67
+ ```
68
+
69
+ A bare `pip install harborrag` installs the framework - contracts, engine, memory,
70
+ adapters, and runtime - but deliberately **no third-party provider clients**. There is no
71
+ vector store, no graph store, and no model client until you add an extra:
72
+
73
+ | Extra | Adds |
74
+ | --- | --- |
75
+ | `local` | Qdrant, FalkorDB, S3, model client, chunking, control plane, parsers, Docling PDF, tables |
76
+ | `chat` | the model client used by chat, embeddings, and reranking |
77
+ | `cli` | the `harborrag` command |
78
+ | `server` | the HTTP API plus the production and Temporal runtime |
79
+ | `mcp` | the MCP transport |
80
+ | `temporal` | the Temporal client for durable ingestion |
81
+ | `qdrant`, `falkordb`, `postgres`, `s3`, `redis` | one provider each |
82
+ | `all` | everything above; a superset of `local` |
83
+
84
+ Conversation memory (`harborrag-memory`) is already a required dependency, so it is
85
+ available in every install. The `harborrag[memory]` extra exists for explicitness and adds
86
+ nothing new.
87
+
88
+ See [Installation](https://cbtw-apac.github.io/HarborRAG/docs/getting-started/installation.html)
89
+ for PDF/OCR backends, editable installs, and platform notes.
90
+
91
+ ## Ingest and retrieve
92
+
93
+ `HarborRAG` exposes four async service facades - `ingestion`, `retrieval`, `graph`, and
94
+ `chat` - behind one async context manager. Connectors are declared by name in your
95
+ connector catalog, so credentials stay as environment references:
96
+
97
+ ```python
98
+ import asyncio
99
+
100
+ from harborrag import AccessContext, HarborRAG, IngestionRequest, RetrievalRequest
101
+
102
+
103
+ async def main() -> None:
104
+ access = AccessContext(principal_id="user-1", tenant_id="tenant-1")
105
+
106
+ async with HarborRAG.from_config("config/harborrag.example.yaml") as harbor:
107
+ await harbor.ingestion.run(
108
+ IngestionRequest(access=access, connector_name="harborrag-workspace")
109
+ )
110
+ results = await harbor.retrieval.search(
111
+ RetrievalRequest(access=access, query="deployment requirements")
112
+ )
113
+ print(results)
114
+
115
+
116
+ asyncio.run(main())
117
+ ```
118
+
119
+ `config/harborrag.example.yaml` ships in the repository checkout. Copy it next to your
120
+ application and point `from_config` at your own path.
121
+
122
+ ## Chat
123
+
124
+ Chat needs a model provider, so install `harborrag[chat]` (or any extra that includes it,
125
+ such as `local`, `server`, or `all`) and configure credentials first:
126
+
127
+ ```python
128
+ from harborrag import ChatPrompt, HarborChatMessage, HarborChatRequest, HarborRAG
129
+
130
+ async with HarborRAG.from_config("config/harborrag.example.yaml") as harbor:
131
+ response = await harbor.chat.complete(
132
+ HarborChatRequest(messages=(HarborChatMessage.user("Summarize the results"),)),
133
+ prompt=ChatPrompt.CONCISE,
134
+ )
135
+ ```
136
+
137
+ ## Direct versus durable execution
138
+
139
+ Direct execution is the default: `ingestion.run` does the work inline.
140
+
141
+ The durable controls - `submit`, `status`, `pause`, `resume`, and `cancel` - need
142
+ `execution_mode: temporal` in your configuration **and** the `harborrag[temporal]` extra.
143
+ Calling them without both raises `ExecutionCapabilityError`:
144
+
145
+ ```python
146
+ task = await harbor.ingestion.submit(request)
147
+ status = await harbor.ingestion.status(task.task_id)
148
+ await harbor.ingestion.pause(task.task_id)
149
+ await harbor.ingestion.resume(task.task_id)
150
+ await harbor.ingestion.cancel(task.task_id)
151
+ ```
152
+
153
+ ## Related packages
154
+
155
+ `harborrag` re-exports stable APIs from the workspace packages. Install one directly for a
156
+ narrower dependency tree:
157
+
158
+ | Package | Contains |
159
+ | --- | --- |
160
+ | `harborrag-core` | provider-neutral contracts and domain models |
161
+ | `harborrag-adapters` | connectors, parsers, model clients, repositories |
162
+ | `harborrag-engine` | ingestion and retrieval orchestration |
163
+ | `harborrag-memory` | scope-aware conversation memory |
164
+ | `harborrag-runtime` | production composition and Temporal orchestration |
165
+ | `harborrag-app` | CLI and HTTP API |
166
+ | `harborrag-mcp-server` | MCP tools and transport |
167
+
168
+ ## Development
169
+
170
+ Tests for this package live in `packages/harborrag/tests/`. Run them from the repository
171
+ root:
172
+
173
+ ```shell
174
+ uv run pytest packages/harborrag/tests
175
+ ```
176
+
177
+ Licensed under the Apache License 2.0.
@@ -0,0 +1,127 @@
1
+ # harborrag
2
+
3
+ `harborrag` is the public SDK facade and installation bundle for
4
+ [HarborRAG](https://github.com/cbtw-apac/HarborRAG), a modular, provider-agnostic RAG
5
+ framework for engineering knowledge. Importing it does not initialize provider clients or
6
+ perform network I/O.
7
+
8
+ - Documentation: <https://cbtw-apac.github.io/HarborRAG/>
9
+ - Source: <https://github.com/cbtw-apac/HarborRAG>
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install "harborrag[all]" # everything
15
+ pip install "harborrag[local]" # local end-to-end ingestion and retrieval
16
+ pip install "harborrag[cli,qdrant]" # or just what you need
17
+ ```
18
+
19
+ A bare `pip install harborrag` installs the framework - contracts, engine, memory,
20
+ adapters, and runtime - but deliberately **no third-party provider clients**. There is no
21
+ vector store, no graph store, and no model client until you add an extra:
22
+
23
+ | Extra | Adds |
24
+ | --- | --- |
25
+ | `local` | Qdrant, FalkorDB, S3, model client, chunking, control plane, parsers, Docling PDF, tables |
26
+ | `chat` | the model client used by chat, embeddings, and reranking |
27
+ | `cli` | the `harborrag` command |
28
+ | `server` | the HTTP API plus the production and Temporal runtime |
29
+ | `mcp` | the MCP transport |
30
+ | `temporal` | the Temporal client for durable ingestion |
31
+ | `qdrant`, `falkordb`, `postgres`, `s3`, `redis` | one provider each |
32
+ | `all` | everything above; a superset of `local` |
33
+
34
+ Conversation memory (`harborrag-memory`) is already a required dependency, so it is
35
+ available in every install. The `harborrag[memory]` extra exists for explicitness and adds
36
+ nothing new.
37
+
38
+ See [Installation](https://cbtw-apac.github.io/HarborRAG/docs/getting-started/installation.html)
39
+ for PDF/OCR backends, editable installs, and platform notes.
40
+
41
+ ## Ingest and retrieve
42
+
43
+ `HarborRAG` exposes four async service facades - `ingestion`, `retrieval`, `graph`, and
44
+ `chat` - behind one async context manager. Connectors are declared by name in your
45
+ connector catalog, so credentials stay as environment references:
46
+
47
+ ```python
48
+ import asyncio
49
+
50
+ from harborrag import AccessContext, HarborRAG, IngestionRequest, RetrievalRequest
51
+
52
+
53
+ async def main() -> None:
54
+ access = AccessContext(principal_id="user-1", tenant_id="tenant-1")
55
+
56
+ async with HarborRAG.from_config("config/harborrag.example.yaml") as harbor:
57
+ await harbor.ingestion.run(
58
+ IngestionRequest(access=access, connector_name="harborrag-workspace")
59
+ )
60
+ results = await harbor.retrieval.search(
61
+ RetrievalRequest(access=access, query="deployment requirements")
62
+ )
63
+ print(results)
64
+
65
+
66
+ asyncio.run(main())
67
+ ```
68
+
69
+ `config/harborrag.example.yaml` ships in the repository checkout. Copy it next to your
70
+ application and point `from_config` at your own path.
71
+
72
+ ## Chat
73
+
74
+ Chat needs a model provider, so install `harborrag[chat]` (or any extra that includes it,
75
+ such as `local`, `server`, or `all`) and configure credentials first:
76
+
77
+ ```python
78
+ from harborrag import ChatPrompt, HarborChatMessage, HarborChatRequest, HarborRAG
79
+
80
+ async with HarborRAG.from_config("config/harborrag.example.yaml") as harbor:
81
+ response = await harbor.chat.complete(
82
+ HarborChatRequest(messages=(HarborChatMessage.user("Summarize the results"),)),
83
+ prompt=ChatPrompt.CONCISE,
84
+ )
85
+ ```
86
+
87
+ ## Direct versus durable execution
88
+
89
+ Direct execution is the default: `ingestion.run` does the work inline.
90
+
91
+ The durable controls - `submit`, `status`, `pause`, `resume`, and `cancel` - need
92
+ `execution_mode: temporal` in your configuration **and** the `harborrag[temporal]` extra.
93
+ Calling them without both raises `ExecutionCapabilityError`:
94
+
95
+ ```python
96
+ task = await harbor.ingestion.submit(request)
97
+ status = await harbor.ingestion.status(task.task_id)
98
+ await harbor.ingestion.pause(task.task_id)
99
+ await harbor.ingestion.resume(task.task_id)
100
+ await harbor.ingestion.cancel(task.task_id)
101
+ ```
102
+
103
+ ## Related packages
104
+
105
+ `harborrag` re-exports stable APIs from the workspace packages. Install one directly for a
106
+ narrower dependency tree:
107
+
108
+ | Package | Contains |
109
+ | --- | --- |
110
+ | `harborrag-core` | provider-neutral contracts and domain models |
111
+ | `harborrag-adapters` | connectors, parsers, model clients, repositories |
112
+ | `harborrag-engine` | ingestion and retrieval orchestration |
113
+ | `harborrag-memory` | scope-aware conversation memory |
114
+ | `harborrag-runtime` | production composition and Temporal orchestration |
115
+ | `harborrag-app` | CLI and HTTP API |
116
+ | `harborrag-mcp-server` | MCP tools and transport |
117
+
118
+ ## Development
119
+
120
+ Tests for this package live in `packages/harborrag/tests/`. Run them from the repository
121
+ root:
122
+
123
+ ```shell
124
+ uv run pytest packages/harborrag/tests
125
+ ```
126
+
127
+ Licensed under the Apache License 2.0.
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "harborrag"
3
+ version = "2.0.0a1"
4
+ description = "Meta-package public facade for HarborRAG."
5
+ requires-python = ">=3.12"
6
+ readme = "README.md"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "HarborRAG Contributors" }]
10
+ classifiers = [
11
+ "Development Status :: 3 - Alpha",
12
+ "License :: OSI Approved :: Apache Software License",
13
+ "Programming Language :: Python :: 3.12",
14
+ "Typing :: Typed",
15
+ ]
16
+ dependencies = [
17
+ "harborrag-core==2.0.0a1",
18
+ "harborrag-runtime==2.0.0a1",
19
+ ]
20
+
21
+ [project.urls]
22
+ Homepage = "https://github.com/cbtw-apac/HarborRAG"
23
+ Repository = "https://github.com/cbtw-apac/HarborRAG"
24
+ Issues = "https://github.com/cbtw-apac/HarborRAG/issues"
25
+
26
+ [project.optional-dependencies]
27
+ local = [
28
+ "harborrag-adapters[chunking,control-plane,falkordb,llm,parsers,pdf-docling,qdrant,s3,tables]==2.0.0a1",
29
+ ]
30
+ chat = ["harborrag-adapters[llm]==2.0.0a1"]
31
+ cli = ["harborrag-app==2.0.0a1"]
32
+ memory = ["harborrag-memory==2.0.0a1"]
33
+ server = [
34
+ "harborrag-app[api]==2.0.0a1",
35
+ "harborrag-runtime[production,temporal]==2.0.0a1",
36
+ ]
37
+ temporal = ["harborrag-runtime[temporal]==2.0.0a1"]
38
+ mcp = ["harborrag-mcp-server[mcp]==2.0.0a1"]
39
+ qdrant = ["harborrag-adapters[qdrant]==2.0.0a1"]
40
+ falkordb = ["harborrag-adapters[falkordb]==2.0.0a1"]
41
+ postgres = ["harborrag-adapters[control-plane,postgres]==2.0.0a1"]
42
+ s3 = ["harborrag-adapters[s3]==2.0.0a1"]
43
+ redis = ["harborrag-adapters[redis]==2.0.0a1"]
44
+ all = [
45
+ "harborrag-adapters[parsers-all]==2.0.0a1",
46
+ "harborrag-app[api]==2.0.0a1",
47
+ "harborrag-mcp-server[mcp]==2.0.0a1",
48
+ "harborrag-memory==2.0.0a1",
49
+ "harborrag-runtime[production,temporal]==2.0.0a1",
50
+ ]
51
+
52
+ [build-system]
53
+ requires = ["hatchling"]
54
+ build-backend = "hatchling.build"
55
+
56
+ [tool.hatch.build.targets.wheel]
57
+ packages = ["src/harborrag"]
@@ -0,0 +1,123 @@
1
+ """Stable, lightweight public facade for HarborRAG."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib import import_module
6
+ from typing import TYPE_CHECKING, Any
7
+
8
+ if TYPE_CHECKING:
9
+ from harborrag_core import Document
10
+ from harborrag_core.chunking import RelationType
11
+ from harborrag_core.models.chat import (
12
+ HarborChatMessage,
13
+ HarborChatRequest,
14
+ HarborChatResponse,
15
+ )
16
+ from harborrag_core.retrieval import (
17
+ GraphDirection,
18
+ GraphPathQuery,
19
+ GraphSubgraphQuery,
20
+ GraphTripletQuery,
21
+ )
22
+ from harborrag_core.security import AccessContext
23
+ from harborrag_runtime.chat import ChatPrompt
24
+ from harborrag_runtime.sdk import (
25
+ ExecutionMode,
26
+ GraphPathRequest,
27
+ GraphPathResponse,
28
+ GraphSubgraphRequest,
29
+ GraphSubgraphResponse,
30
+ GraphTripletRequest,
31
+ GraphTripletResponse,
32
+ HarborRAG,
33
+ HarborRAGConfig,
34
+ IngestionRequest,
35
+ IngestionResult,
36
+ IngestionStatus,
37
+ IngestionTaskReference,
38
+ RetrievalLane,
39
+ RetrievalRequest,
40
+ RetrievalResponse,
41
+ )
42
+
43
+ __all__ = [
44
+ "AccessContext",
45
+ "ChatPrompt",
46
+ "Document",
47
+ "ExecutionMode",
48
+ "GraphDirection",
49
+ "GraphPathQuery",
50
+ "GraphPathRequest",
51
+ "GraphPathResponse",
52
+ "GraphSubgraphQuery",
53
+ "GraphSubgraphRequest",
54
+ "GraphSubgraphResponse",
55
+ "GraphTripletQuery",
56
+ "GraphTripletRequest",
57
+ "GraphTripletResponse",
58
+ "HarborChatMessage",
59
+ "HarborChatRequest",
60
+ "HarborChatResponse",
61
+ "HarborRAG",
62
+ "HarborRAGConfig",
63
+ "IngestionRequest",
64
+ "IngestionResult",
65
+ "IngestionStatus",
66
+ "IngestionTaskReference",
67
+ "RelationType",
68
+ "RetrievalLane",
69
+ "RetrievalRequest",
70
+ "RetrievalResponse",
71
+ ]
72
+
73
+ _EXPORT_MODULES = {
74
+ "AccessContext": "harborrag_core.security",
75
+ "ChatPrompt": "harborrag_runtime.chat",
76
+ "Document": "harborrag_core",
77
+ "GraphDirection": "harborrag_core.retrieval",
78
+ "GraphPathQuery": "harborrag_core.retrieval",
79
+ "GraphSubgraphQuery": "harborrag_core.retrieval",
80
+ "GraphTripletQuery": "harborrag_core.retrieval",
81
+ "HarborChatMessage": "harborrag_core.models.chat",
82
+ "HarborChatRequest": "harborrag_core.models.chat",
83
+ "HarborChatResponse": "harborrag_core.models.chat",
84
+ "RelationType": "harborrag_core.chunking",
85
+ **dict.fromkeys(
86
+ (
87
+ "ExecutionMode",
88
+ "GraphPathRequest",
89
+ "GraphPathResponse",
90
+ "GraphSubgraphRequest",
91
+ "GraphSubgraphResponse",
92
+ "GraphTripletRequest",
93
+ "GraphTripletResponse",
94
+ "HarborRAG",
95
+ "HarborRAGConfig",
96
+ "IngestionRequest",
97
+ "IngestionResult",
98
+ "IngestionStatus",
99
+ "IngestionTaskReference",
100
+ "RetrievalLane",
101
+ "RetrievalRequest",
102
+ "RetrievalResponse",
103
+ ),
104
+ "harborrag_runtime.sdk",
105
+ ),
106
+ }
107
+
108
+
109
+ def __getattr__(name: str) -> Any:
110
+ """Load each public contract only when a caller first requests it."""
111
+ try:
112
+ module_name = _EXPORT_MODULES[name]
113
+ except KeyError as error:
114
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}") from error
115
+
116
+ value = getattr(import_module(module_name), name)
117
+ globals()[name] = value
118
+ return value
119
+
120
+
121
+ def __dir__() -> list[str]:
122
+ """Include lazy public exports in interactive discovery."""
123
+ return sorted(set(globals()) | set(__all__))
@@ -0,0 +1 @@
1
+ # PEP 561 marker: the public facade ships inline type information.
@@ -0,0 +1,102 @@
1
+ from __future__ import annotations
2
+
3
+ import subprocess
4
+ import sys
5
+ import tomllib
6
+ from pathlib import Path
7
+
8
+ import harborrag
9
+ from harborrag import (
10
+ AccessContext,
11
+ ChatPrompt,
12
+ Document,
13
+ ExecutionMode,
14
+ GraphPathQuery,
15
+ GraphPathRequest,
16
+ GraphSubgraphQuery,
17
+ GraphSubgraphRequest,
18
+ GraphTripletQuery,
19
+ GraphTripletRequest,
20
+ HarborChatMessage,
21
+ HarborChatRequest,
22
+ HarborRAG,
23
+ HarborRAGConfig,
24
+ RelationType,
25
+ RetrievalLane,
26
+ )
27
+
28
+ PACKAGE_ROOT = Path(__file__).resolve().parents[1]
29
+
30
+
31
+ def test_meta_exports_implemented_public_facade() -> None:
32
+ assert Document.__name__ == "Document"
33
+ assert AccessContext.__name__ == "AccessContext"
34
+ assert HarborRAG.__name__ == "HarborRAG"
35
+ assert HarborRAGConfig.__name__ == "HarborRAGConfig"
36
+ assert ExecutionMode.DIRECT == "direct"
37
+ assert RetrievalLane.HYBRID == "hybrid"
38
+ assert ChatPrompt.CONCISE == "concise"
39
+ assert RelationType.LINKS_TO == "links_to"
40
+ assert "CompositionRoot" not in harborrag.__all__
41
+
42
+
43
+ def test_every_declared_public_export_resolves() -> None:
44
+ assert set(harborrag.__all__) <= set(dir(harborrag))
45
+ assert all(getattr(harborrag, name) is not None for name in harborrag.__all__)
46
+
47
+
48
+ def test_chat_sdk_request_is_constructible_from_public_exports() -> None:
49
+ request = HarborChatRequest(messages=(HarborChatMessage.user("Hello"),))
50
+
51
+ assert request.messages[0].content == "Hello"
52
+
53
+
54
+ def test_graph_sdk_requests_are_constructible_from_public_exports() -> None:
55
+ access = AccessContext(principal_id="user-1", tenant_id="tenant-1")
56
+
57
+ triplet = GraphTripletRequest(
58
+ access=access,
59
+ query=GraphTripletQuery(subject="document-1"),
60
+ )
61
+ path = GraphPathRequest(
62
+ access=access,
63
+ query=GraphPathQuery(start_node="document-1", end_node="document-2"),
64
+ )
65
+ subgraph = GraphSubgraphRequest(
66
+ access=access,
67
+ query=GraphSubgraphQuery(start_node="document-1"),
68
+ )
69
+
70
+ assert triplet.access == path.access == subgraph.access == access
71
+
72
+
73
+ def test_base_install_declares_only_directly_imported_packages() -> None:
74
+ project = tomllib.loads((PACKAGE_ROOT / "pyproject.toml").read_text(encoding="utf-8"))[
75
+ "project"
76
+ ]
77
+
78
+ version = project["version"]
79
+ assert project["dependencies"] == [
80
+ f"harborrag-core=={version}",
81
+ f"harborrag-runtime=={version}",
82
+ ]
83
+ assert project["optional-dependencies"]["chat"] == [f"harborrag-adapters[llm]=={version}"]
84
+ assert project["optional-dependencies"]["local"] == [
85
+ "harborrag-adapters[chunking,control-plane,falkordb,llm,parsers,"
86
+ f"pdf-docling,qdrant,s3,tables]=={version}"
87
+ ]
88
+ assert f"harborrag-adapters[parsers-all]=={version}" in project["optional-dependencies"]["all"]
89
+
90
+
91
+ def test_base_facade_import_does_not_load_optional_providers() -> None:
92
+ script = """
93
+ import sys
94
+ import harborrag
95
+ from harborrag import HarborRAG
96
+
97
+ assert HarborRAG.__name__ == "HarborRAG"
98
+ for module in ("aioboto3", "falkordb", "litellm", "qdrant_client", "temporalio"):
99
+ assert module not in sys.modules, module
100
+ """
101
+
102
+ subprocess.run([sys.executable, "-c", script], check=True, timeout=15)