HNHacker News
TopNewBestAskShowJobs

marcospassos

12 karma · joined July 20, 2023

submissionscomments
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
Yep, that's something I'd have to figure out.
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
The value is building the context itself.

Using MCP, this could be a method that would get the context to take decisions.

For example, here's an example of how I use it currently:

```

const context = await getContext();

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

console.log(context);

// "First-time visitor using Google Chrome on a MacBook, browsing from San Francisco.

// Landed on the pricing page from a Google ad, clicked to compare plans,

// then visited the enterprise section before initiating a support chat."

```

It's like a session recorder for LLMs that captures rich user behavior and traits (like device, browser, location, and journey) and turns them into LLM context. Your agent or app instantly becomes more helpful, relevant, and aware without wiring up your own tracking and enrichment pipeline.

marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
Exactly! Something like a tag you install and then query prompt-ready contexts.
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
Super interesting! However, it focuses on external sources rather than the user journey.
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
That's a good approach. But what I'm looking for is a bit different, more like Segment, but for LLMs. Something that when a user lands on your website, clicks around, and interacts with your app, you get a full behavioral context out of the box, including click path, location, language, currency, etc. You can then inject that context directly into your prompt so the LLM understands what the user is doing and responds without guessing or asking.
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
It might help with context generation. But honestly, most of the work is still in tracking, processing, enriching (different services, like IP location, etc), and all the plumbing around it.
marcospassos··on Ask HN: Building LLM apps? How are you handling user context?
Yeah, exactly. My whole point is to avoid doing all that. It adds up fast. What I really want is something that handles the heavy lifting end-to-end: tracking, interpreting, and outputting a prompt-ready summary like:

"The user landed on the pricing page from a Google ad, clicked to compare plans, then visited the enterprise section before initiating a support chat."