Quickstart
Five minutes to living context.
Install, create a database, add some vectors, link them into a graph, and query with context_chain. That's the whole loop.
The five-step loop
01
Create a database
A Feather DB is just a file on disk. Open it (creating if missing) with a fixed dimension.
from feather_db import DB
# Create or open a 384-dimensional database
db = DB.open("embeddings.feather", dim=384)02
Add vectors with metadata
Every record carries an ID, a vector, and optional metadata — namespace, attributes, and importance.
import numpy as np
from feather_db import Metadata
for i in range(10):
vec = np.random.rand(384).astype(np.float32)
meta = Metadata()
meta.importance = 0.8
meta.set_attribute("type", "brief")
db.add(id=i, vec=vec, meta=meta)
print(f"Added {10} vectors")03
Link records into a graph
Typed edges turn your vectors into a traversable knowledge graph. Weighted, bidirectional.
# "informed_by" is a typed edge — you define what it means
db.link(from_id=0, to_id=1, rel_type="informed_by", weight=0.9)
db.link(from_id=0, to_id=2, rel_type="targets", weight=0.7)04
Query with context_chain
Semantic search + BFS graph expansion in one call. Returns the full neighborhood, not just the nearest neighbors.
query = np.random.rand(384).astype(np.float32)
# k nearest, then 2 graph-hops of expansion
results = db.context_chain(query, k=5, hops=2)
for r in results:
print(r.id, r.score, r.meta.get_attribute("type"))05
Persist and reopen
Feather writes a zero-copy binary file. Reopen it instantly from any process, any language binding.
# Flush state to disk
db.save()
# Reopen later (or from another process)
db = DB.open("embeddings.feather", dim=384)