Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Adds a little to docs on state persistence

Stefan Krawczyk9d08d0bf62fd
diff --git a/docs/concepts/index.rst b/docs/concepts/index.rst
index 361aeaa2..1458d5ef 100644
--- a/docs/concepts/index.rst
+++ b/docs/concepts/index.rst
@@ -15,6 +15,7 @@ Overview of the concepts -- read these to get a mental model for how Burr works.
transitions
hooks
tracking
+ state-persistence
streaming-actions
additional-visibility
planned-capabilities
diff --git a/docs/concepts/state-persistence.rst b/docs/concepts/state-persistence.rst
new file mode 100644
index 00000000..75a5b419
--- /dev/null
+++ b/docs/concepts/state-persistence.rst
@@ -0,0 +1,24 @@
+=================
+State Persistence
+=================
+
+.. _state-persistence:
+
+Key to writing a real life `burr` application is state persistence. E.g. you're building a chat bot and you
+want to store the conversation history and then reload it when you restart. Or, you have a long running process,
+or series of agents, and you want to store the state of the process after each action, and then reload it if it fails, etc.
+
+Here we'll walk through how to add state persistence to a `burr` application. The following walk through the relevant
+ApplicationBuilder() methods, and then a full toy example.
+
+.initialize_from() method
+_________________________
+TODO:
+
+.with_persister() method
+________________________
+TODO:
+
+Supported Persistence Backends
+______________________________
+TODO:
diff --git a/docs/concepts/state.rst b/docs/concepts/state.rst
index 57c9e783..cbd1bc69 100644
--- a/docs/concepts/state.rst
+++ b/docs/concepts/state.rst
@@ -41,6 +41,6 @@ If you're used to thinking about version control, this is a bit like a commit/ch
Reloading Prior State
---------------------
-Note, if state is serializeable, it means that if stored, it can be reloaded. This is useful for
-reloading state from a previous run (for debugging or as part of the application), or for storing state in a database.
-We are building more capabilties here, for now for debugging purposes, see the :ref:`tracking <trackingclientref>` section.
+Note, if state is serializable, it means that if stored, it can be reloaded. This is useful for
+reloading state from a previous invocation (for debugging or as part of the application), or for storing state in a database.
+We have capabilities here, see the :ref:`state-persistence <state-persistence>` section.
diff --git a/docs/examples/ml_training.rst b/docs/examples/ml_training.rst
index 3df206b3..ed3b3fe3 100644
--- a/docs/examples/ml_training.rst
+++ b/docs/examples/ml_training.rst
@@ -2,4 +2,9 @@
ML Model Training
====================
+Hyperparameter Optimization is a key part of training machine learning models. For more sophisticated examples that
+aren't grid search, `burr` is a quick and easy way to implement hyperparameter optimization. You want to keep
+track of hyperparameters and metrics, feeding these into a decision function to determine where to look next,
+and `burr` can help you write and manage that process.
+
This is still a WIP -- come back soon, or `contribute your own example <https://github.com/DAGWorks-Inc/burr/issues/new>`_!
diff --git a/docs/examples/simulation.rst b/docs/examples/simulation.rst
index d801cba6..2165ed9c 100644
--- a/docs/examples/simulation.rst
+++ b/docs/examples/simulation.rst
@@ -2,4 +2,7 @@
Simulation
==========
+Simulations require state to be maintained across time steps. Burr provides a simple way for you to construct,
+manage, and introspect the state of your simulation.
+
This is still a WIP -- come back soon, or `contribute your own example <https://github.com/DAGWorks-Inc/burr/issues/new>`_!
diff --git a/docs/getting_started/install.rst b/docs/getting_started/install.rst
index d2ae8783..1e137dbb 100644
--- a/docs/getting_started/install.rst
+++ b/docs/getting_started/install.rst
@@ -9,6 +9,6 @@ along with a fully built server.
.. code-block:: bash
- pip install burr[learn]
+ pip install burr[start]
This will give you tools to visualize, track, and interact with the UI. Note, if you're using ``zsh``, you'll need to add quotes around the install target, (``pip install "burr[learn]"``).
diff --git a/docs/getting_started/simple-example.rst b/docs/getting_started/simple-example.rst
index cb9be9ca..ca4a41d0 100644
--- a/docs/getting_started/simple-example.rst
+++ b/docs/getting_started/simple-example.rst
@@ -55,7 +55,7 @@ Next, let's put together our application. To do this, we'll use an ``Application
("count", "count", expr("counter < 10")), # Keep counting if the counter is less than 10
("count", "done", default) # Otherwise, we're done
).with_entrypoint("count") # we have to start somewhere
- .with_tracker("my_first_app")
+ .with_tracker(project="my_first_app")
.build()
)
@@ -124,7 +124,7 @@ If you want to copy/paste, you can open up the following code block and add to a
("count", "count", expr("counter < 10")), # Keep counting if the counter is less than 10
("count", "done", default) # Otherwise, we're done
).with_entrypoint("count") # we have to start somewhere
- .with_tracker("my_first_app")
+ .with_tracker(project="my_first_app")
.build()
)
app.visualize("./graph", format="png", include_conditions=True, include_state=True)
diff --git a/docs/main.rst b/docs/main.rst
index 2ee12ff9..57c0ac94 100644
--- a/docs/main.rst
+++ b/docs/main.rst
@@ -4,6 +4,8 @@ Burr
Welcome to Burr's documentation, the state machine for managing complex data/LLM projects.
+TODO: VIDEO.
+
You'll find this documentation separated into three sections.
- If you don't know where to start, go to :ref:`getting started <gettingstarted>`.
diff --git a/docs/reference/index.rst b/docs/reference/index.rst
index 0e35f4f1..b1e20464 100644
--- a/docs/reference/index.rst
+++ b/docs/reference/index.rst
@@ -14,6 +14,7 @@ need functionality that is not publicly exposed, please open an issue and we can
application
actions
state
+ persister
conditions
tracking
visibility
diff --git a/docs/reference/persister.rst b/docs/reference/persister.rst
new file mode 100644
index 00000000..e7723daa
--- /dev/null
+++ b/docs/reference/persister.rst
@@ -0,0 +1,21 @@
+=================
+State Persistence
+=================
+
+This is an interface one should implement to provide state persistence for your
+application.
+
+.. autoclass:: burr.core.state.BasicStatePersistence
+ :members:
+
+ .. automethod:: __init__
+
+
+Supported Implementations
+=========================
+
+
+.. autoclass:: burr.core.state.SQLLitePersistence
+ :members:
+
+ .. automethod:: __init__
diff --git a/docs/reference/tracking.rst b/docs/reference/tracking.rst
index 5af4094d..73c9c4fa 100644
--- a/docs/reference/tracking.rst
+++ b/docs/reference/tracking.rst
@@ -2,8 +2,8 @@
Tracking
========
-Reference on the Tracking API. This is purely for information -- you should not use this directly.
-Rather, you should use this through :py:meth:`burr.core.application.ApplicationBuilder.with_tracker`
+Reference on the Tracking/Telemetry API.
+Rather, you should use this throug/in conjunction with :py:meth:`burr.core.application.ApplicationBuilder.with_tracker`.
.. autoclass:: burr.tracking.LocalTrackingClient