Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Feb 20, 2025

fix #695.

Copy link
Contributor

hyperlint-ai bot commented Mar 8, 2025

PR Change Summary

Implemented state persistence functionality in the graph processing system, enhancing the ability to track and manage state throughout the execution of graph nodes.

  • Introduced FullStatePersistence to manage state history during graph execution.
  • Updated examples to utilize FullStatePersistence instead of HistoryStep.
  • Removed verbose history output in favor of a more concise representation.

Modified Files

  • docs/graph.md
  • pydantic_graph/README.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

What is Hyperlint?

Hyperlint is an AI agent that helps you write, edit, and maintain your documentation.

Learn more about the Hyperlint AI reviewer and the checks that we can run on your documentation.

Copy link

github-actions bot commented Mar 8, 2025

Docs Preview

commit: 894a590
Preview URL: https://a24cb4ac-pydantic-ai-previews.pydantic.workers.dev

@samuelcolvin samuelcolvin marked this pull request as ready for review March 10, 2025 14:56
Copy link
Contributor

@dmontagu dmontagu left a comment

Choose a reason for hiding this comment

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

Still going but wanted to get you this feedback now rather than force you to wait for me to get through the rest

state: StateT,
deps: DepsT,
auto_instrument: bool,
snapshot_id: str | None = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems weird to me to have snapshot_id be a kwarg to GraphRun. Maybe you can explain this to me synchronously, but I feel like one of three things should be the case:

  • We can rework things so the GraphRun doesn't need a snapshot_id argument
  • We can rework the name of the snapshot_id argument to be more clear what its purpose is
  • My mental model about what is happening is way off

Regardless of which is right I think a discussion may get us to the bottom of this fairly quickly.

Copy link
Contributor

@dmontagu dmontagu left a comment

Choose a reason for hiding this comment

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

Discussed over slack, but basically I think we're in agreement on the following:

  • we should move some of the APIs to GraphRun instead of on run
  • we should make the connection between runs and persistence more explicit in the docs
  • we should make "thread creation" one of the methods on the Persistence ABC so that it's more clear how we intend for that to be done (basically, it gives people who want to implement it using postgres a more thorough starting point). (Not sure if you agreed with this but this was the point I was trying to make, if you had something different in mind that's fine, I'm just writing this for the sake of future reference.)

Just ping me once the GraphRun-related changes are made and I'll review further, I think that will get things to be basically in a good state though.

samuelcolvin and others added 2 commits March 12, 2025 10:55
@samuelcolvin samuelcolvin merged commit 416a0d1 into main Mar 14, 2025
17 checks passed
@samuelcolvin samuelcolvin deleted the state-persistence branch March 14, 2025 09:26
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.

State persistence
2 participants