Connect
SDK & REST
Use the TypeScript SDK, Python SDK, or REST API when RushDB is part of your application, service, script, or data pipeline.
The fastest useful test is a nested import followed by a search. Nested objects become linked records automatically.
Install, Connect, and Write
- Python
- TypeScript
- shell
pip install rushdb
from rushdb import RushDB
db = RushDB("RUSHDB_API_KEY")
db.records.create_many(
label="PROJECT",
data={
"name": "RushDB adoption",
"TASK": [
{"title": "Connect RushDB", "status": "done"},
{"title": "Query linked records", "status": "pending"},
],
},
)
npm install @rushdb/javascript-sdk
import RushDB from '@rushdb/javascript-sdk'
const db = new RushDB('RUSHDB_API_KEY')
await db.records.importJson({
label: 'PROJECT',
data: {
name: 'RushDB adoption',
TASK: [
{ title: 'Connect RushDB', status: 'done' },
{ title: 'Query linked records', status: 'pending' }
]
}
})
export RUSHDB_API_KEY=your-api-key
curl -X POST https://api.rushdb.com/api/v1/records/import/json \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "PROJECT",
"data": {
"name": "RushDB adoption",
"TASK": [
{"title": "Connect RushDB", "status": "done"},
{"title": "Query linked records", "status": "pending"}
]
}
}'
Verify with a Read
- Python
- TypeScript
- shell
projects = db.records.find({
"labels": ["PROJECT"],
"where": {"name": "RushDB adoption"},
})
print(projects.total, projects.data)
const { data: projects, total } = await db.records.find({
labels: ['PROJECT'],
where: { name: 'RushDB adoption' }
})
console.log({ total, projects })
curl -X POST https://api.rushdb.com/api/v1/records/search \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"labels": ["PROJECT"],
"where": {"name": "RushDB adoption"}
}'
Self-Hosted Instance
- Python
- TypeScript
- shell
db = RushDB("RUSHDB_API_KEY", url="https://your-rushdb.example.com")
const db = new RushDB('RUSHDB_API_KEY', {
url: 'https://your-rushdb.example.com/api/v1'
})
export RUSHDB_URL=https://your-rushdb.example.com
curl -X POST "$RUSHDB_URL/api/v1/records/search" \
-H "Authorization: Bearer $RUSHDB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"labels": ["PROJECT"]}'
Add Semantic Search
Semantic search requires a one-time embedding index for the label and text property you want to search. After the first write/read flow works:
- Create an embedding index.
- Wait until the index status is
ready. - Run semantic search.