π Step 1: Install the SDK
The LambdaDB SDK provides convenient access to the LambdaDB APIs.For Python, we recommend using a virtual environment to keep your dependencies organized and avoid conflicts between projects.
π Step 2: Get your API key
To use LambdaDB, youβll need an API key. Fill out this form to obtain playground credentials.Keep your API key secure and consider storing it in environment variables rather than hardcoding it in your scripts.
The playground project is publicly accessible and rate limited. Do not store any sensitive/production data to the playground project.
π Step 3: Create a collection
A collection is where youβll store your documents and define how they should be indexed for search. LambdaDB supports 9 different index types: text, keyword, long, double, boolean, object, datetime, dense vector, and sparse vector. Letβs create a collection that combines text search with vector similarity:- Text field: Supports multilingual search with English and Korean analyzers
- Vector field: 10-dimensional vectors using cosine similarity
- Keyword field: Added to support exact match filtering.
π Step 4: Add documents
Now letβs add some sample documents. Each document contains text for full-text search, keywords for filtering, and vectors for similarity search:- Upsert behavior: Documents with the same ID will be updated; new IDs create new documents.
- Auto-generated IDs: If you donβt provide an ID, one will be generated automatically.
- Bulk operations: For large-scale document ingestion (5MB+), use the bulk-upsert functionality.
- Configurable consistency: LambdaDB is eventually consistent by default, so there can be a slight delay before new or changed documents are visible to queries.
If your application requires strong (read-after-write) consistency, set
consistentRead
totrue
when query or fetch data from a collection.
π Step 5: Full-text search
Letβs search for documents that match βI hate managing serversβ while filtering for documents tagged exactly with βserverlessβ. This demonstrates LambdaDBβs powerful query capabilities:π Step 6: Hybrid search
Now letβs combine full-text search with vector similarity for more comprehensive results. This is where LambdaDB really shines:rrf
(Reciprocal Rank Fusion): Great for combining rankings from different search methodsl2
(L2 Normalization): Normalizes scores using L2 normmm
(Min-Max Normalization): Simple linear scaling to 0-1 range
π§Ή Step 7: Clean up
When youβre finished experimenting, clean up your resources:π Next steps
- Apply for early access: https://lambdadb.ai/early-access
- Advanced Queries: Explore complex patterns in our Query Guide
- Bulk Operations: Learn about large-scale data ingestion in our Bulk Operations Guide
- API Reference: Comprehensive documentation at our API Reference