ErikBjare / gptme

Your agent in your terminal, equipped with local tools: writes code, uses the terminal, browses the web, vision.
https://gptme.org/docs/
MIT License
2.67k stars 180 forks source link

Subagent tool & smarter ways to handle context #61

Open ErikBjare opened 10 months ago

ErikBjare commented 10 months ago

When working on gpt-engineer I notice one benefit which is that the context per request is a lot smaller, because we don't keep sending past conversation history. This also saves massively on OpenAI spend.

This could be achieved by giving gptme a "subagent" tool, which can run a complex tasks that require back-and-forth, and for which the required context is clearly scoped, and a clear-defined result.

Examples of such tasks include:

This might require some change to the data model, to support the notion of subconversations, or perhaps an arbitrary metadata field that isn't send to the LLM, and can thus be used to store subconversations.

Or maybe we just store all subconversations as their own files (possibly in their own directory), and reference them in the raw conversation log.

The user should be able to interact with the subconversation (if needed, to debug or such).

ErikBjare commented 3 months ago

A fair bit of progress was made on this today in https://github.com/ErikBjare/gptme/pull/79

Basic MVP working, including tests. Just a tiny bit more work and it'll work great!