LanceDB

Trace LanceDB vector search operations with Respan.
  1. Sign up — Create an account at platform.respan.ai
  2. Create an API key — Generate one on the API keys page
  3. Add credits or a provider key — Add credits on the Credits page or connect your own provider key on the Integrations page

Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed.

1{
2 "mcpServers": {
3 "respan-docs": {
4 "url": "https://docs.respan.ai/mcp"
5 }
6 }
7}

What is LanceDB?

LanceDB is a serverless vector database built on the Lance columnar format. It supports embedded (in-process) and cloud deployments, with automatic versioning, fast retrieval, and native integration with ML frameworks.

Setup

1

Install packages

$pip install respan-ai opentelemetry-instrumentation-lancedb lancedb
2

Set environment variables

$export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
$export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.respan.ai/api"
$export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $RESPAN_API_KEY"
3

Run a traced example

1from respan import Respan
2
3# Auto-discover and activate all installed instrumentors
4respan = Respan(is_auto_instrument=True)
5
6import lancedb
7
8# Connect to a local LanceDB instance
9db = lancedb.connect("/tmp/lancedb")
10
11# Create a table with vector data
12data = [
13 {"text": "Respan provides AI observability.", "vector": [0.1, 0.2, 0.3, 0.4]},
14 {"text": "Vector databases enable semantic search.", "vector": [0.5, 0.6, 0.7, 0.8]},
15 {"text": "LanceDB uses the Lance format.", "vector": [0.2, 0.3, 0.4, 0.5]},
16]
17table = db.create_table("documents", data, mode="overwrite")
18
19# Search for similar vectors
20results = table.search([0.1, 0.2, 0.3, 0.4]).limit(2).to_list()
21for result in results:
22 print(result["text"], result["_distance"])
23
24respan.flush()
4

View your trace

Open the Traces page to see your LanceDB operation spans.

Always call respan.flush() before your process exits. Without it, pending spans may be lost.

What gets traced

  • Table creation and schema operations
  • Vector insert and update operations
  • Similarity search queries and result counts
  • Filtering and hybrid search
  • Operation latency

Learn more