Skip to main content

Table.add(docs: list) -> int

Ingest documents. Each item is a str or dict with a text field.
n = table.add([{"text": "Nikola Tesla AC motor", "tag": "history"}])

Table.add_arrow(arrow_table) -> int

Ingest a PyArrow table via the C Data interface. Requires pyarrow.

Table.search(query, top_k=None, offset=None, strategy=None, explain=None, graph_expand=None, depth=None, query_vector=None) -> SearchResults

query
str
required
Query text (and metadata filter syntax when supported).
top_k
int
default:"20"
Maximum hits to return.
offset
int
default:"0"
Skip first N results.
strategy
str
sparse, dense, diskann, hyde, crag, distributed, hybrid, etc.
explain
bool
default:"false"
Attach explain text to results.
graph_expand
bool
default:"false"
Expand results via graph neighbors.
depth
int
default:"2"
Graph expansion depth.
query_vector
list[float]
Dense query embedding for ANN strategies.
results = table.search("Nikola Tesla", top_k=5, strategy="hybrid")

stream_search(table, query, batch_size=128, ...)

Module helper in toradb.table — yields SearchResults batches.
from toradb.table import stream_search
for batch in stream_search(table, "Tesla", batch_size=32):
    print(batch.to_pandas())
See Search strategies.