Add the Docs MCP to your AI coding tool to get help building with Respan. No API key needed. {
"mcpServers" : {
"respan-docs" : {
"url" : "https://respan.ai/docs/mcp"
}
}
}
What is Marqo?
Marqo is a tensor search engine that combines embedding generation, storage, and search in a single API. It handles vectorization automatically — no need to manage embeddings separately.
Setup
Install packages
pip install respan-tracing marqo openai
Set environment variables
export RESPAN_API_KEY = "YOUR_RESPAN_API_KEY"
export OPENAI_API_KEY = "YOUR_OPENAI_API_KEY"
Initialize Respan and query Marqo
Respan auto-instruments Marqo — search, add_documents, and index operations are captured as spans. from respan_tracing import RespanTelemetry
from respan_tracing.decorators import workflow, task
import marqo
from openai import OpenAI
# Initialize — auto-instruments Marqo
telemetry = RespanTelemetry()
client = OpenAI()
mq = marqo.Client( url = "http://localhost:8882" )
# Create index and add documents (Marqo handles embeddings internally)
mq.create_index( "docs" )
mq.index( "docs" ).add_documents(
[
{ "text" : "Respan provides observability for LLM applications." , "_id" : "doc1" },
{ "text" : "Traces capture the full lifecycle of an LLM request." , "_id" : "doc2" },
],
tensor_fields = [ "text" ],
)
@task ( name = "search_docs" )
def search_docs ( query : str ):
results = mq.index( "docs" ).search(query, limit = 3 )
return [hit[ "text" ] for hit in results[ "hits" ]]
@workflow ( name = "rag_pipeline" )
def rag_pipeline ( query : str ):
context = search_docs(query)
response = client.chat.completions.create(
model = "gpt-4o-mini" ,
messages = [
{ "role" : "system" , "content" : f "Context: { chr ( 10 ).join(context) } " },
{ "role" : "user" , "content" : query},
],
)
return response.choices[ 0 ].message.content
result = rag_pipeline( "How does tracing work?" )
print (result)
View your trace
Open the Traces page to see Marqo operations as spans in your trace tree.
Configuration
Marqo is auto-instrumented via Instruments.MARQO. No additional configuration is needed.
Marqo tracing is currently available in the Python SDK only.
See the Python Tracing SDK reference for configuration options.