⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

How Do Agents Access State Variables? Understanding State Value Retrieval in LLM Agents #1948

@shenshiqiSSQ

Description

@shenshiqiSSQ

I have a question: In the instruction for an agent like this:

instruction="Read state['current_code'] (if exists) and state['requirements']. Generate/refine Python code to meet requirements. Save to state['current_code']."
I'm unsure whether the agent actually knows the contents of state or if it retrieves information from the context. I know that using {{}} (e.g., {{current_code}}) in the instruction will trigger state value substitution, but does the agent automatically fetch values when the format is state['current_code'] or just 'current_code'?

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementation

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions