> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lambdadb.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with LambdaDB in minutes. Create a project, install the Python, TypeScript, or Go SDK, set up your first collection, and run a hybrid search query.

This guide will walk you through getting a **project API key**, installing the SDK, creating your first collection, and running hybrid search queries. You'll learn to set up collections with text, keyword, and dense vector components, then execute both full-text and hybrid searches that combine traditional search with modern vector similarity.

## 🔑 Step 1: Get your API key

You'll use a **project API key** from **[LambdaDB Cloud](https://app.lambdadb.ai)** starting in Step 3.

<Note>
  **LambdaDB Cloud** is in **public preview**.
</Note>

1. **Sign in to LambdaDB Cloud** — Open [app.lambdadb.ai](https://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. **Copy your project API key** — The API key is shown only once after the project is created. Store it somewhere safe, then use it with the **base URL** and **project name** from the console starting in Step 3.

<Note>
  LambdaDB Cloud uses region-specific API base URLs. Use the **base URL**, **project name**, and **project API key** shown for your project in the LambdaDB Cloud console. Do not assume a global default URL or a fixed project name.
</Note>

<Info>
  The Free plan includes monthly read, write, storage, and inference usage at no cost. Add a payment method when you need Standard plan usage beyond the Free plan limits. See [Understanding costs](/guides/costs/understanding-costs).
</Info>

<Tip>
  The Cloud console also supports loading data and running queries in the GUI, alongside the SDK examples in this guide.
</Tip>

<Note>
  Keep your API key out of source control and prefer environment variables instead of hardcoding it in scripts.
</Note>

## 🚀 Step 2: Install the SDK

The LambdaDB SDK provides convenient access to the LambdaDB APIs.

<CodeGroup>
  ```python Python theme={null}
  pip install lambdadb
  ```

  ```typescript TypeScript theme={null}
  npm install @functional-systems/lambdadb
  ```

  ```go Go theme={null}
  go get github.com/lambdadb/go-lambdadb
  ```
</CodeGroup>

<Tip>
  For Python, we recommend using a virtual environment to keep your dependencies organized and avoid conflicts between projects.
</Tip>

## 📚 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:

<CodeGroup>
  ```python Python theme={null}
  from lambdadb import LambdaDB, models

  # Initialize the LambdaDB client with the base URL and project name from your LambdaDB Cloud project
  with LambdaDB(
      project_api_key="your_api_key_here",
      base_url="YOUR_BASE_URL",
      project_name="YOUR_PROJECT_NAME",
  ) as client:
      collection_name = "your_collection_name_here"
      res = client.collections.create(
          collection_name=collection_name,
          index_configs={
              "text": {
                  "type": "text",
                  "analyzers": ["english", "korean"],
              },
              "keyword": {"type": "keyword"},
              "vector": {
                  "type": "vector",
                  "dimensions": 10,
                  "similarity": "cosine",
              },
          },
      )
      print(res)
  ```

  <Note>
    Python: `LambdaDB` supports context manager usage. `__enter__` returns the client, and `__exit__` calls `client.close()` (closing the SDK-owned HTTP client) and makes the client unusable after the `with` block. If you don't use `with`, call `client.close()` when you're done. If you pass a custom `client=`/`async_client=`, you own closing it.
  </Note>

  ```typescript TypeScript theme={null}
  import { LambdaDBClient } from "@functional-systems/lambdadb";

  // Initialize the LambdaDB client with the base URL and project name from your LambdaDB Cloud project
  const client = new LambdaDBClient({
    projectApiKey: "your_api_key_here",
    baseUrl: "YOUR_BASE_URL",
    projectName: "YOUR_PROJECT_NAME",
  });
  const collectionName = "your_collection_name_here";
  const res = await client.createCollection({
    collectionName,
    indexConfigs: {
      text: { type: "text", analyzers: ["english", "korean"] },
      keyword: { type: "keyword" },
      vector: { type: "vector", dimensions: 10, similarity: "cosine" },
    },
  });
  console.log(res);
  ```

  ```go Go theme={null}
  package main

  import (
    "context"
    "fmt"
    "log"
    lambdadb "github.com/lambdadb/go-lambdadb"
  )

  func main() {
    ctx := context.Background()
    client := lambdadb.New(
      lambdadb.WithBaseURL("YOUR_BASE_URL"),
      lambdadb.WithProjectName("YOUR_PROJECT_NAME"),
      lambdadb.WithAPIKey("your_api_key_here"),
    )
    collectionName := "your_collection_name_here"
    res, err := client.Collections.Create(ctx, lambdadb.CreateCollectionOptions{
      CollectionName: collectionName,
      IndexConfigs: map[string]interface{}{
        "text":    map[string]interface{}{"type": "text", "analyzers": []string{"english", "korean"}},
        "keyword": map[string]interface{}{"type": "keyword"},
        "vector":  map[string]interface{}{"type": "vector", "dimensions": 10, "similarity": "cosine"},
      },
    })
    if err != nil {
      log.Fatal(err)
    }
    if res != nil && res.Collection != nil {
      c := res.Collection
      log.Printf("Collection: project=%s collection=%s numDocs=%d status=%s", c.ProjectName, c.CollectionName, c.NumDocs, c.CollectionStatus)
    }
  }
  ```
</CodeGroup>

Response:

<CodeGroup>
  ```python Python theme={null}
  CreateCollectionResponse(
      collection=CollectionResponse(
          project_name='your-project',
          collection_name='quickstart',
          index_configs={
              'text': IndexConfigsText(
                  type=<TypeText.TEXT: 'text'>,
                  analyzers=[<Analyzer.ENGLISH: 'english'>, <Analyzer.KOREAN: 'korean'>]
              ),
              'keyword': IndexConfigs(type=<Type.KEYWORD: 'keyword'>),
              'vector': IndexConfigsVector(
                  type=<TypeVector.VECTOR: 'vector'>,
                  dimensions=10,
                  similarity=<Similarity.COSINE: 'cosine'>
              ),
              'id': IndexConfigs(type=<Type.KEYWORD: 'keyword'>)
          },
          num_docs=0,
          collection_status=<Status.CREATING: 'CREATING'>,
          source_project_name=None,
          source_collection_name=None,
          source_collection_version_id=None
      )
  )
  ```

  ```typescript TypeScript theme={null}
  {
    collection: {
      projectName: 'your-project',
      collectionName: 'quickstart',
      indexConfigs: { text: [Object], keyword: [Object], vector: [Object], id: [Object] },
      numDocs: 0,
      collectionStatus: 'CREATING'
    }
  }
  ```

  ```go Go theme={null}
  Collection: project=your-project collection=quickstart numDocs=0 status=CREATING
  ```
</CodeGroup>

**Key configuration details:**

* **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:

<CodeGroup>
  ```python Python theme={null}
  with LambdaDB(project_api_key="your_api_key_here", base_url="YOUR_BASE_URL", project_name="YOUR_PROJECT_NAME") as client:
      coll = client.collection(collection_name)
      docs = [
          {"id": "doc1", "text": "Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.", "keyword": "serverless", "vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]},
          {"id": "doc2", "text": "Instead, it refers to a cloud computing model where developers can build and run applications without having to manage the underlying infrastructure.", "keyword": "cloud", "vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1]},
          {"id": "doc3", "text": "The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.", "keyword": ["serverless", "infrastructure"], "vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2]},
      ]
      res = coll.docs.upsert(docs=docs)
      print(res)
  ```

  ```typescript TypeScript theme={null}
  const client = new LambdaDBClient({ projectApiKey: "your_api_key_here", baseUrl: "YOUR_BASE_URL", projectName: "YOUR_PROJECT_NAME" });
  const collection = client.collection(collectionName);
  const docs = [
    { id: "doc1", text: "Serverless computing does not mean no servers are involved...", keyword: "serverless", vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] },
    { id: "doc2", text: "Instead, it refers to a cloud computing model where developers can build and run applications...", keyword: "cloud", vector: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1] },
    { id: "doc3", text: "The key aspect is that developers don't need to explicitly provision or manage servers...", keyword: ["serverless", "infrastructure"], vector: [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2] },
  ];
  const res = await collection.docs.upsert({ docs });
  console.log(res);
  ```

  ```go Go theme={null}
  coll := client.Collection(collectionName)
  docs := []map[string]interface{}{
    {"id": "doc1", "text": "Serverless computing does not mean no servers...", "keyword": "serverless", "vector": []float64{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0}},
    {"id": "doc2", "text": "Instead, it refers to a cloud computing model...", "keyword": "cloud", "vector": []float64{0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1}},
    {"id": "doc3", "text": "The key aspect is that developers don't need to explicitly provision...", "keyword": []string{"serverless", "infrastructure"}, "vector": []float64{0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2}},
  }
  res, err := coll.Docs().Upsert(ctx, lambdadb.UpsertDocsInput{Docs: docs})
  if err != nil { log.Fatal(err) }
  if res != nil {
    log.Printf("message: %s", res.Message)
  }
  ```
</CodeGroup>

Response:

<CodeGroup>
  ```python Python theme={null}
  MessageResponse(message='Upsert request is accepted')
  ```

  ```typescript TypeScript theme={null}
  {
      message: "Upsert request is accepted"
  }
  ```

  ```go Go theme={null}
  message: Upsert request is accepted
  ```
</CodeGroup>

**Important notes:**

* **Upsert behavior**: Documents with the same ID will be replaced; 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` (or `consistent_read` in Python) to `true` when you query or fetch data from a collection.

**Check indexing status:** You can view collection stats to verify that your documents have been indexed:

<CodeGroup>
  ```python Python theme={null}
  res = client.collection(collection_name).get()  # or client.collections.get(collection_name=collection_name)
  print(res)
  ```

  ```typescript TypeScript theme={null}
  const res = await client.collection(collectionName).get();
  console.log(res);
  ```

  ```go Go theme={null}
  meta, err := client.Collection(collectionName).Get(ctx)
  if err != nil { log.Fatal(err) }
  _ = meta
  ```
</CodeGroup>

## 🔍 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:

<CodeGroup>
  ```python Python theme={null}
  with LambdaDB(project_api_key="your_api_key_here", base_url="YOUR_BASE_URL", project_name="YOUR_PROJECT_NAME") as client:
      coll = client.collection(collection_name)
      res = coll.query(
          size=10,
          query={
              "bool": [
                  {"queryString": {"query": "I hate managing servers", "defaultField": "text"}},
                  {"queryString": {"query": "keyword:serverless"}, "occur": "must"},
              ]
          },
          consistent_read=True,
      )
      print("🔍 Search Results:")
      # Query responses expose items in `res.docs` (each item includes `doc` and `score`).
      # Use `res.documents` if you want document bodies only (no scores).
      for item in res.docs:
          doc_id = str(item.doc.get("id"))
          score = f"{item.score:.2f}"
          keyword = str(item.doc.get("keyword"))
          text = str(item.doc.get("text", ""))[:60]
          print(f"{doc_id:<5} | {score:<5} | {keyword:<15} | {text}...")
  ```

  ```typescript TypeScript theme={null}
  const collection = client.collection(collectionName);
  const res = await collection.query({
    size: 10,
    query: {
      bool: [
        { queryString: { query: "I hate managing servers", defaultField: "text" } },
        { queryString: { query: "keyword:serverless" }, occur: "must" },
      ],
    },
    consistentRead: true,
  });
  console.log("🔍 Search Results:");
  for (const item of res.docs ?? []) {
    const docId = String(item.doc?.id);
    const score = item.score?.toFixed(2);
    const keyword = String(item.doc?.keyword);
    const text = String(item.doc?.text ?? "").slice(0, 60);
    console.log(`${docId.padEnd(5)} | ${score} | ${keyword.padEnd(15)} | ${text}...`);
  }
  ```

  ```go Go theme={null}
  coll := client.Collection(collectionName)
  res, err := coll.Query(ctx, lambdadb.QueryCollectionInput{
    Size: 10,
    Query: map[string]interface{}{
      "bool": []interface{}{
        map[string]interface{}{"queryString": map[string]interface{}{"query": "I hate managing servers", "defaultField": "text"}},
        map[string]interface{}{"queryString": map[string]interface{}{"query": "keyword:serverless"}, "occur": "must"},
      },
    },
    ConsistentRead: lambdadb.Ptr(true),
  })
  if err != nil { log.Fatal(err) }
  log.Println("🔍 Search Results:")
  for _, r := range res.Docs {
    doc := r.Doc
    docID := fmt.Sprintf("%v", doc["id"])
    score := r.Score
    keyword := fmt.Sprintf("%v", doc["keyword"])
    text := fmt.Sprintf("%v", doc["text"])
    if len(text) > 60 { text = text[:60] }
    log.Printf("%-5s | %.2f | %-15s | %s...", docID, score, keyword, text)
  }
  ```
</CodeGroup>

Response:

<CodeGroup>
  ```python Python theme={null}
  🔍 Search Results:
  doc3  | 0.83  | ['serverless', 'infrastructure'] | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.80  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  ```

  ```typescript TypeScript theme={null}
  🔍 Search Results:
  doc3  | 0.83  | ['serverless', 'infrastructure'] | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.80  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  ```

  ```go Go theme={null}
  🔍 Search Results:
  doc3  | 0.83  | [serverless infrastructure] | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.80  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  ```
</CodeGroup>

Why these results? doc3 scored highest because it directly mentions "manage servers", while doc1 matched on "server management" and "serverless computing".

## 🔍 Step 6: Hybrid search

Now let's combine full-text search with vector similarity for more comprehensive results. This is where LambdaDB really shines:

<CodeGroup>
  ```python Python theme={null}
  with LambdaDB(project_api_key="your_api_key_here", base_url="YOUR_BASE_URL", project_name="YOUR_PROJECT_NAME") as client:
      coll = client.collection(collection_name)
      res = coll.query(
          size=10,
          query={
              "l2": [
                  {"queryString": {"query": "I hate managing servers", "defaultField": "text"}},
                  {"knn": {"field": "vector", "k": 5, "queryVector": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 1.0]}},
              ]
          },
          consistent_read=True,
      )
      print("🔄 Hybrid Search Results:")
      for item in res.docs:
          print(f"{item.doc.get('id')} | {item.score:.2f} | {item.doc.get('text', '')[:50]}...")
  ```

  ```typescript TypeScript theme={null}
  const res = await collection.query({
    size: 10,
    query: {
      l2: [
        { queryString: { query: "I hate managing servers", defaultField: "text" } },
        { knn: { field: "vector", k: 5, queryVector: [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 1.0] } },
      ],
    },
    consistentRead: true,
  });
  console.log("🔄 Hybrid Search Results:");
  for (const item of res.docs ?? []) {
    console.log(`${item.doc?.id} | ${item.score?.toFixed(2)} | ${String(item.doc?.text).slice(0, 50)}...`);
  }
  ```

  ```go Go theme={null}
  res, err = coll.Query(ctx, lambdadb.QueryCollectionInput{
    Size: 10,
    Query: map[string]interface{}{
      "l2": []interface{}{
        map[string]interface{}{"queryString": map[string]interface{}{"query": "I hate managing servers", "defaultField": "text"}},
        map[string]interface{}{"knn": map[string]interface{}{"field": "vector", "k": 5, "queryVector": []float64{0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 1.0}}},
      },
    },
    ConsistentRead: lambdadb.Ptr(true),
  })
  if err != nil { log.Fatal(err) }
  log.Println("🔄 Hybrid Search Results:")
  for _, r := range res.Docs {
    doc := r.Doc
    docID := fmt.Sprintf("%v", doc["id"])
    score := r.Score
    keyword := fmt.Sprintf("%v", doc["keyword"])
    text := fmt.Sprintf("%v", doc["text"])
    if len(text) > 50 { text = text[:50] }
    log.Printf("%s | %.2f | %s | %s...", docID, score, keyword, text)
  }
  ```
</CodeGroup>

Response:

<CodeGroup>
  ```python Python theme={null}
  🔄 Hybrid Search Results:
  doc3  | 0.66  | serverless,infrastructure | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.62  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  doc2  | 0.33  | cloud           | Instead, it refers to a cloud computing model where developers can build and run applications without having to manage the underlying infrastructure.
  ```

  ```typescript TypeScript theme={null}
  🔄 Hybrid Search Results:
  doc3  | 0.66  | serverless,infrastructure | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.62  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  doc2  | 0.33  | cloud           | Instead, it refers to a cloud computing model where developers can build and run applications without having to manage the underlying infrastructure.
  ```

  ```go Go theme={null}
  🔄 Hybrid Search Results:
  doc3  | 0.66  | serverless,infrastructure | The key aspect is that developers don't need to explicitly provision or manage servers. The cloud provider handles all server management automatically.
  doc1  | 0.62  | serverless      | Serverless computing does not mean no servers are involved. It refers to a cloud computing model where the server management is abstracted away from developers.
  doc2  | 0.33  | cloud           | Instead, it refers to a cloud computing model where developers can build and run applications without having to manage the underlying infrastructure.
  ```
</CodeGroup>

**Score normalization options:**

* `rrf` (Reciprocal Rank Fusion): Great for combining rankings from different search methods
* `l2` (L2 Normalization): Normalizes scores using L2 norm
* `mm` (Min-Max Normalization): Simple linear scaling to 0-1 range

## 🧹 Step 7: Clean up

When you're finished experimenting, clean up your resources:

<CodeGroup>
  ```python Python theme={null}
  client.collections.delete(collection_name=collection_name)
  ```

  ```typescript TypeScript theme={null}
  await client.collection(collectionName).delete();
  ```

  ```go Go theme={null}
  err := client.Collection(collectionName).Delete(ctx)
  if err != nil { log.Fatal(err) }
  ```
</CodeGroup>

## 🚀 Next steps

* **Advanced Queries**: Explore complex patterns in our [Query Guide](/guides/search/search-overview)
* **Bulk Operations**: Learn about large-scale data ingestion in our [Bulk Operations Guide](/guides/documents/bulk-upsert-data)
* **API Reference**: Comprehensive documentation at our [API Reference](/reference/api/introduction)

## 🤝 Support

Need help? Visit our [Community Slack](https://join.slack.com/t/lambdadbcommunity/shared_invite/zt-3sg7565zm-sCTW3odRkEQt~auWUVVsTw) for support and discussions.
