Ask HN: Building LLM apps? How are you handling user context?

I've been building stuff with LLMs, and every time I need user context, I end up manually wiring up a context pipeline.

Sure, the model can reason and answer questions well, but it has zero idea who the user is, where they came from, or what they've been doing in the app. Without that, I either have to make the model ask awkward initial questions to figure it out or let it guess, which is usually wrong.

So I keep rebuilding the same setup: tracking events, enriching sessions, summarizing behavior, and injecting that into prompts.

It makes the app way more helpful, but it's a pain.

What I wish existed is a simple way to grab a session summary or user context I could just drop into a prompt. Something like:

const context = await getContext();

const response = await generateText({ system: `Here's the user context: ${context}`, messages: [...] });

Some examples of how I use this:

- For support, I pass in the docs they viewed or the error page they landed on.

- For marketing, I summarize their journey, like 'ad clicked' → 'blog post read' → 'pricing page'.

- For sales, I highlight behavior that suggests whether they're a startup or an enterprise.

- For product, I classify the session as 'confused', 'exploring plans', or 'ready to buy'.

- For recommendations, I generate embeddings from recent activity and use that to match content or products more accurately.

In all of these cases, I usually inject things like recent activity, timezone, currency, traffic source, and any signals I can gather that help guide the experience.

Has anyone else run into this same issue? Found a better way?

I'm considering building something around this initially to solve my problem. I'd love to hear how others are handling it or if this sounds useful to you.


Comments URL: https://news.ycombinator.com/item?id=44097699

Points: 9

# Comments: 1

https://news.ycombinator.com/item?id=44097699

Vytvořeno 27d | 26. 5. 2025 16:20:09


Chcete-li přidat komentář, přihlaste se

Ostatní příspěvky v této skupině

Show HN: Report idling vehicles in NYC (and get a cut of the fines) with AI

New York City has this cool program that lets anyone report idling commercial vehicles and get a large cut of the fines [1]. It's been in the news recently [2].

I've filed a few reports, and I f

22. 6. 2025 19:30:12 | Hacker news
Show HN: A Tool to Summarize Kenya's Parliament with Rust, Whisper, and LLMs

Bunge Bits summarizes long parliamentary sessions from the Kenyan National Assembly and Senate. Built with Rust, Whisper v3, and GPT-4o.

Sessions are typically 3–7 hours long, mixing English and

22. 6. 2025 19:30:07 | Hacker news