Skip to main content
Vector fields route through the same workspace storage planner as SQL and search fields.

1. Supported vector backends

HeavenBase includes vector backend implementations for:
  • lance
  • milvus
  • pgvector
  • chroma
  • pinecone
  • inmem
Use inmem for dependency-light tests, lance for local file-backed vector storage, milvus for a local or remote Milvus service, and pgvector when vectors should live beside Postgres rows.

2. Presets

The built-in debug workspace preset uses SQLite for rows plus in-memory vector and search backends:
import heavenbase as hb

workspace = hb.HeavenBase("demo", preset="debug")
The local-lts preset is shaped for a local stack with Postgres rows, LanceDB vectors, and Elasticsearch search:
workspace = hb.HeavenBase("agent-shop", preset="local-lts")
The Lance path uses the workspace id in its configured URI, so each workspace gets an isolated vector directory.

3. Explicit backend config

You can pass backend config directly when a test or application should avoid global presets:
workspace = hb.HeavenBase(
    "vector-demo",
    backends={
        "main": {"type": "sqlite", "database": ":memory:"},
        "vec": {"type": "inmem", "name": "vec"},
    },
)
Then define vector fields in normal entities:
class Issue(hb.Entity):
    title = hb.field(hb.ShortText)
    emb = hb.field(hb.Vector[3])
Queries use the same JSON and Python DSL surfaces:
workspace.query(Issue).near(Issue.emb, [1.0, 0.0, 0.0], top_k=5).execute()

Further Exploration

Related resources: