Skip to main content
To connect a coding agent first, see Start with an AI agent. This guide walks you through getting a project API key, installing an SDK, creating your first searchable knowledge collection, and running hybrid search queries. You’ll store source documents with text, keyword, and dense vector fields, then combine lexical matching with vector similarity to retrieve relevant knowledge.

πŸ”‘ Step 1: Create your API key

You’ll use a project API key from LambdaDB Cloud starting in Step 3.
LambdaDB Cloud is in public preview.
Project creation and management are available through LambdaDB Cloud. The public API and SDK documentation starts with an existing project.
  1. Sign in to LambdaDB Cloud β€” Open app.lambdadb.ai, sign up if needed, and sign in.
  2. Create a project β€” Accounts without a payment method are on the Free plan. Choose an AWS region that fits your latency or data-residency needs.
  3. Create a project API key β€” Project creation does not automatically create an API key. Once the project is ready, open its API Keys tab, select Create key (or Create your first key), enter a name, and create the key.
  4. Save the key and connection details β€” The full key value is shown only once, immediately after key creation. Store it securely, then use it with the project’s base URL and project name from the console starting in Step 3.

Manage API keys

Organization Owners and Admins can create and revoke project API keys in the API Keys tab. If you cannot create a key, ask an Owner or Admin. The key list does not reveal saved key values; if you lose a value, create a replacement key. To replace a key, create a new one, update your application’s credentials, and verify that it works before revoking the old key. Revocation cannot be undone and applications still using the revoked key will lose access. Key management is available through LambdaDB Cloud, not the public data API or SDKs documented here.
LambdaDB Cloud uses region-specific API base URLs. Use your project’s base URL and project name, together with a project API key created in its API Keys tab. Project creation does not automatically issue a key; save the full value when you create it, because it is shown only once. See API key management. Do not assume a global default URL or a fixed project name.
The Free plan includes monthly read, write, storage, and inference usage at no cost. Add a payment method when you need Pay as You Go usage beyond the Free plan limits. See Understanding costs.
The Cloud console also supports loading data and running queries in the GUI, alongside the SDK examples in this guide.
Keep your API key out of source control and prefer environment variables instead of hardcoding it in scripts.

πŸš€ Step 2: Install the SDK

Install the latest stable SDK for your language. See SDK support for supported releases and runtime requirements. Pin a version in your application for reproducible builds.
Python SDK 0.14.1 requires Python 3.10–3.13; use a virtual environment to keep dependencies separate. Go SDK 0.8.0 requires Go 1.22 or later. Check the selected release for its runtime requirements.

πŸ“š Step 3: Create a collection

A collection is where you store the documents, embeddings, and metadata that make up an AI knowledge or memory dataset, and define how each field is indexed for retrieval. 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: Run the steps in order using one language. Python steps open a new client context for each operation and reuse collection_name. TypeScript steps reuse the initialized client. For Go, append the later snippets inside main, before its closing brace, using the imports shown in Step 3. Replace all connection placeholders before running.
The underlying REST response is 201 Created and includes the default branch:
Key configuration details:
  • Text field: This example selects English and Korean analyzers from the 49 fixed presets. Both process every value; language is not detected automatically. Choose text analyzers explains how to select and combine presets for your data.
  • Vector field: Synthetic 64-dimensional vectors using cosine similarity. For real embeddings, match the model’s dimensions and similarity requirements.
  • Keyword field: Added to support exact match filtering.
To have LambdaDB generate embeddings from your text or images, choose a native embedding configuration when creating the collection. That flow writes the source fields instead of direct vector values and searches with knn.queryText or knn.queryInputs; LambdaDB manages provider credentials. The examples below use caller-provided vectors. 201 Created confirms collection creation, not query-serving readiness. If a subsequent operation encounters a loading or transient error, follow Errors and retries; do not recreate the collection to wait for readiness.

πŸ“„ Step 4: Add documents

Now let’s upsert some sample documents. Each document contains text for full-text search, keywords for filtering, and vectors for similarity search:
Response:
Important notes:
  • Upsert behavior: Documents with the same ID will be replaced; new IDs create new documents. Use partial updates to change selected fields.
  • Auto-generated IDs: If you don’t provide an ID, one will be generated automatically.
  • Bulk operations: For larger imports, see Bulk upsert data. Collections with native embedding fields require regular upsert or update so LambdaDB can generate vectors.
  • 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 (or consistent_read in Python) to true when querying or fetching a branch directly. This overlays eligible pending writes, excluding pending bulk imports, and can return 429 if the pending payload exceeds its limit. Tag and alias reads reject this option. See Consistent reads for the full contract.
Check committed data: The calls below show collection statistics. numDocs and dataUpdatedAt describe the default main branch’s committed head; dataUpdatedAt may be absent before its first commit. To verify particular writes on any branch, query or fetch the expected records from that branch with consistentRead: false.
Let’s use query string search to find documents that match β€œI hate managing servers” while filtering for documents tagged exactly with β€œserverless”. In this Boolean query, the text clause is required, and the keyword filter restricts results without contributing to the score:
After the writes are visible, doc1 and doc3 satisfy the keyword filter and contain matching text terms. doc2 is excluded by the filter. Inspect the scores returned by your request; their exact values and ordering are not fixed by this example. To show counts for values in the keyword field alongside these results, add keyword facets. Counts cover all matching documents, including the query’s filters. They support this lexical query, but cannot be added to the hybrid query in Step 6. Now let’s combine full-text search with vector similarity in a hybrid query. This example uses L2 normalization to combine the two retrieval paths:
The result items have the same shape as the full-text results. This query has no keyword filter, so doc2 can also appear. The sample vectors only demonstrate the request format; they are not embeddings of the document text and do not demonstrate semantic relevance. Exact scores and ordering depend on the data and query. Hybrid fusion options:
  • rrf (Reciprocal Rank Fusion): Combines result ranks from different search methods
  • l2 (L2 Normalization): Normalizes scores using L2 norm
  • mm (Min-Max Normalization): Simple linear scaling to 0-1 range
  • bayesian (Bayesian Fusion): Automatically calibrates each retrieval path’s scores on retained candidates before combining them
To try Bayesian fusion with the same documents, replace l2 with bayesian in the examples above and add a candidate budget alongside size in the query call:
  • Python: candidate_size=30
  • TypeScript: candidateSize: 30
  • Go: CandidateSize: lambdadb.Int64(30)
Without reranking, this budget is required and must satisfy 1 <= size <= candidateSize within the candidate limit. It controls retrieval and score calibration depth for each path; knn.k remains independent. Changing the budget can change scores and ranking. Keep exactly two unboosted subqueries and use bayesian only at the top level of query. The fused scores are heuristic scores, not relevance probabilities. For complete requests, constraints, and optional reranking, see Bayesian hybrid query.

Rerank the results

For a model to evaluate the retrieved documents against your question, add query-level native reranking, using text as the stored field to evaluate. It works with the full-text and hybrid queries above, including caller-provided vectors. LambdaDB manages provider credentials, and reranking consumes inference usage. When reranking is applied, score is the model’s evaluation and retrievalScore preserves the original retrieval or fusion score. Check rerank.status before interpreting results. For Bayesian queries with reranking, move the candidate budget into rerank.candidateSize and omit top-level candidateSize; see candidate counts.

🧹 Step 7: Clean up

When you’re finished experimenting, delete the collection to remove the sample documents and indexes:

πŸš€ Next steps

🀝 Support

Need help? Visit our Community Slack for support and discussions.