Live data from Hacker News

Ask HN: What is the best way to provide continuous context to models?

news.ycombinator.com

31–40 of 48 posts

Re: Ask HN: What is the best way to provide continuous context to models?

#31
post #29

Earlier quoted context omitted.

Gemini the model is good, Gemini the framework around the model is a steaming pile of crap.

Yup. Gemini CLI needs a lot of work.

I actually defended Gemini CLI when someone said this a few days ago. Then Murphy's law hit me with bug after bug, all of which have been reported many times already going back over year or more. I keep having to totally clear out the ~/.gemini folder and then it works again for a while.

Re: Ask HN: What is the best way to provide continuous context to models?

#32

Every time you send a request to a model you're already providing all of the context history along with it. To edit the context, just send a different context history. You can send whatever you want as history, it's entirely up to you and entirely arbitrary. We only think in conversational turns because that's what we've expected a conversation to 'look like'. But that's just a very deeply ingrained convention. Forge…

This is how I view it as well.

And... and...

This results in a _very_ deep implication, which big companies may not be eager to let you see:

they are context processors

Take it for what it is.

Re: Ask HN: What is the best way to provide continuous context to models?

#33
post #32

Every time you send a request to a model you're already providing all of the context history along with it. To edit the context, just send a different context history. You can send whatever you want as history, it's entirely up to you and entirely arbitrary. We only think in conversational turns because that's what we've expected a conversation to 'look like'. But that's just a very deeply ingrained convention. Forge…

This is how I view it as well. And... and... This results in a _very_ deep implication, which big companies may not be eager to let you see: they are context processors Take it for what it is.

What you are trying to say is they are plagiarists and training on the input?

We know that already I don’t know why have to be quiet or hint at it, in fact they have been quite explicit about it.

Or is there some other context to your statement? Anyway that’s my “take that for what you will”.

Re: Ask HN: What is the best way to provide continuous context to models?

#34
Specifically for coding agents, one issue is how to continue work when almost fill the context window.

Compaction always loses information, so I use an alternative approach that works extremely well, based on this almost silly idea — your original session file itself is the golden source of truth with all details, so why not directly leverage it?

So I built the aichat feature in my Claude-code-tools repo with exactly this sort of thought; the aichat rollover option puts you in a fresh session, with the original session path injected, and you use sub agents to recover any arbitrary detail at any time. Now I keep auto-compact turned off and don’t compact ever.

https://github.com/pchalasani/claude-code-tools?tab=readme-o...

It’s a relatively simple idea; no elaborate “memory” artifacts, no discipline or system to follow, work until 95%+ context usage.

The tool (with the related plugins) makes it seamless: first type “>resume” in your session (this copies session id to clipboard), then quit and run

    aichat resume 
And this launches a TUI offering a few ways to resume your work, one of which is “rollover”; this puts you in a new session with the original session jsonl path injected. And in the new session say something like,

“There is a chat session log file path shown to you; Use subagents strategically to extract details of the task we were working on at the end of it”, or use the /recover-context slash command. If it doesn’t quite get all of it, prompt it again for specific details.

There’s also an aichat search command for rust/tantivy based fast full text search to search across sessions, with a TUI for humans and a CLI/JSON mode for agents/subagents. The latter ( and the corresponding skill and sub agent) can be used to recover arbitrary detailed context about past work.

Re: Ask HN: What is the best way to provide continuous context to models?

#35

Every time you send a request to a model you're already providing all of the context history along with it. To edit the context, just send a different context history. You can send whatever you want as history, it's entirely up to you and entirely arbitrary. We only think in conversational turns because that's what we've expected a conversation to 'look like'. But that's just a very deeply ingrained convention. Forge…

Bigger context makes responses slower.

Context is limited.

You do not want the cloud provider running a context compaction if you can control it a lot better.

There are even tips on when to ask the question like "send first the content then ask the question" vs. "ask the question then send the content"

Re: Ask HN: What is the best way to provide continuous context to models?

#36
One thing Cursor does different to some other agents such a Claude Code in managing context, is to use a vector database of code chunks so that it can selectively load relevant code chunks into context rather than entire source files.

Another way to control context size (not specific to Cursor), is to use subagents with their own context for specific tasks so that the subagent context can be discarded when done rather that just adding to the agent's main context.

If context gets too full (performance may degrade well before you hit LLM max context length), then the main remedy is to compact - summarize the old context and discard. One way to prevent this from being too disruptive is to have the agent maintain a TODO list tracking progress and what it is doing, so that it can better remain on track after compaction.

Re: Ask HN: What is the best way to provide continuous context to models?

#37
post #29

Earlier quoted context omitted.

Gemini the model is good, Gemini the framework around the model is a steaming pile of crap.

Yup. Gemini CLI needs a lot of work.

I'm pretty sure Anthropic is the only company that actually dogfoods their CLI tool.

Gemini seems like an afterthought an intern did, Codex has cool features but none of them align with real-world need.

Re: Ask HN: What is the best way to provide continuous context to models?

#38

I've been building https://www.usesatori.sh/ to give persistent context to agents Would be happy to onboard you personally.

i see you are only using vector search; many solutions for memory involve some combination of vector search and/or graphs (mem0, zep, cognee, etc). have you compared against these?

Re: Ask HN: What is the best way to provide continuous context to models?

#39
It's fairly surprising to me how naive/early we are still in the techniques that we use here.

Anthropic's post on the Claude Agent SDK (formerly Claude Code SDK) talks about how the agent "gathers context", and is fairly accurate as to how people do it today.

1. Agentic Search (give the agent tools and let it run its own search trajectory): specifically, the industry seems to have made really strong advances towards giving the agents POSIX filesystems and UNIX utilities (grep/sed/awk/jq/head etc) for navigating data. MCP for data retrieval also falls into this category, since the agent can choose to invoke tools to hit MCP servers for required data. But because coding agents know filesystems really well, it seems like that is outperforming everything else today ("bash is all you need").

2. Semantic Search (essentially chunking + embedding, a la RAG in 2022/2023): I've definitely noticed a growing trend amongst leading AI companies to move away from this. Especially if your data is easily represented as a filesystem, (1) seems to be the winning approach.

Interestingly though this approach has a pretty glaring flaw: all the approaches today really only provide the agents with raw unprocessed data. There's a ton of recomputation on raw data! Agents that have sifted through the raw data once (maybe it reads v1, v2 and v_final of a design document or something) will have to do the same thing again in the next session.

I have a strong thesis that this will change in 2026 (Knowledge Curation, not search, is the next data problem for AI) https://www.daft.ai/blog/knowledge-curation-not-search-is-th... and we're building towards this future as well. Related ideas here that have anecdotal evidence of providing benefits, but haven't really stuck yet in practice include: agentic memory, processing agent trajectory logs, continuous learning, persistent note-taking etc.

Re: Ask HN: What is the best way to provide continuous context to models?

#40

One thing Cursor does different to some other agents such a Claude Code in managing context, is to use a vector database of code chunks so that it can selectively load relevant code chunks into context rather than entire source files. Another way to control context size (not specific to Cursor), is to use subagents with their own context for specific tasks so that the subagent context can be discarded when done rathe…

A vector database of code chunks sounds like it would have advantages over agentic search. Less reimplemented code that's already in your codebase, things get missed by grep. It should be faster too, I get impatient watching CC doing the same set of searches every time it's launched.
Post reply on HN