Files
posthog/ee/hogai/graph/sql
Emanuele Capparelli 001b04a34a fix(ph-ai): clarify prompt about person id join limitation (#41446)
## Problem

The current documentation for the `person_id_join_limitation` in HogQL AI generation is unclear and lacks comprehensive guidance on how to properly handle joins involving person_id fields. This leads to agents creating queries that result in ClickHouse errors due to forward references to override tables.

## Changes

Enhanced the `person_id_join_limitation` documentation in both `ee/hogai/graph/sql/prompts.py` and `posthog/hogql/ai.py` to:

## How did you test this code?

Hopefully it solves [https://us.posthog.com/project/2/error_tracking/0199e7eb-4ec0-73b1-8bc5-937a564aa75d?timestamp=2025-11-10T12%3A14%3A39.085000-08%3A00](error), will monitor
2025-11-13 15:14:22 +00:00
..
2025-11-10 19:24:35 +01:00