PostHog / PostHog/posthog

HogQL insight creation with PostHog AI

Open
#75,409 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

AI enhancement feature/dashboards
Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Feature request

Is your feature request related to a problem?

Use case: When batch updating a dashboard within PostHog with PostHog AI by pasting a list of updated SQL queries into the chat (e.g. you manage queries outside for a large client project), the PostHog AI keeps creating trend visualizations for the Table Visualizations.

Limitation (Reply from PostHog AI itself):
The original insights are HogQL SQL table queries, and I was creating Trends chart visualizations instead. That's a mismatch I can't fix automatically with the tools available, because create_insight only supports trends, funnel, and retention visualization types — not HogQL SQL table queries.

Describe the solution you'd like

Give PostHog AI the tools to create HogQL table queries, so that it can adjust the dashboards accordingly.

Describe alternatives you've considered

Updating every query manually with UI buttons (Nobody wants to do that for multiple insights in a row)

Additional context

Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the create_insight tool described in the issue and identify where support is limited to trends, funnel, and retention. Compare that limitation with the HogQL SQL table-query workflow used by the dashboard, and consider the batch-update use case complete when PostHog AI can create the requested table visualizations rather than converting them to trends.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
ai, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.