Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 5 min read How-to mediumAdept

Trace and evaluate Cursor agents with Langfuse, powered by ClickHouse

The Langfuse Observability plugin for Cursor captures each agent prompt as a `Cursor Turn` trace containing LLM observations, tool executions, subagents and token usage, stored in a wide ClickHouse observations table that avoids trace/observation joins for cost and latency aggregation. Setup is a Marketplace install plus a `~/.cursor/langfuse.json` key file. File-content capture is off by default, and because Cursor reports tokens once per turn, cost should be read from the trace total. A worked loop shows finding expensive turns caused by repeated file reads and retried shell commands, fixing them with a project rule, and validating the fix with dataset-based evaluations, which can also gate CI via a GitHub Action.

Related posts

  • Search agent traces by behavior with AI Search in LangSmith

    LangChain mediumAdept

    LangSmith's AI Search lets users find agent traces by behavior described in plain language (e.g. "did PII leak?", "did the user get frustrated?") by running a fast decision model over each candidate trace rather than relying on lossy embedding-based vector search. SmithDB normalizes traces from different SDKs into deduplicated per-session trajectories, which are then packed into an 8K-token budget that prioritizes user messages and agent replies over tool output. In a sample of Open SWE conversations, the median had 72K tokens but only about 2K came from user and agent messages, while roughly 85% was tool output. Structured filters narrow candidates first, then batches are classified in parallel with prefetching and results streamed back as they match.

  • Tracing OpenAI agents with ClickStack

    ClickHouse mediumAdept

    OpenAI's agents SDK has built-in tracing that can be redirected from OpenAI's hosted product to a custom TracingExporter. Spans can then be written into ClickHouse and explored in HyperDX as part of ClickStack. The worked example uses a gpt-5-mini agent that queries the ClickHouse SQL Playground through the ClickHouse MCP Server. The exporter is attached via a BatchTraceProcessor, adds the missing model name to response spans, and inserts rows into a JSON-typed ClickHouse table. The traces show tool calls, failed SQL attempts and LLM responses, which helps when comparing how different models handle ambiguous instructions.

  • Trace & Evaluate your Agent with Arize Phoenix

    Hugging Face mediumAdept

    A smolagents CodeAgent with DuckDuckGo search and webpage tools can be instrumented with OpenTelemetry and OpenInference so every agent call is traced in a local or hosted Arize Phoenix instance. Evaluation works by querying the search tool's spans with SpanQuery and scoring query/result relevance with GPT-4o as an LLM judge via llm_classify and the RAG relevancy template. The scores are then logged back to Phoenix as span evaluations. Swapping in other prebuilt templates covers checks such as hallucination, toxicity, SQL generation and function calling.

  • Agentic coding with ClickHouse. One person, one data stack, one full-stack application

    ClickHouse easyNovice

    A ClickHouse Solutions Architect with no frontend or backend background built ClickShop, a full-stack retail analytics demo, in a couple of days using Cursor. The stack uses Next.js on Vercel with per-persona workspaces, PostgreSQL for transactions synced to ClickHouse via ClickPipes CDC, and a Bronze/Silver/Gold medallion layout built on materialized views. On top sit 18 LibreChat agents, plus two observability layers: Langfuse for LLM tracing and cost, and ClickStack over OpenTelemetry for infrastructure. Open source components, Cursor skills and MCP database connectors reduce AI guesswork, though iteration, review and token costs remain significant.

  • Give Your Coding Agents a Memory You Own

    Hugging Face mediumAdept

    funes is an open-source, single-binary memory layer that indexes the session traces of coding agents (Claude Code, Codex, pi, Hermes) so any agent can recall past decisions and rationale with exact provenance. A deterministic pipeline parses traces into a common turn-and-block shape, chunks and embeds them locally into an append-only Lance dataset, and answers queries with hybrid vector+BM25 search, rank fusion, cross-encoder reranking, recency reweighting and neighbor-chunk expansion. Memories can be published to a private Hugging Face dataset with secret redaction, letting them follow you across machines, agents and teammates. On a handoff-vs-recall benchmark, recall was 4-8x cheaper than a written handoff, while compaction failed on one task because its summary flattened key findings.

The quest for software engineering knowledge.

Look:
Layout: