Memory system and optimization via feedback backpropagation#7
Merged
AdityaGolatkar merged 4 commits intostrands-labs:mainfrom Apr 8, 2026
Merged
Conversation
Adds support for persistent, optimizable memory parameters in agentic workflows. Key additions: - Computation graph: ai_function.trace() builds a graph of all function calls and memory accesses, enabling a backward pass from output feedback to the parameters that produced it. - Memory backends: a pluggable MemoryBackend base class for storing named parameters (strings, lists, or code). Ships with file-based and Amazon Bedrock AgentCore implementations. - Procedural parameters: a special parameter type that stores reusable Python functions distilled from the agent's execution trace — allowing subsequent runs to reuse proven code rather than regenerating it, analogous to JIT compilation for agentic logic. - Optimizer: a pluggable Optimizer base class for feedback propagation. Ships with a TextGrad-inspired implementation that walks the graph backward node-by-node and consolidates updates into the memory backend. - Improve typing by introducing separate SyncAIFunction and AsyncAIFunction classes with ParamSpec generics. Migrate template engine to tstr.
…ecks that memory schema has deafults
AdityaGolatkar
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.trace()to build a computation graph across AI Function calls, enabling a backward pass from output feedback to the parameters that produced itBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.