rushdb 2.10.0__tar.gz → 3.0.1__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.
- {rushdb-2.10.0 → rushdb-3.0.1}/.env.example +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/.github/workflows/ci.yml +26 -11
- {rushdb-2.10.0 → rushdb-3.0.1}/.gitignore +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/CODE_OF_CONDUCT.md +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/CONTRIBUTING.md +1 -1
- {rushdb-2.10.0 → rushdb-3.0.1}/LICENSE +0 -0
- rushdb-2.10.0/README.md → rushdb-3.0.1/PKG-INFO +117 -6
- rushdb-2.10.0/PKG-INFO → rushdb-3.0.1/README.md +103 -31
- rushdb-3.0.1/pyproject.toml +58 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/rushdb-logo.svg +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/__init__.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/__init__.py +13 -1
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/__init__.py +4 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/ai.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/base.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/labels.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/properties.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/query.py +3 -4
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/records.py +114 -35
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/relationship_patterns.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/relationships.py +0 -0
- rushdb-3.0.1/src/rushdb/api/text_indexes.py +63 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/api/transactions.py +7 -3
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/client.py +58 -19
- rushdb-3.0.1/src/rushdb/common.py +65 -0
- rushdb-3.0.1/src/rushdb/direct/__init__.py +5 -0
- rushdb-3.0.1/src/rushdb/direct/capabilities.py +38 -0
- rushdb-3.0.1/src/rushdb/direct/engine.py +79 -0
- rushdb-3.0.1/src/rushdb/direct/router.py +1436 -0
- rushdb-3.0.1/src/rushdb/direct/schema.py +204 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/__init__.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/api_response.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/property.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/record.py +5 -2
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/relationship.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/result.py +11 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/search_query.py +2 -3
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/models/transaction.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/src/rushdb/utils/token_prefix.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/__init__.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_ai_vector_search.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_base_setup.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_create_import.py +0 -0
- rushdb-3.0.1/tests/test_direct_mode.py +585 -0
- rushdb-3.0.1/tests/test_direct_mode_live.py +190 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_relationship_patterns.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_search_query.py +0 -0
- {rushdb-2.10.0 → rushdb-3.0.1}/tests/test_search_result.py +0 -0
- rushdb-3.0.1/uv.lock +832 -0
- rushdb-2.10.0/pyproject.toml +0 -95
- rushdb-2.10.0/src/rushdb/common.py +0 -33
- rushdb-2.10.0/uv.lock +0 -1004
|
File without changes
|
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
strategy:
|
|
15
15
|
matrix:
|
|
16
|
-
python-version: ["3.
|
|
16
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
17
17
|
|
|
18
18
|
steps:
|
|
19
19
|
- uses: actions/checkout@v4
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
run: |
|
|
44
44
|
uv run pytest
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
build:
|
|
47
47
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
48
48
|
runs-on: ubuntu-latest
|
|
49
49
|
needs: test
|
|
@@ -61,13 +61,28 @@ jobs:
|
|
|
61
61
|
with:
|
|
62
62
|
version: "latest"
|
|
63
63
|
|
|
64
|
-
- name:
|
|
65
|
-
run:
|
|
66
|
-
uv sync --dev
|
|
64
|
+
- name: Build distributions
|
|
65
|
+
run: uv build
|
|
67
66
|
|
|
68
|
-
- name:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
- name: Upload distributions
|
|
68
|
+
uses: actions/upload-artifact@v4
|
|
69
|
+
with:
|
|
70
|
+
name: dist
|
|
71
|
+
path: dist/
|
|
72
|
+
|
|
73
|
+
publish:
|
|
74
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
needs: build
|
|
77
|
+
permissions:
|
|
78
|
+
id-token: write
|
|
79
|
+
|
|
80
|
+
steps:
|
|
81
|
+
- name: Download distributions
|
|
82
|
+
uses: actions/download-artifact@v4
|
|
83
|
+
with:
|
|
84
|
+
name: dist
|
|
85
|
+
path: dist/
|
|
86
|
+
|
|
87
|
+
- name: Publish to PyPI
|
|
88
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
File without changes
|
|
File without changes
|
|
@@ -15,7 +15,7 @@ When reporting an issue, include the following information:
|
|
|
15
15
|
|
|
16
16
|
- Specify the version of RushDB you are using:
|
|
17
17
|
- **Cloud**: Mention if you are using the latest cloud version.
|
|
18
|
-
- **Self-hosted**: Provide the
|
|
18
|
+
- **Self-hosted engine (direct mode)**: Provide the engine version (`rushdb --version`) and the SDK version.
|
|
19
19
|
|
|
20
20
|
3. **Steps to Reproduce**
|
|
21
21
|
|
|
File without changes
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rushdb
|
|
3
|
+
Version: 3.0.1
|
|
4
|
+
Summary: RushDB SDK for Python: the client for RushDB, the database for AI (RushDB Cloud or self-hosted)
|
|
5
|
+
Project-URL: Homepage, https://github.com/rush-db/rushdb-python
|
|
6
|
+
Project-URL: Repository, https://github.com/rush-db/rushdb-python
|
|
7
|
+
Project-URL: Documentation, https://docs.rushdb.com
|
|
8
|
+
Author-email: RushDB Team <hi@rushdb.com>
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent-memory,ai-agents,cypher,database,database-for-ai,full-text-search,graph-database,hybrid-search,mcp,rag,rushdb,self-hosted,sql,vector-search
|
|
12
|
+
Requires-Python: >=3.10
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
1
15
|
<div align="center">
|
|
2
16
|
|
|
3
17
|

|
|
4
18
|
|
|
5
19
|
# RushDB — Python SDK
|
|
6
20
|
|
|
7
|
-
###
|
|
21
|
+
### RushDB — the database for AI
|
|
8
22
|
|
|
9
|
-
|
|
10
|
-
No schema. No pipeline. No glue code.
|
|
23
|
+
One database for your records, their relationships, and search over them.
|
|
11
24
|
|
|
12
25
|

|
|
13
26
|

|
|
14
27
|

|
|
15
28
|
|
|
16
|
-
[📖 Documentation](https://docs.rushdb.com/
|
|
29
|
+
[📖 Documentation](https://docs.rushdb.com/3.x/connect/sdks/) • [🌐 Website](https://rushdb.com) • [☁️ Cloud](https://app.rushdb.com)
|
|
17
30
|
|
|
18
31
|
</div>
|
|
19
32
|
|
|
@@ -37,6 +50,74 @@ pip install rushdb
|
|
|
37
50
|
|
|
38
51
|
---
|
|
39
52
|
|
|
53
|
+
## Compatibility
|
|
54
|
+
|
|
55
|
+
| Package | RushDB 3.x and RushDB Cloud | RushDB 2.x (legacy) |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `@rushdb/javascript-sdk` | 3.x | 2.11.0: `npm i @rushdb/javascript-sdk@2` |
|
|
58
|
+
| `rushdb` (PyPI) | 3.x | 2.10.0: `pip install "rushdb<3"` |
|
|
59
|
+
| `@rushdb/mcp-server` | 3.x | 2.13.0: `npx @rushdb/mcp-server@2` |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## RushDB Cloud or a self-hosted engine
|
|
64
|
+
|
|
65
|
+
The SDK works with RushDB in one of two ways:
|
|
66
|
+
|
|
67
|
+
| | RushDB Cloud | Self-hosted RushDB engine (direct mode) |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| What you run | nothing: the managed service at [app.rushdb.com](https://app.rushdb.com) | one `rushdb` binary, on your own infrastructure |
|
|
70
|
+
| Connect with | an API key | the engine URL and the engine token |
|
|
71
|
+
|
|
72
|
+
The engine is what you can self-host. RushDB Cloud runs that engine for you and adds the dashboard,
|
|
73
|
+
managed embeddings and the AI features (natural-language search, relationship-pattern suggestions),
|
|
74
|
+
which exist only in RushDB Cloud.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from rushdb import RushDB
|
|
78
|
+
|
|
79
|
+
# RushDB Cloud
|
|
80
|
+
db = RushDB("RUSHDB_API_KEY")
|
|
81
|
+
|
|
82
|
+
# A self-hosted engine
|
|
83
|
+
db = RushDB(
|
|
84
|
+
"ENGINE_TOKEN",
|
|
85
|
+
direct=True,
|
|
86
|
+
engine_url="http://127.0.0.1:3000",
|
|
87
|
+
scope="tenant-1", # only for an engine started with --multitenant
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
What each offers:
|
|
92
|
+
|
|
93
|
+
| Feature | Cloud | Self-hosted engine |
|
|
94
|
+
| --- | :---: | :---: |
|
|
95
|
+
| Records: create, read, update, set, upsert, delete, `find` with `where`, `orderBy`, `select`, `groupBy` | ✓ | ✓ |
|
|
96
|
+
| Relationships: `attach`/`detach`, `relationships.create_many`/`delete_many`/`find` | ✓ | ✓ |
|
|
97
|
+
| Labels, properties, property values | ✓ | ✓ |
|
|
98
|
+
| Import JSON and CSV, export CSV | ✓ | ✓ |
|
|
99
|
+
| External vector indexes; vector search with a `queryVector` you supply | ✓ | ✓ |
|
|
100
|
+
| Raw openCypher (`query.raw`; the engine needs `--languages cypher`) | ✓ | ✓ |
|
|
101
|
+
| Schema (`ai.get_schema`, `ai.get_schema_markdown`) | ✓ | ✓ |
|
|
102
|
+
| Keyword (BM25) search (`records.text_search`), text indexes (`text_indexes.*`), hybrid search | ✓ | ✓ |
|
|
103
|
+
| Transactions | ✓ | record creates, updates, sets, deletes by id, attaches and imports are staged; other writes refuse a transaction |
|
|
104
|
+
| Managed embeddings: managed indexes, `records.vector_search` by text `query` | ✓ | — |
|
|
105
|
+
| Natural-language search (`ai.search`) | ✓ | — |
|
|
106
|
+
| Relationship-pattern suggestions (`relationships.patterns.*`) | ✓ | — |
|
|
107
|
+
| Project settings (`settings.get`), dashboard, team access | ✓ | — |
|
|
108
|
+
|
|
109
|
+
In direct mode a Cloud-only method raises `CloudOnlyError` (with `method` and `reason`) before
|
|
110
|
+
sending anything, and no request ever goes to RushDB Cloud. A write the engine cannot stage into a
|
|
111
|
+
transaction raises `DirectModeError`, also before sending anything. The list is available in code:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from rushdb import CLOUD_ONLY_METHODS, CloudOnlyError, is_cloud_only_method
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`db.engine.execute()` runs any Protocol v1 operation directly.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
40
121
|
## Agent memory in 3 lines
|
|
41
122
|
|
|
42
123
|
Get an API key at [app.rushdb.com](https://app.rushdb.com).
|
|
@@ -231,6 +312,36 @@ print(results.search_query)
|
|
|
231
312
|
`db.ai.search({...})` still works as a deprecated vector-search alias, but new
|
|
232
313
|
code should use `db.records.vector_search({...})`.
|
|
233
314
|
|
|
315
|
+
## Keyword And Hybrid Search
|
|
316
|
+
|
|
317
|
+
Declare a BM25 text index, then search it by keywords:
|
|
318
|
+
|
|
319
|
+
```python
|
|
320
|
+
db.text_indexes.create({'label': 'MEMORY', 'property': 'content'})
|
|
321
|
+
|
|
322
|
+
results = db.records.text_search({
|
|
323
|
+
'query': 'quarterly results',
|
|
324
|
+
'labels': ['MEMORY'],
|
|
325
|
+
'where': {'agent_id': 'agent-42'},
|
|
326
|
+
'limit': 5,
|
|
327
|
+
})
|
|
328
|
+
print(results.total, results.meta['textSearch'])
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
Add a `text` leg to a vector search to fuse keyword and vector ranking. `fusion`
|
|
332
|
+
is `rrf` (default) or `dbsf`; `weight` and `prefetchLimit` tune each leg:
|
|
333
|
+
|
|
334
|
+
```python
|
|
335
|
+
results = db.records.vector_search({
|
|
336
|
+
'labels': ['MEMORY'],
|
|
337
|
+
'propertyName': 'content',
|
|
338
|
+
'queryVector': embedding,
|
|
339
|
+
'text': {'query': 'quarterly results', 'weight': 0.5},
|
|
340
|
+
'fusion': 'dbsf',
|
|
341
|
+
'limit': 5,
|
|
342
|
+
})
|
|
343
|
+
```
|
|
344
|
+
|
|
234
345
|
---
|
|
235
346
|
|
|
236
347
|
## Record API
|
|
@@ -279,7 +390,7 @@ from rushdb import RushDB
|
|
|
279
390
|
|
|
280
391
|
db = RushDB(
|
|
281
392
|
'RUSHDB_API_KEY',
|
|
282
|
-
url='
|
|
393
|
+
url='https://api.rushdb.com/api/v1', # a different RushDB Cloud API endpoint; this is the default
|
|
283
394
|
timeout=30,
|
|
284
395
|
)
|
|
285
396
|
```
|
|
@@ -288,7 +399,7 @@ db = RushDB(
|
|
|
288
399
|
|
|
289
400
|
## Documentation
|
|
290
401
|
|
|
291
|
-
[docs.rushdb.com/
|
|
402
|
+
[docs.rushdb.com/3.x/connect/sdks](https://docs.rushdb.com/3.x/connect/sdks/) and the [Python reference](https://docs.rushdb.com/3.x/learn/reference/python/) — full API reference, vector search, aggregations, and more.
|
|
292
403
|
|
|
293
404
|
---
|
|
294
405
|
|
|
@@ -1,44 +1,18 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: rushdb
|
|
3
|
-
Version: 2.10.0
|
|
4
|
-
Summary: RushDB Python SDK — memory layer for AI agents and modern apps
|
|
5
|
-
Project-URL: Homepage, https://github.com/rush-db/rushdb-python
|
|
6
|
-
Project-URL: Repository, https://github.com/rush-db/rushdb-python
|
|
7
|
-
Project-URL: Documentation, https://docs.rushdb.com
|
|
8
|
-
Author-email: RushDB Team <hi@rushdb.com>
|
|
9
|
-
License: Apache-2.0
|
|
10
|
-
License-File: LICENSE
|
|
11
|
-
Keywords: agent memory,agent-memory,ai agents,ai memory,ai-agents,ai-memory,cloud,database,embedding,embeddings,graph,graph database,graph-database,json normalization,json-normalization,knowledge graph,knowledge-graph,llm memory,llm-memory,mcp,memory layer,memory-layer,no-schema,persistence,rag,relationships,rest api,rest-api,retrieval augmented generation,rush db,rush-db,rushdb,schema-less,schemaless,self-hosted,vector search,vector-search
|
|
12
|
-
Requires-Python: >=3.8
|
|
13
|
-
Requires-Dist: python-dotenv>=1.0.0
|
|
14
|
-
Requires-Dist: requests>=2.31.0
|
|
15
|
-
Provides-Extra: dev
|
|
16
|
-
Requires-Dist: black>=23.7.0; extra == 'dev'
|
|
17
|
-
Requires-Dist: isort>=5.12.0; extra == 'dev'
|
|
18
|
-
Requires-Dist: mypy>=1.4.1; extra == 'dev'
|
|
19
|
-
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
20
|
-
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
21
|
-
Requires-Dist: ruff>=0.0.280; extra == 'dev'
|
|
22
|
-
Requires-Dist: types-python-dateutil>=2.8.19.14; extra == 'dev'
|
|
23
|
-
Requires-Dist: types-requests>=2.31.0.1; extra == 'dev'
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
|
|
26
1
|
<div align="center">
|
|
27
2
|
|
|
28
3
|

|
|
29
4
|
|
|
30
5
|
# RushDB — Python SDK
|
|
31
6
|
|
|
32
|
-
###
|
|
7
|
+
### RushDB — the database for AI
|
|
33
8
|
|
|
34
|
-
|
|
35
|
-
No schema. No pipeline. No glue code.
|
|
9
|
+
One database for your records, their relationships, and search over them.
|
|
36
10
|
|
|
37
11
|

|
|
38
12
|

|
|
39
13
|

|
|
40
14
|
|
|
41
|
-
[📖 Documentation](https://docs.rushdb.com/
|
|
15
|
+
[📖 Documentation](https://docs.rushdb.com/3.x/connect/sdks/) • [🌐 Website](https://rushdb.com) • [☁️ Cloud](https://app.rushdb.com)
|
|
42
16
|
|
|
43
17
|
</div>
|
|
44
18
|
|
|
@@ -62,6 +36,74 @@ pip install rushdb
|
|
|
62
36
|
|
|
63
37
|
---
|
|
64
38
|
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
| Package | RushDB 3.x and RushDB Cloud | RushDB 2.x (legacy) |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| `@rushdb/javascript-sdk` | 3.x | 2.11.0: `npm i @rushdb/javascript-sdk@2` |
|
|
44
|
+
| `rushdb` (PyPI) | 3.x | 2.10.0: `pip install "rushdb<3"` |
|
|
45
|
+
| `@rushdb/mcp-server` | 3.x | 2.13.0: `npx @rushdb/mcp-server@2` |
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## RushDB Cloud or a self-hosted engine
|
|
50
|
+
|
|
51
|
+
The SDK works with RushDB in one of two ways:
|
|
52
|
+
|
|
53
|
+
| | RushDB Cloud | Self-hosted RushDB engine (direct mode) |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| What you run | nothing: the managed service at [app.rushdb.com](https://app.rushdb.com) | one `rushdb` binary, on your own infrastructure |
|
|
56
|
+
| Connect with | an API key | the engine URL and the engine token |
|
|
57
|
+
|
|
58
|
+
The engine is what you can self-host. RushDB Cloud runs that engine for you and adds the dashboard,
|
|
59
|
+
managed embeddings and the AI features (natural-language search, relationship-pattern suggestions),
|
|
60
|
+
which exist only in RushDB Cloud.
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from rushdb import RushDB
|
|
64
|
+
|
|
65
|
+
# RushDB Cloud
|
|
66
|
+
db = RushDB("RUSHDB_API_KEY")
|
|
67
|
+
|
|
68
|
+
# A self-hosted engine
|
|
69
|
+
db = RushDB(
|
|
70
|
+
"ENGINE_TOKEN",
|
|
71
|
+
direct=True,
|
|
72
|
+
engine_url="http://127.0.0.1:3000",
|
|
73
|
+
scope="tenant-1", # only for an engine started with --multitenant
|
|
74
|
+
)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
What each offers:
|
|
78
|
+
|
|
79
|
+
| Feature | Cloud | Self-hosted engine |
|
|
80
|
+
| --- | :---: | :---: |
|
|
81
|
+
| Records: create, read, update, set, upsert, delete, `find` with `where`, `orderBy`, `select`, `groupBy` | ✓ | ✓ |
|
|
82
|
+
| Relationships: `attach`/`detach`, `relationships.create_many`/`delete_many`/`find` | ✓ | ✓ |
|
|
83
|
+
| Labels, properties, property values | ✓ | ✓ |
|
|
84
|
+
| Import JSON and CSV, export CSV | ✓ | ✓ |
|
|
85
|
+
| External vector indexes; vector search with a `queryVector` you supply | ✓ | ✓ |
|
|
86
|
+
| Raw openCypher (`query.raw`; the engine needs `--languages cypher`) | ✓ | ✓ |
|
|
87
|
+
| Schema (`ai.get_schema`, `ai.get_schema_markdown`) | ✓ | ✓ |
|
|
88
|
+
| Keyword (BM25) search (`records.text_search`), text indexes (`text_indexes.*`), hybrid search | ✓ | ✓ |
|
|
89
|
+
| Transactions | ✓ | record creates, updates, sets, deletes by id, attaches and imports are staged; other writes refuse a transaction |
|
|
90
|
+
| Managed embeddings: managed indexes, `records.vector_search` by text `query` | ✓ | — |
|
|
91
|
+
| Natural-language search (`ai.search`) | ✓ | — |
|
|
92
|
+
| Relationship-pattern suggestions (`relationships.patterns.*`) | ✓ | — |
|
|
93
|
+
| Project settings (`settings.get`), dashboard, team access | ✓ | — |
|
|
94
|
+
|
|
95
|
+
In direct mode a Cloud-only method raises `CloudOnlyError` (with `method` and `reason`) before
|
|
96
|
+
sending anything, and no request ever goes to RushDB Cloud. A write the engine cannot stage into a
|
|
97
|
+
transaction raises `DirectModeError`, also before sending anything. The list is available in code:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from rushdb import CLOUD_ONLY_METHODS, CloudOnlyError, is_cloud_only_method
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`db.engine.execute()` runs any Protocol v1 operation directly.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
65
107
|
## Agent memory in 3 lines
|
|
66
108
|
|
|
67
109
|
Get an API key at [app.rushdb.com](https://app.rushdb.com).
|
|
@@ -256,6 +298,36 @@ print(results.search_query)
|
|
|
256
298
|
`db.ai.search({...})` still works as a deprecated vector-search alias, but new
|
|
257
299
|
code should use `db.records.vector_search({...})`.
|
|
258
300
|
|
|
301
|
+
## Keyword And Hybrid Search
|
|
302
|
+
|
|
303
|
+
Declare a BM25 text index, then search it by keywords:
|
|
304
|
+
|
|
305
|
+
```python
|
|
306
|
+
db.text_indexes.create({'label': 'MEMORY', 'property': 'content'})
|
|
307
|
+
|
|
308
|
+
results = db.records.text_search({
|
|
309
|
+
'query': 'quarterly results',
|
|
310
|
+
'labels': ['MEMORY'],
|
|
311
|
+
'where': {'agent_id': 'agent-42'},
|
|
312
|
+
'limit': 5,
|
|
313
|
+
})
|
|
314
|
+
print(results.total, results.meta['textSearch'])
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Add a `text` leg to a vector search to fuse keyword and vector ranking. `fusion`
|
|
318
|
+
is `rrf` (default) or `dbsf`; `weight` and `prefetchLimit` tune each leg:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
results = db.records.vector_search({
|
|
322
|
+
'labels': ['MEMORY'],
|
|
323
|
+
'propertyName': 'content',
|
|
324
|
+
'queryVector': embedding,
|
|
325
|
+
'text': {'query': 'quarterly results', 'weight': 0.5},
|
|
326
|
+
'fusion': 'dbsf',
|
|
327
|
+
'limit': 5,
|
|
328
|
+
})
|
|
329
|
+
```
|
|
330
|
+
|
|
259
331
|
---
|
|
260
332
|
|
|
261
333
|
## Record API
|
|
@@ -304,7 +376,7 @@ from rushdb import RushDB
|
|
|
304
376
|
|
|
305
377
|
db = RushDB(
|
|
306
378
|
'RUSHDB_API_KEY',
|
|
307
|
-
url='
|
|
379
|
+
url='https://api.rushdb.com/api/v1', # a different RushDB Cloud API endpoint; this is the default
|
|
308
380
|
timeout=30,
|
|
309
381
|
)
|
|
310
382
|
```
|
|
@@ -313,7 +385,7 @@ db = RushDB(
|
|
|
313
385
|
|
|
314
386
|
## Documentation
|
|
315
387
|
|
|
316
|
-
[docs.rushdb.com/
|
|
388
|
+
[docs.rushdb.com/3.x/connect/sdks](https://docs.rushdb.com/3.x/connect/sdks/) and the [Python reference](https://docs.rushdb.com/3.x/learn/reference/python/) — full API reference, vector search, aggregations, and more.
|
|
317
389
|
|
|
318
390
|
---
|
|
319
391
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "rushdb"
|
|
3
|
+
version = "3.0.1"
|
|
4
|
+
description = "RushDB SDK for Python: the client for RushDB, the database for AI (RushDB Cloud or self-hosted)"
|
|
5
|
+
authors = [
|
|
6
|
+
{name = "RushDB Team", email = "hi@rushdb.com"}
|
|
7
|
+
]
|
|
8
|
+
license = {text = "Apache-2.0"}
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
keywords = [
|
|
12
|
+
"rushdb",
|
|
13
|
+
"database",
|
|
14
|
+
"database-for-ai",
|
|
15
|
+
"ai-agents",
|
|
16
|
+
"graph-database",
|
|
17
|
+
"sql",
|
|
18
|
+
"cypher",
|
|
19
|
+
"vector-search",
|
|
20
|
+
"full-text-search",
|
|
21
|
+
"hybrid-search",
|
|
22
|
+
"mcp",
|
|
23
|
+
"self-hosted",
|
|
24
|
+
"rag",
|
|
25
|
+
"agent-memory"
|
|
26
|
+
]
|
|
27
|
+
dependencies = []
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/rush-db/rushdb-python"
|
|
31
|
+
Repository = "https://github.com/rush-db/rushdb-python"
|
|
32
|
+
Documentation = "https://docs.rushdb.com"
|
|
33
|
+
|
|
34
|
+
[build-system]
|
|
35
|
+
requires = ["hatchling"]
|
|
36
|
+
build-backend = "hatchling.build"
|
|
37
|
+
|
|
38
|
+
[tool.hatch.build.targets.wheel]
|
|
39
|
+
packages = ["src/rushdb"]
|
|
40
|
+
|
|
41
|
+
[tool.ruff]
|
|
42
|
+
line-length = 120
|
|
43
|
+
|
|
44
|
+
[tool.isort]
|
|
45
|
+
profile = "black"
|
|
46
|
+
|
|
47
|
+
[dependency-groups]
|
|
48
|
+
dev = [
|
|
49
|
+
"black>=26.3.1",
|
|
50
|
+
"isort>=5.13.2",
|
|
51
|
+
"mypy>=1.14.1",
|
|
52
|
+
"pygments>=2.20.0",
|
|
53
|
+
"pytest>=9.0.3",
|
|
54
|
+
"pytest-cov>=5.0.0",
|
|
55
|
+
"python-dotenv>=1.2.2",
|
|
56
|
+
"ruff>=0.12.1,<0.13",
|
|
57
|
+
"types-python-dateutil>=2.9.0.20241206",
|
|
58
|
+
]
|
|
File without changes
|
|
File without changes
|
|
@@ -8,8 +8,14 @@ from .api.query import QueryAPI
|
|
|
8
8
|
from .api.records import pick_record_id
|
|
9
9
|
from .api.relationship_patterns import RelationshipPatternsAPI
|
|
10
10
|
from .api.relationships import RelationsAPI
|
|
11
|
+
from .api.text_indexes import TextIndexesAPI
|
|
11
12
|
from .client import RushDB
|
|
12
|
-
from .common import NonUniqueResultError, RushDBError
|
|
13
|
+
from .common import CloudOnlyError, DirectModeError, NonUniqueResultError, RushDBError
|
|
14
|
+
from .direct.capabilities import (
|
|
15
|
+
CLOUD_ONLY_FORMS,
|
|
16
|
+
CLOUD_ONLY_METHODS,
|
|
17
|
+
is_cloud_only_method,
|
|
18
|
+
)
|
|
13
19
|
from .models.api_response import ApiResponse
|
|
14
20
|
from .models.property import Property
|
|
15
21
|
from .models.record import Record, RecordTarget, RelationTarget
|
|
@@ -31,6 +37,11 @@ from .models.search_query import (
|
|
|
31
37
|
from .models.transaction import Transaction
|
|
32
38
|
|
|
33
39
|
__all__ = [
|
|
40
|
+
"CLOUD_ONLY_FORMS",
|
|
41
|
+
"CLOUD_ONLY_METHODS",
|
|
42
|
+
"CloudOnlyError",
|
|
43
|
+
"DirectModeError",
|
|
44
|
+
"is_cloud_only_method",
|
|
34
45
|
"RushDB",
|
|
35
46
|
"RushDBError",
|
|
36
47
|
"NonUniqueResultError",
|
|
@@ -57,4 +68,5 @@ __all__ = [
|
|
|
57
68
|
"RelationshipPatternsAPI",
|
|
58
69
|
"ApiResponse",
|
|
59
70
|
"AIAPI",
|
|
71
|
+
"TextIndexesAPI",
|
|
60
72
|
]
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
from .ai import AIAPI
|
|
1
2
|
from .labels import LabelsAPI
|
|
2
3
|
from .properties import PropertiesAPI
|
|
3
4
|
from .query import QueryAPI
|
|
4
5
|
from .records import RecordsAPI
|
|
5
6
|
from .relationship_patterns import RelationshipPatternsAPI
|
|
6
7
|
from .relationships import RelationsAPI
|
|
8
|
+
from .text_indexes import TextIndexesAPI
|
|
7
9
|
from .transactions import TransactionsAPI
|
|
8
10
|
|
|
9
11
|
__all__ = [
|
|
12
|
+
"AIAPI",
|
|
10
13
|
"RecordsAPI",
|
|
11
14
|
"PropertiesAPI",
|
|
12
15
|
"LabelsAPI",
|
|
@@ -14,4 +17,5 @@ __all__ = [
|
|
|
14
17
|
"QueryAPI",
|
|
15
18
|
"RelationsAPI",
|
|
16
19
|
"RelationshipPatternsAPI",
|
|
20
|
+
"TextIndexesAPI",
|
|
17
21
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -5,11 +5,10 @@ from .base import BaseAPI
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class QueryAPI(BaseAPI):
|
|
8
|
-
"""API client for executing raw
|
|
8
|
+
"""API client for executing raw openCypher queries.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
RushDB Cloud. It will not function for self-hosted or local-only deployments.
|
|
10
|
+
Works on RushDB Cloud and on a self-hosted RushDB engine in direct mode
|
|
11
|
+
(the engine must be started with ``--languages cypher``).
|
|
13
12
|
|
|
14
13
|
Example:
|
|
15
14
|
>>> from rushdb import RushDB
|