Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ahvn.top/llms.txt

Use this file to discover all available pages before exploring further.

Different fields of the same entity can live in different backends.

1. What routing does

Routing maps entity fields to backend instances and strategies. A single entity can have:
  • text fields in a relational backend (SQLite, Postgres)
  • vector fields in a vector backend (Milvus, pgvector, in-memory)
  • blob fields in object storage
HeavenBase resolves routing at query time and compiles fragments per backend.

2. Default routing

Without explicit routes, all fields go to the default backend.

3. Field-level route declarations

ws = hb.HeavenBase(
    "docs",
    backends={
        "sql": {"backend_type": "sqlite"},
        "vec": {"backend_type": "inmem"},
    },
    routes={
        Document.embedding: {"backend": "vec", "strategy": hb.VectorIndex},
    }
)

4. Inspect routing decisions

qb = ws.find(Document, Document.embedding.near([0.1, 0.2]))
print(qb.explain())
explain() shows the route, backend, strategy, and handler for each query leaf without executing.

Further Exploration

Related resources: