Weaviate

Trace Weaviate vector database 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://mcp.respan.ai/mcp/docs"
5 }
6 }
7}

What is Weaviate?

Weaviate is an open-source AI-native vector database that stores both objects and vectors. It supports semantic search, hybrid search (combining BM25 and vector), generative search, and automatic vectorization with built-in ML model integrations.

Setup

1

Install packages

$pip install respan-ai opentelemetry-instrumentation-weaviate weaviate-client
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 weaviate
7import weaviate.classes.config as wc
8
9# Connect to Weaviate
10client = weaviate.connect_to_local()
11
12# Create a collection with a vectorizer
13collection = client.collections.create(
14 name="Document",
15 vectorizer_config=wc.Configure.Vectorizer.text2vec_transformers(),
16 properties=[
17 wc.Property(name="title", data_type=wc.DataType.TEXT),
18 wc.Property(name="content", data_type=wc.DataType.TEXT),
19 ],
20)
21
22# Add objects — Weaviate generates vectors automatically
23collection.data.insert_many([
24 {"title": "AI Observability", "content": "Respan provides tracing for AI applications."},
25 {"title": "Vector Search", "content": "Weaviate supports semantic and hybrid search."},
26 {"title": "Embeddings", "content": "Embeddings capture semantic meaning as vectors."},
27])
28
29# Perform a near-text search
30results = collection.query.near_text(
31 query="How does AI tracing work?",
32 limit=2,
33)
34for obj in results.objects:
35 print(f"{obj.properties['title']}: {obj.properties['content']}")
36
37client.close()
38respan.flush()
4

View your trace

Open the Traces page to see your Weaviate operation spans.

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

What gets traced

  • Collection schema management
  • Object creation and batch imports
  • Near-vector and near-text searches
  • Hybrid and generative search queries
  • Cross-reference operations
  • Operation latency

Learn more