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

Refactoring: event stream based agent history #2709

Merged
merged 37 commits into from
Jul 7, 2024
Merged

Conversation

enyst
Copy link
Collaborator

@enyst enyst commented Jul 1, 2024

Memory component: short overview

This PR works with the short term history. It proposes an implementation of the event-stream based architecture for agent history, which:

  • uses directly the event stream for history
    • it doesn't save its own copies of events (in state.history)
    • event stream is the source of truth
  • filters and otherwise processes the events, for insertion in the prompt
  • the stream is not pairs of (action, observation), and neither is history
    • when the agent returns an action, the runtime/backend returns an observation that has the field cause set to the action id
  • a compatibility method with (action, observation) pairs is used for evals output.

Pre-requisite for #2021

@enyst enyst marked this pull request as draft July 1, 2024 01:46
@enyst enyst changed the title Arch refactoring: use the event stream in agent history Arch refactoring: event stream based agent history Jul 1, 2024
@enyst enyst force-pushed the enyst/history_eventstream branch from 54236ca to 8c1859a Compare July 3, 2024 04:48
@enyst enyst marked this pull request as ready for review July 4, 2024 01:35
@enyst enyst changed the title Arch refactoring: event stream based agent history Refactoring: event stream based agent history Jul 4, 2024
Copy link
Collaborator

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is amazing efforts! Really hoping we can merge it soon - recently we did some big refractor on the eval inference side that might break this.. Lmk if there's anything i can help to fix the merge conflicts!

@enyst enyst force-pushed the enyst/history_eventstream branch 2 times, most recently from c32ed9e to c82fb14 Compare July 7, 2024 05:12
agenthub/dummy_agent/agent.py Outdated Show resolved Hide resolved
@enyst enyst force-pushed the enyst/history_eventstream branch from c82fb14 to b84a382 Compare July 7, 2024 05:51
@enyst
Copy link
Collaborator Author

enyst commented Jul 7, 2024

@xingyaoww Totally agree, I think it will be better to get this one in, sooner rather than later, because we need this architecture to continue building on.

Merge conflicts fixed, and it's ready for review.

Copy link
Collaborator

@tobitege tobitege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!
Got no blockers, but a couple of nits. 😬

agenthub/codeact_agent/codeact_agent.py Show resolved Hide resolved
agenthub/dummy_agent/agent.py Outdated Show resolved Hide resolved
evaluation/EDA/run_infer.py Show resolved Hide resolved
evaluation/logic_reasoning/run_infer.py Show resolved Hide resolved
opendevin/memory/history.py Show resolved Hide resolved
opendevin/memory/history.py Show resolved Hide resolved
opendevin/memory/history.py Outdated Show resolved Hide resolved
opendevin/memory/history.py Outdated Show resolved Hide resolved
opendevin/storage/local.py Show resolved Hide resolved
Copy link
Collaborator

@tobitege tobitege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🍰

@neubig neubig enabled auto-merge (squash) July 7, 2024 20:42
Copy link
Contributor

@neubig neubig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this briefly, but from my check it looks good!

@neubig neubig merged commit d37b297 into main Jul 7, 2024
2 checks passed
@neubig neubig deleted the enyst/history_eventstream branch July 7, 2024 21:04
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.

5 participants