Trace ClickHouse Loom with Langfuse
Send Loom’s server traces to Langfuse over OpenTelemetry to see where a memory search spends time and inspect the model calls it makes.
What is ClickHouse Loom? ClickHouse Loom is an open-source, self-hosted memory server that lets AI agents store and retrieve context across sessions.
What is Langfuse? Langfuse is an open-source AI engineering platform for tracing, evaluating, and debugging agent applications. Use Langfuse Cloud or self-host Langfuse.
Set up tracing
Get project API keys
Create a Langfuse project and get its public and secret keys from the project settings. If you need a Loom server, set one up with the Loom quickstart.
Configure the Loom server
Set these environment variables on the Loom server. For the Docker Compose installer, edit $HOME/.loom/.env.
# Langfuse Cloud, EU region
LOOM_LANGFUSE_URL=https://cloud.langfuse.com
# US: https://us.cloud.langfuse.com
# Japan: https://jp.cloud.langfuse.com
# HIPAA: https://hipaa.cloud.langfuse.com
LOOM_LANGFUSE_ADMIN_TOKEN=pk-lf-...:sk-lf-...For self-hosted Langfuse, use your instance’s base URL. Loom appends /api/public/otel/v1/traces and authenticates with the public_key:secret_key pair. OpenTelemetry must be enabled on Loom (LOOM_OTEL_ENABLED=true, the default).
Restart Loom with the new environment. For the Docker Compose installer, recreate the Loom service to load the updated .env.
docker compose --project-directory "$HOME/.loom" up -d --force-recreate loomVerify a trace in Langfuse
Run a memory search from your agent or with the Loom HTTP quickstart. Open Tracing in your Langfuse project and select the memory.search trace. Expand it to inspect retrieval spans and any embedding or generation calls made by Loom.
If the trace is missing, check the base URL, key pair, and LOOM_OTEL_ENABLED. Loom reports the local exporter state at GET /v1/health?include=langfuse.
What Loom sends
Loom exports server operation spans and includes latency, token usage, and cost where available. Model prompt and completion capture defaults to off and can be configured per namespace.
Loom also posts retrieval-quality scores onto each search trace: retrieval_confidence, top_similarity, abstained, and abstain_reason. code.ask traces add code_ask_cache_hit and code_ask_coverage. To have an LLM judge write a retrieval_relevance score, set LOOM_RETRIEVAL_JUDGE_SAMPLE_RATE above 0 (default 0). Each sampled search costs one extra model call.
Last updated on