Problem
Honeycomb, an observability vendor, wanted users to type "Which service has the highest latency?" and get a ready query in the existing Query Builder. Some schemas hold over 5000 unique fields and do not fit in a context window. Commercial LLMs take 2 to 15+ seconds per answer, users type anything from full query syntax to the word "slow", and a model wired into a product invites prompt injection. The team had one month.
Example from the article: a user types only "slow", and the assistant must still return a useful query rather than refuse.
Solution in brief
One few-shot LLM call returns a query that is parsed, corrected if possible and run in the normal UI. The schema is cut to fields with data in the last seven days, and the model touches no databases or services. Chaining and zero-shot chain of thought did not help, and a 100k-token window was slower and hallucinated more.
Questions this case answers
- How to let non-expert users query a large structured dataset in natural language when the schema does not fit in the model context window
- How to ship an LLM-backed feature under tight latency and injection risk without giving the model access to data or destructive actions
- How to let users query observability data in natural language when their schemas exceed the LLM context window?
- How to choose a prompting strategy that still works for vague, one-word user inputs?
Tools and methods
- Few-shot prompting — examples in the prompt; the only strategy that worked well.
- Schema trimming — keep fields with data in the past seven days.
- Output parsing and validation — parse, auto-correct, then run the query.
- Prompt injection mitigations — undoable output, no data access, no chat UI, rate limits.
- GPT-3.5 — production model; GPT-4 was too slow, Claude 100k slower.
Google or a one-time email code. No password.
