Compaction
#1099
Replies: 1 comment
-
|
@nrfulton just to confirm from our meeting that we agreed on (2) for "Etc." We also talked about a react specific https://github.com/generative-computing/mellea/tree/main/mellea/stdlib/frameworks/cc @yelkurdi |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Compacting Context
Ramon et al. have proposed leading a push on compaction during this/next sprint.
Here are some notes from our design meeting.
Changes to make to Mellea's Standard Library
1. Add a
Compactorprotocol to stdlibWe will add a
mellea.stdlib.contextmodule that has acompactor.pyexposing the following protocol". Everything inmellea/stdlib/context.pywill have to be refactored to live in that package, and__init__.pywill have to expose the stuff currently incontext.pyso that this is minimally breaking.Some important notes:
frozen.2. Refactor existing "compaction" to use the Compactor Protocol
There is a
window=in ChatHistory that needs to be reimplemented using a compactor.3. Document use Patterns (needs to be documented well -- not unregulated slop)
There are two use patterns, both of which are legitimate.
Pattern 1. In the ctx.add method (so the subclass of context that defines your app's special context knows what it means to compact itself)
Pattern 2. manually: we use a context without any compaction (or maybe with compaction, doesn't matter) but we want to do our own stuff
One example of why you might want the manual compaction: if compaction is provided as a tool to the model.
Implement some simple examples and build up to react. Put the progression in
docs/rewrite. Docs should be LLM-friendly.Etc.
From here, it's not clear how to proceed. There are two different ways of defining compaction:
-> not in stdlib unless that context type is in stdlib.
-> these got in stdlib iff (1) that context type is defined in stdlib (simple, chat) and it's somehow essential
-> probably goes into a separate mellea-compactors or something.
There are probably middle grounds as well.
Beta Was this translation helpful? Give feedback.
All reactions