Documentation / Quick Start
Quick Start.
Get up and running with Feather v0.5.0 in under 5 minutes. Learn how to initialize the DB, add multimodal vectors, and perform searches.
Step 1: Create a Database
Start by creating a new Feather database specifying the vector dimension:
Python
from feather import DB
# Create a database for 384-dimensional vectors
db = DB.open("embeddings.feather", dim=384)Step 2: Add Multimodal Vectors
Add vectors to your database. In v0.5.0, you can specify individual modalities for the same entity ID:
Python
import numpy as np
vectors = [np.random.rand(384).astype(np.float32) for _ in range(10)]
for i, vector in enumerate(vectors):
# Add with an explicit modality string
db.add(id=i, vec=vector, modality="text")
print(f"Added {len(vectors)} text vectors")Step 3: Search with Namespaces
Query the vector database. Results are sorted by closest distance (L2 or Cosine, depending on build params).
Python
query = np.random.rand(384).astype(np.float32)
# Search specifically within the "text" modality pockets
results = db.search(query, k=5, modality="text")
for vector_id, distance in results:
print(f"ID: {vector_id}, Distance: {distance:.4f}")Step 4: Save and Persist
Feather writes natively to a highly optimized flat binary file:
Python
# Flush index and data to disk
db.save()
# Load exactly the same way later:
# db = DB.open("embeddings.feather", dim=384)