Marqo

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

What is Marqo?

Marqo is an end-to-end tensor search engine that combines vector search with traditional keyword search. It handles embedding generation, storage, and retrieval in a single platform, supporting text, images, and multimodal search.

Setup

1

Install packages

$pip install respan-ai opentelemetry-instrumentation-marqo marqo
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 marqo
7
8# Connect to Marqo
9client = marqo.Client(url="http://localhost:8882")
10
11# Create an index
12client.create_index("documents", model="hf/e5-base-v2")
13
14# Add documents — Marqo generates embeddings automatically
15client.index("documents").add_documents(
16 [
17 {"title": "AI Observability", "description": "Respan provides tracing for AI applications."},
18 {"title": "Tensor Search", "description": "Marqo combines vector and keyword search."},
19 {"title": "Embeddings", "description": "Embeddings capture semantic meaning as vectors."},
20 ],
21 tensor_fields=["title", "description"],
22)
23
24# Search for documents
25results = client.index("documents").search("How does AI tracing work?")
26for hit in results["hits"]:
27 print(f"{hit['title']} (score: {hit['_score']:.4f})")
28
29respan.flush()
4

View your trace

Open the Traces page to see your Marqo operation spans.

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

What gets traced

  • Index creation and configuration
  • Document add, update, and delete operations
  • Tensor search queries and result rankings
  • Embedding generation and processing
  • Query parameters and filtering
  • Operation latency

Learn more