agent-experience / README.md

Commit History

  1. Update README.md

    Verified signature
    6b14b2d
  2. # Agent Experience **From Tasks, Reasoning, and Tool Use to Reflection and Memory** --- ## 1. What Is Experience? Traditional language model datasets typically focus on input and output: ```text Input → Output ``` The behavior of an Agent in real-world tasks is much more complex. An Agent may need to understand the task, develop a plan, use tools, observe changes in the environment, detect errors, adjust its strategy, retry actions, and finally verify whether the task has been completed. Therefore, preserving only the final answer loses a significant amount of valuable execution information. **Agent Experience** focuses on: > How an Agent understands a problem, develops a plan, takes actions, receives feedback, adjusts its strategy, and ultimately completes a task within a specific task and environment. A raw Agent Runtime typically produces an execution trajectory. Experience goes one step further by structuring and adding semantic meaning to the execution process: ```text Raw Trajectory ↓ Semantic Structuring ↓ Agent Experience ``` --- ## 2. Why Not Just Store Question / Answer? Consider the following two Agents. Agent A: ```text Question ↓ Many Ineffective Actions ↓ Errors ↓ Repeated Attempts ↓ Eventually Reaches the Correct Result ``` Agent B: ```text Question ↓ Correctly Understands the Task ↓ Develops a Plan ↓ Selects the Appropriate Tool ↓ Executes ↓ Verifies ↓ Answer ``` If only the Question and Answer are stored, these two samples may appear almost identical. If the Experience is preserved, however, we can further study: - How the Agent solves the problem - Whether Tool Use is appropriate - How Observations influence subsequent decisions - How the Agent recovers from errors - Whether Reflection is effective - Whether the final result has been verified - Which experiences are worth preserving as Memory This is the main reason for preserving the execution process as Experience rather than storing only the final answer. --- ## 3. From Trajectory to Experience An Agent Runtime can typically record an execution trajectory. For example: ```text User Request ↓ Browser Open ↓ Snapshot ↓ Click ↓ Observation ↓ Type ↓ Observation ↓ Submit ↓ Final Answer ``` These Trajectories are extremely valuable because they record what the Agent actually did. However, a raw Trajectory is closer to answering: > **What happened?** In other words, it is a Runtime Log. Experience aims to go one step further and express: > **What did this execution mean?** For example: ```text browser.open ``` may indicate that the Agent is entering the task environment. ```text browser.snapshot ``` may indicate that the Agent is obtaining the current state of the page. A: ```text browser.click ``` may be a normal action in the Agent's plan, or it may be an incorrect attempt. A subsequent sequence such as: ```text Observation ↓ Reflection ↓ Retry ``` may indicate that the Agent recognized a problem and changed its execution strategy. Experience is not merely about storing logs. It attempts to represent the execution experience formed while an Agent completes a task. --- ## 4. Experience and Training Data Agent Experience is not itself equivalent to any particular model training format. Experience first preserves the execution experience produced while an Agent completes a task: ```text Agent Experience │ ├── SFT Dataset ├── Tool-Use Dataset ├── Reasoning Dataset ├── Preference Dataset ├── Reward / RL Dataset └── Agent Evaluation Dataset ``` For example: ### Tool-Use Training The following can be extracted: ```text Context ↓ Action ↓ Observation ``` ### Error-Recovery Training The following can be extracted: ```text Failed Action ↓ Error Observation ↓ Reflection ↓ Retry ↓ Successful Action ``` Different training objectives can extract different data representations from the same Experience. Therefore: > **Experience can be considered an upstream data asset, while a Training Dataset is a downstream representation generated for a specific training objective.** --- ## 5. Schema Example A simplified Experience can be represented as: ```json { "schema_version": "experience-v1.0", "sample_id": "browser-exp-000001", "question": {}, "thinking": {}, "plan": {}, "tool_use": [], "observation": [], "reflection": {}, "retry": {}, "memory_update": {}, "self_evaluation": {}, "answer": {}, "raw_trajectory": {} } ``` Not every field is required. A simple Experience may contain only: ```text Question ↓ Open ↓ Snapshot ↓ Observation ↓ Answer ``` A more complex Experience may contain multiple loops: ```text Action ↓ Observation ↓ Reflection ↓ Retry ``` --- ## 6. Loading the Data ```python import json with open("xxx-xxx.jsonl", "r", encoding="utf-8") as f: for line in f: experience = json.loads(line) print(experience["question"]) print(experience["thinking"]) print(experience["tool_use"]) print(experience["observation"]) print(experience["reflection"]) print(experience["answer"]) ``` --- ## 7. Generation Environment - **Task Environment**: Controlled Browser / Web / Workspace / ...... - **Task Types**: - Filesystem - Browser - Code - ...... - **Agent Behavior**: - Thinking - Planning - Observation - ...... - **Tool Use**: Relevant tools - **Difficulty Levels**: Custom-defined - **Generation Model**: Based on MiniMax-M3

    Verified signature
    fccfc8f
  3. initial commit

    Verified signature
    9549b35