Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RecallObservations for retrieval of prompt extensions #6909

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

enyst
Copy link
Collaborator

@enyst enyst commented Feb 24, 2025

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Cc: @xingyaoww
I'd love your opinion about this idea. It's basically an alternative to 6526, I was curious to see roughly how it looks like, so we can maybe see if it makes sense.

This PR proposes to refactor prompt extensions into recalled observations:

  • take the retrieval of information out of the PromptManager, into a Memory component
  • PromptManager remains responsible with loading templates and rendering them (just a 'view manager')
  • Memory subscribes to the stream
    • on user messages, it may retrieve extensions and add them to the stream as RecallObservations
    • on the first user message, it may retrieve repo and runtime info
    • on recall actions (not yet in use, source=agent), it may retrieve e.g. library docs
  • some logic is separated from the agent (like 6526)
  • since the information is in the stream, session restore / refresh / runtime reconnect / etc will not lose it.

Not ready for review, just some food for discussion.

Cc: @csmith49


Link of any specific issues this addresses
Fix #6535

@enyst enyst marked this pull request as draft February 24, 2025 02:31
@csmith49
Copy link
Collaborator

This looks clean so far. I'm a fan of moving what we can to the event stream: much better visibility than modifying messages in-place, and I think leaning into the pub-sub approach is a good way to add extra functionality without having to tip-toe around the agent/controller/system control flow.

@xingyaoww
Copy link
Collaborator

I like this idea better than what I did in #6526! Happy to close that PR in favor of this one

@enyst enyst self-assigned this Feb 25, 2025
@enyst enyst force-pushed the enyst/retrieve-prompt branch from e86ae69 to 0e9f94e Compare February 26, 2025 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: repo.md missing from the prompt
3 participants