Self-Improving Agent Through LLM-Based Session Analysis
factory · Tech · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: AI coding agent product analytics and self-improvement
Factory needed to understand where Droid users experienced friction or delight across thousands of sessions without requiring humans to read private user conversations.
Constraints:
- Traditional metrics could mark a session successful while missing repeated rephrasing or frustration.
- Privacy constraints meant analysts should not read raw user conversations.
- The system had to process thousands of daily sessions within a token budget.
- Detected patterns needed to connect to releases, backend errors, and eventually agent self-improvement work.
Architecture
Factory built Signals, a daily batch pipeline that fetches Droid sessions from BigQuery, filters meaningful agentic interactions, analyzes them with LLM and embedding-based methods, extracts abstract facets plus friction/delight categories, clusters evolving patterns, stores aggregate results in BigQuery, posts Slack reports, correlates signals with logs and releases, and files Linear tickets when friction crosses thresholds so Droid can implement fixes subject to human PR approval.
Diagram confidence: explicit (topology described by the source).
flowchart LR A["Droid sessions"] --> B["BigQuery session store"] B --> C["Signals batch pipeline"] C --> D["LLM and embedding analysis"] D --> E["Facet and friction taxonomy"] E --> F["BigQuery analysis tables"] C --> G["Observability logs"] C --> H["Release notes"] C --> I["Slack reports"] C --> J["Linear ticket automation"] J --> K["Droid implementation loop"] K --> L["Human PR approval"]
Components
| Component | Role | Interacts with |
|---|---|---|
Droid sessions |
User-agent interaction records to be analyzed without exposing raw content to humans. | BigQuery session store |
BigQuery session store |
Stores sessions and receives historical Signals outputs for analysis. | Droid sessions, Signals batch pipeline, BigQuery analysis tables |
Signals batch pipeline |
Daily batch process that filters sessions and sends them for LLM/embedding analysis. | BigQuery session store, LLM and embedding analysis, Observability logs, Release notes, Slack reports, Linear ticket automation |
LLM and embedding analysis |
Extracts facets, friction, delight, abstract patterns, and clustering proposals. | Signals batch pipeline, Facet and friction taxonomy |
Facet and friction taxonomy |
Evolving schema of session facets, friction categories, and delight categories. | LLM and embedding analysis, BigQuery analysis tables |
Observability logs |
Backend error signals correlated with session friction windows. | Signals batch pipeline |
Release notes |
New release context used to detect regressions after CLI changes. | Signals batch pipeline |
Slack reports |
Daily team pulse on friction, delight, and changing patterns. | Signals batch pipeline |
Linear ticket automation |
Files improvement tickets when friction crosses thresholds. | Signals batch pipeline, Droid implementation loop |
Droid implementation loop |
Picks up tickets, implements fixes, reviews PRs, and awaits human merge approval. | Linear ticket automation, Human PR approval |
Human PR approval |
Final approval gate before Droid-generated fixes merge. | Droid implementation loop |
Data flow
Sessions from the past 24 hours are fetched from BigQuery, filtered to at least 30 agentic steps, sent to OpenAI's batch API for LLM/embedding analysis, decomposed into facets and friction/delight signals, clustered to propose new categories, written back to BigQuery and Slack, correlated with observability logs and release notes, and converted into Linear tickets when friction patterns cross thresholds.
3 supporting quotes
Why this architecture
Factory used batch LLM/embedding analysis because raw metrics missed qualitative session problems, while privacy constraints required abstracting sessions into aggregate facets and recurring patterns before humans saw results.
3 supporting quotes
Models used: LLM judges · embedding models · OpenAI batch API
Scale
- Signals analyzes thousands of sessions daily.“We analyze thousands of sessions daily, dynamically adjusted based on a token budget.”article, stated
- The batch window processes the past 24 hours.“Sessions from the past twenty-four hours get fetched from BigQuery”article, stated
- Sessions are filtered to at least 30 agentic steps.“filtered to those with at least thirty agentic steps to ensure meaningful interactions”article, stated
- A shipped ambiguity-handling change reduced repeated rephrasing friction by 30% within 48 hours.“the "repeated rephrasing" friction rate dropped by thirty percent within forty-eight hours.”article, stated
Alternatives considered (roads not taken)
Rely on task-completion metrics alone
Rejected because: Metrics missed qualitative failure modes such as repeated rephrasing and frustration.
Have humans read raw sessions
Rejected because: Factory wanted human-like qualitative judgment without exposing user conversations to analysts.
Static facet and friction taxonomies
Rejected because: New patterns such as branch switches and context churn emerged from clustering and needed to become first-class categories.
Patterns
eval-driven-development (evaluation)
Signals uses LLM judges to evaluate real sessions for friction and delight, then drives product fixes when patterns cross thresholds.
observability-tracing (observability)
Signals correlates abstracted session friction with backend errors, release notes, BigQuery history, and Slack reporting.
context-engineering (agent-context)
Signals discovered context churn as a first-class category when users repeatedly changed context windows in ways correlated with abandonment.
Tradeoffs
Run Signals as a daily batch.
Chose 24-hour batch processing through OpenAI's batch API over realtime alerting for every session.
Rationale: Factory was looking for patterns, not instant alerts, and batching reduced cost.
Use abstraction rather than raw transcript review.
Chose facets, clustered signals, and aggregate statistics over human analysts reading user conversations.
Rationale: The abstraction layer preserves privacy while still surfacing product patterns.
Keep human approval before merge.
Chose Droid-generated fixes with human PR approval over fully autonomous production changes.
Rationale: The improvement loop is automated through ticketing and PRs, but final merge still has human oversight.
Gotchas (what bit them)
Success metrics hid near-failure sessions.
Root cause: Task completion and tool-call counts did not capture repeated rephrasing or user frustration.
Resolution: Use LLM judges to identify friction/delight moments with citations and aggregate them across sessions.
Raw user sessions could not be exposed for manual product analytics.
Root cause: Conversation content is sensitive and numerous enough that human review would be both invasive and unscalable.
Resolution: Extract abstract patterns, facets, and aggregate statistics without surfacing raw conversation content.
Release regressions could be hard to notice manually.
Root cause: Friction can emerge as an aggregate pattern after a product change rather than an obvious single failure.
Resolution: Correlate daily friction reports with release notes and backend errors.
Evaluation
Factory evaluates Droid experience by LLM-judged friction/delight, session facets, error-log correlation, release-note correlation, abandonment predictors, and before/after changes in friction rates.
Metrics: friction and delight moments · session facets · context churn · rephrasing count · completion/abandonment · release-correlated regression · friction-rate change after fixes
Outcomes
- Signals surfaced context churn as a leading indicator of frustration.
- Signals caught a context-assembly regression the day after release.
- A change to ambiguous-request handling reduced repeated rephrasing friction by 30% within 48 hours.
- Signals can file Linear tickets that Droid picks up and implements with human merge approval.
Signals processes thousands of daily sessions through a 24-hour batch pipeline and uses aggregation thresholds to protect individual privacy.