---
title: "An agent lake you run yourself: traces and outcomes in Pixeltable"
date: "2026-12-01"
dateModified: "2026-12-01"
author: "Pierre Brunelle"
tags:
  - Multimodal AI
  - Agents
  - Observability
  - Session Log
  - Computed Columns
  - Versioning
  - Open Source
description: "LangChain's agent lake needs one place for traces, outcomes and intelligent compute. Build it in Python with Pixeltable, the open-source multimodal AI backend."
url: "https://www.pixeltable.com/blog/agent-lake-pixeltable"
---

# An agent lake you run yourself: traces and outcomes in Pixeltable

LangChain's Sam Crowder [argues](https://www.langchain.com/blog/the-agent-lake) that agents need one place for their traces, their outcomes, and the compute that learns from both. He calls it an agent lake, and I think the idea is right. You can build the data side of it today, in tables you own, with Pixeltable, the open-source multimodal AI backend for apps and agents. This post maps that article onto what Pixeltable does, runs a small version on a laptop with no API key, and lists where LangSmith is ahead.

 
## What LangChain means by an agent lake

 
The post defines it as "a platform that combines storage optimized for agent traces with intelligent compute to query, analyze, and learn from them, powering continuous agent improvement". The article then covers three topics.

 
The first is storage. LangChain's database for traces is SmithDB, which [launched in May](https://www.langchain.com/blog/introducing-smithdb) and now sits under LangSmith. The post says LangSmith ingests traces from billions of agent runs a month, a figure that is LangChain's own.

 
The second is what goes into it. Traces and multi-turn threads, plus outcomes: a thumbs down, a merged pull request, an LLM judge score, or a label from an annotation queue. One thread can open several merged PRs, and one PR can come from several threads.

 
The third is "intelligent compute" over that corpus. Online evaluators and cheaper decision models score traces as they arrive. AI Search finds traces from a plain-language question. Insights groups traffic into categories. Engine scans traces on a schedule, groups failures into issues, and can propose a fix as a pull request. SmithTune fine-tunes a model on your best trajectories.

 
The post is a framing piece. It names a category for products LangSmith already sells, and it ends with an invitation to try LangSmith. That is a fair thing for a vendor to do, and the framing is useful whatever you run.

 
## Where I agree, and where we start from

 
A trace on its own is a log. It gets useful when you can join it to what happened afterward and to the material the agent touched: the document it retrieved, the screenshot it read, the memory it wrote. Crowder's point that the lake holds outcomes as well as traces is the part I'd keep.

 
LangChain starts at the trace and builds out. Pixeltable starts at the table. Traces, outcomes, agent memory, retrieved documents, images, and eval sets are all rows in the same catalog, so a join across them is an ordinary query, as the example below shows for outcomes. If you already run LangGraph, the `langgraph-store-pixeltable` package on GitHub is a `BaseStore` backend that keeps agent memory in Pixeltable.

 
## How each claim maps to Pixeltable

 
I checked each row against Pixeltable 0.7.26 and the [docs](https://docs.pixeltable.com). "Match" means I ran it for this post or it is documented behavior.

 
| Agent lake part | In Pixeltable today | Fit |
| --- | --- | --- |
| Traces and threads | A table with one row per span or turn, JSON columns for payloads, a thread_id column | Match |
| Outcomes, including many-to-many | An outcomes table joined to traces on trace_id. That column is not unique. Your code collects the thumbs and PR events | Match |
| Online evaluators | A computed column runs on every insert. An LLM judge is a computed column that calls a model | Match |
| Cheaper decision models | A local model as a computed column, for example pxtf.huggingface.text_classification. No tuned evaluators ship with it | Partial |
| AI Search | An embedding index plus a @pxt.query that mixes similarity with structured filters. The step that turns a question into filters is yours to write | Partial |
| Versioned eval sets (Pixeltable addition) | Snapshots and table versions, with pxt history and pxt revert | Match |
| Memory and media next to traces (Pixeltable addition) | Typed Image, Video, Audio and Document columns on the same catalog | Match |
| Insights (clustering of traffic) | Nothing built in. You write the UDF or call a clustering library yourself | Gap |
| Engine (diagnose and open a PR) | Nothing built in | Gap |
| SmithTune (fine-tune and compare) | to_pytorch_dataset and Parquet export get the data out. Pixeltable does not run tuning or the comparison | Partial |
| Trace-tree viewer and annotation queues | The local dashboard browses tables. It is not a trace viewer or a labeling tool | Gap |
| Ingest at LangSmith volumes | Pixeltable is not a high-throughput tracing backend | Gap |

 
## A small agent lake you can run

 
Everything below ran on Pixeltable 0.7.26, the latest PyPI release, in a clean Python 3.12 environment with a local MiniLM model for embeddings. No API key was involved. The judge is a heuristic stand-in, marked as one in the code.

 
The schema goes in `app.py`. Traces and outcomes are two tables. The judge score is a computed column on traces, and the embedding index covers what the user asked.

 
```python
import pixeltable as pxt
from pixeltable.functions.huggingface import sentence_transformer

TableModel = pxt.model_base()
embed = sentence_transformer.using(model_id='sentence-transformers/all-MiniLM-L6-v2')

@pxt.udf
def judge(output: str, tool_errors: int) -> float:
 """Stand-in for an LLM judge. Swap in a model call when you have a key."""
 if tool_errors > 0:
 return 0.1
 return 0.3 if 'unable to' in output.lower() else 0.9

class Traces(TableModel, name='traces'):
 trace_id = pxt.Column(type=pxt.String, primary_key=True)
 thread_id: pxt.String
 user_input: pxt.String
 agent_output: pxt.String
 steps: pxt.Json
 tool_errors: pxt.Int
 started_at: pxt.Timestamp
 judge_score = judge(agent_output, tool_errors)
 __indexes__ = [pxt.EmbeddingIndex(user_input, embedding=embed, name='input_idx')]

class Outcomes(TableModel, name='outcomes'):
 trace_id: pxt.String
 kind: pxt.String
 value: pxt.Float
 ref: pxt.String | None

@pxt.query
def similar_failures(q: str, k: int = 3) -> pxt.Query:
 sim = Traces.user_input.similarity(string=q)
 return (
 Traces.where(Traces.tool_errors > 0)
 .order_by(sim, asc=False)
 .select(Traces.trace_id, Traces.user_input, score=sim)
 .limit(k)
 )
```

 
```bash
pip install -U pixeltable sentence-transformers
pxt init
pxt schema update app.py lake
```

 
Save the rest as `run.py` next to `app.py` and run `python run.py`. It runs once: a second run stops on the `trace_id` primary key, so call `pxt.drop_dir('lake', force=True)` and repeat `pxt schema update` first.

 
Now insert five traces. The outcomes come in separately, the way they do in production: a thumbs down on two traces, and two merged PRs credited to one of them. Pixeltable computes the judge score and the embedding on insert.

 
```python
from datetime import datetime, timedelta, timezone

import pixeltable as pxt
from app import Outcomes, TableModel, Traces, similar_failures

TableModel.bind_all('lake')
NOW = datetime(2026, 12, 1, 18, 0, tzinfo=timezone.utc)

# trace id, thread, user input, agent output, failed tool calls
RUNS = [
 ('t1', 'th1', 'Refund order 8812 to the original card', 'Unable to reach the payments tool.', 2),
 ('t2', 'th1', 'Refund order 8812 please, it is urgent', 'Refunded $41.20 to the card on file.', 0),
 ('t3', 'th2', 'Cancel my subscription before renewal', 'Subscription cancelled, effective Dec 15.', 0),
 ('t4', 'th3', 'Cancel the annual plan and refund the unused months', 'Unable to find an annual plan on this account.', 1),
 ('t5', 'th4', 'Summarize this contract for the legal team', 'Here is a one-page summary of the contract.', 0),
]
Traces.insert([
 {
 'trace_id': t, 'thread_id': th, 'user_input': q, 'agent_output': out,
 'steps': [{'type': 'tool', 'name': 'payments', 'ok': errs == 0}],
 'tool_errors': errs, 'started_at': NOW - timedelta(hours=i),
 }
 for i, (t, th, q, out, errs) in enumerate(RUNS)
])

Outcomes.insert([
 {'trace_id': 't1', 'kind': 'thumbs', 'value': -1.0, 'ref': None},
 {'trace_id': 't4', 'kind': 'thumbs', 'value': -1.0, 'ref': None},
 {'trace_id': 't4', 'kind': 'merged_pr', 'value': 1.0, 'ref': 'acme/billing#212'},
 {'trace_id': 't4', 'kind': 'merged_pr', 'value': 1.0, 'ref': 'acme/billing#219'},
 {'trace_id': 't3', 'kind': 'thumbs', 'value': 1.0, 'ref': None},
])
```

 
Finding the traces with a thumbs down is a join. You get the judge score next to the user's rating without a separate evaluation job.

 
```python
down = (
 Traces.join(Outcomes, on=Traces.trace_id == Outcomes.trace_id)
 .where((Outcomes.kind == 'thumbs') & (Outcomes.value < 0))
 .select(Traces.trace_id, Traces.user_input, Traces.judge_score)
 .order_by(Traces.trace_id)
)
print(down.collect())
```

 
```text
 trace_id user_input judge_score
0 t1 Refund order 8812 to the original card 0.1
1 t4 Cancel the annual plan and refund the unused months 0.1
```

 
For the "find me traces like this" case, `similar_failures` mixes meaning and a filter. I asked for "customer wants their money back" and restricted to traces with a failed tool call.

 
```python
for hit in pxt.eval_udf(similar_failures, 'customer wants their money back'):
 print(round(hit['score'], 2), hit['trace_id'], hit['user_input'])
```

 
```text
0.41 t1 Refund order 8812 to the original card
0.29 t4 Cancel the annual plan and refund the unused months
```

 
The last two steps are the improvement loop's bookkeeping. A snapshot pins the failing set as an eval set, and later inserts do not change it. Table versions let you open the lake as it was earlier.

 
```python
pxt.create_snapshot('lake/failing_v1', Traces.where(Traces.judge_score < 0.5))
Traces.insert([{
 'trace_id': 't6', 'thread_id': 'th5', 'user_input': 'Refund my deposit',
 'agent_output': 'Unable to reach the payments tool.',
 'steps': [], 'tool_errors': 1, 'started_at': NOW,
}])
print(pxt.get_table('lake/failing_v1').count(), 'in the snapshot,',
 Traces.where(Traces.judge_score < 0.5).count(), 'failing now')
print(pxt.get_table('lake/traces:1').count(), 'traces at version 1,', Traces.count(), 'now')
```

 
```text
2 in the snapshot, 3 failing now
5 traces at version 1, 6 now
```

 
To use a real judge, swap the heuristic `judge` UDF for one that calls a model through one of Pixeltable's provider functions; the `judge_score` computed column needs no change. The [LLM-as-judge cookbook](https://docs.pixeltable.com/howto/cookbooks/agents/pattern-llm-judge) shows the pattern. That needs a provider key, which I did not use here.

 
The same lake can be an agent's tool. Wrap `similar_failures` in an MCP server, as in [How do I build an MCP server over my documents and media?](/learn/how-to/build-an-mcp-server-over-your-media-files), and a coding agent can search past failures before it changes a prompt. I wrote the longer version of the trace table, with the rollup query and the eval table, in [Build your own agent trace lake with Pixeltable](/blog/build-agent-trace-lake-pixeltable).

 
## When LangSmith is the better pick

 
If you run agents at the volume LangChain describes, use a tracing product for ingest. SmithDB, Braintrust, Langfuse, or an OpenTelemetry collector are built for that, and Pixeltable is not. Pixeltable can sit beside them as the place where you enrich traces, join them to your own data, and freeze eval sets.

 
If you want a trace-tree viewer, annotation queues, or an agent that reads your traces and opens a pull request, LangSmith has those and Pixeltable does not. I would not try to rebuild Insights or Engine in a weekend. Per LangChain, Engine tests its proposed fixes against an eval set, and that work is part of the product.

 
What Pixeltable adds is ownership and reach. It is an Apache-2.0 Python library that runs on your machine or on Pixeltable Cloud. The lake is a set of tables in your catalog, and the same catalog holds your media, embeddings, and agent memory. [LangChain's pricing page](https://www.langchain.com/pricing) lists self-hosted and hybrid deployment under its Enterprise plan.

 
## Try it

 
Give your coding agent the skill with `npx skills add pixeltable/pixeltable-skill`, or run `pxt new` for a free Pixeltable Cloud database; claim it within 48 hours or it is deleted. The [backend for AI agents](/backend-for-ai-agents) page covers the pieces an agent needs, and [agents as data](/blog/agents-as-data-session-log-system-of-record) explains why the session log belongs in a table. For the state side of the same idea, see the [agent state machine post](/blog/agent-state-machine-pixeltable).
## Frequently asked questions

### What is an agent lake?

LangChain's term for a platform that stores agent traces and outcomes and runs compute over them to improve the agent. His definition is storage built for traces plus "intelligent compute" such as evaluators, search, clustering and automated fixes. Outcomes tied to those traces, such as ratings, merged PRs and judge scores, are what the lake holds.

### Does Pixeltable replace LangSmith or SmithDB?

Not for high-volume trace ingest, the trace viewer, annotation queues, or LangSmith Engine. Pixeltable is a good fit when you want traces, outcomes, memory and media in tables you own, with scores computed on insert, similarity search, snapshots and time travel. You can run both, and insert the traces you care about into Pixeltable.

### Can I keep using LangGraph with Pixeltable?

Yes. Pixeltable publishes langgraph-store-pixeltable on GitHub, a LangGraph BaseStore backend for persistent, versioned agent memory. You can also insert LangGraph run output into a Pixeltable table from your own loop.

### Do I need an API key to try this?

Not for the example in this post. It uses a local sentence-transformers model and a heuristic judge. A real LLM judge needs a key for the provider you pick, set as an environment variable.

