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

State persistence #695

Open
samuelcolvin opened this issue Jan 15, 2025 · 4 comments · May be fixed by #955
Open

State persistence #695

samuelcolvin opened this issue Jan 15, 2025 · 4 comments · May be fixed by #955
Assignees
Labels
Feature request New feature request graph

Comments

@samuelcolvin
Copy link
Member

samuelcolvin commented Jan 15, 2025

Following #528, we really need a way to store state after each node is run.

We should provide:

  • an ABC for persisting state
  • a disk implementation
  • a sqlite implementation

In future we'll probably want to provide a postgres implementation, but I think that can come later when we're more confident of the schema.

This also relates to other database access and persistence:

@samuelcolvin samuelcolvin added the Feature request New feature request label Jan 15, 2025
@izzyacademy
Copy link
Contributor

I think we should add a distributed K-V store (Redis) in the initial release of this feature because for apps that have a distributed backend it would benefit from a centralized mechanism to store the state. After your ABC, I can add the redis implementation.

@rupurt
Copy link

rupurt commented Jan 16, 2025

It might also be rad to also have an event driven version with tiered storage support from memory -> disk -> object storage. I can take a crack when the abc is available also.

@asaf
Copy link

asaf commented Jan 21, 2025

Maybe you can take into consideration delegating state to sub graphs (where a node is another graph) that way the entire graph execution could be stored in a single state but also scoped per subgraph.

It complicates things a bit but sub graphs make much sense when it comes to complex agents execution (e..g, a main graph with a sub graph such "communication manager" that have multiple agents such "slack" and "gmail")

@AlexEnrique
Copy link

How would this work? We would pass a "connection or cursor" down to .next() and after it had run, it would store the history in the db?

Since we already have .dump_history() and .load_history(), in my opinion, that's what we need to persist state.

So, at least for v1, I would say that it should be the developer's reponsability to persist the given dump. This is straightfoward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request New feature request graph
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants