Skip to content

AI Insights: reliable Ollama-backed facet extraction for deck analytics #94

@bdougie

Description

@bdougie

Summary

The AI Insights panel in deck --web analytics is currently disabled. The Ollama-backed facet extraction has reliability and performance issues that need to be resolved before re-enabling.

Problems

  • Ollama responses often fail JSON parsing (invalid character 'O' looking for beginning of value) even with format: "json" set
  • Backfilling all sessions blocks the /api/facets endpoint, making the analytics page load extremely slow
  • Auto-detecting Ollama on startup adds latency even when insights aren't needed

Current State

  • UI is commented out in deck.js (analyticsInsightsEl.hidden = true)
  • Server-side facet endpoints still exist and work with --insights flag
  • facets_ollama.go has format: "json" set but models still return non-JSON

Proposed Work

  • Investigate async/background backfill so it doesn't block page load
  • Add retry logic or better prompt engineering for JSON extraction
  • Consider streaming partial results to the UI as sessions are processed
  • Re-enable the insights UI once extraction is reliable
Image

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions