Skip to main content
This guide gets you from install to your first retrieval query. Install ToraDB with pip install toradb (Install), then continue below. For the bundled examples/full_example.py, clone the repository and run from the repo root.

Run the bundled example

python examples/full_example.py
This creates examples/_demo_db and walks through ingest, search strategies, SQL, and integrations.

Use the CLI

toradb query ./examples/_demo_db articles "Nikola Tesla motor"
toradb sql ./examples/_demo_db "SHOW TABLES"
toradb sql ./examples/_demo_db "SELECT tag, COUNT(*) FROM articles GROUP BY tag"

Minimal Python flow

import toradb

db = toradb.local("./quickstart_db")
docs = db.create_table("docs", mode="text")
docs.add([
    "Nikola Tesla invented the alternating current induction motor",
    "Marie Curie studied radioactivity",
])

results = docs.search("Nikola Tesla alternating current motor", top_k=3)
print(results.to_pandas())

Reindex (optional)

toradb reindex ./quickstart_db docs --using BM25

Next steps