Skip to content

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

Closed

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'?

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Jul 14, 2025
  2. added this to the 08/11 FixIt Week milestone on Aug 8, 2025
  3. locked and limited conversation to collaborators on Aug 12, 2025
  4. converted this issue into a discussion #2489 on Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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