Skip to main content

make experience from trajectory

Project description

ExperienceMaker

ExperienceMaker Logo

Python Version PyPI Version License GitHub Stars

A comprehensive framework to make & reuse & share experience for AI agent
Empowering agents to learn from the past and excel in the future


๐Ÿ“ฐ What's New

  • [2025-08] ๐Ÿ‘‰ Access experiences directly through the library, and contribute to expand our expertise pool๐Ÿ‘‰TODO
  • [2025-08] ๐Ÿš€ MCP is now available! โ†’ Quick Start Guide
  • [2025-07] ๐ŸŽ‰ ExperienceMaker v0.1.1 is now available on PyPI!
  • [2025-07] ๐Ÿ“š Complete documentation and quick start guides released
  • [2025-06] ๐Ÿš€ Multi-backend vector store support (Elasticsearch & ChromaDB)

๐Ÿš€ What's Next

  • Pre-built Experience Libraries: Domain repositories (Finance/Coding/Education/Research) + community marketplace
  • Rich Experience Formats: Executable code/tool configs/pipeline templates/workflows
  • Experience Validation: Quality analysis + cross-task effectiveness + auto-refinement
  • Universal Trajectory Extraction: Raw logs/multimodal data/execution traces โ†’ experiences

๐ŸŒŸ What is ExperienceMaker?

ExperienceMaker is a framework that transforms how AI agents learn and improve through experience-driven intelligence. By automatically extracting, storing, and intelligently reusing experiences from agent trajectories, it enables continuous learning and progressive skill enhancement.

โœจ Core Capabilities

๐Ÿ” Intelligent Experience Summarizer

  • Success Pattern Recognition: Identify what works and understand the underlying principles
  • Failure Analysis: Learn from mistakes to avoid repeating them in future tasks
  • Comparative Insights: Understand the critical differences between successful and failed approaches
  • Multistep Trajectory Processing: Break down complex tasks into learnable, actionable segments

๐ŸŽฏ Smart Experience Retriever

  • Semantic Search: Find relevant experiences using advanced embedding models and semantic understanding
  • Context-Aware Ranking: Prioritize the most applicable experiences for current task contexts
  • Dynamic Rewriting: Intelligently adapt experiences to fit new situations and requirements
  • Multi-modal Support: Handle various input types including query, messages

๐Ÿ—„๏ธ Scalable Experience Management

  • Multiple Storage Backends: Choose from Elasticsearch (production-ready), ChromaDB (development), or file-based storage (testing)
  • Workspace Isolation: Organize experiences by projects, domains, or teams with complete separation
  • Deduplication & Validation: Ensure high-quality, unique experience storage with automated quality control
  • Batch Operations: Efficiently handle large-scale experience processing with optimized performance

๐Ÿ”ง Developer-Friendly Architecture

  • REST API Interface: Seamless integration with existing systems through clean API design
  • Modular Pipeline Design: Compose custom workflows from atomic operations with maximum flexibility
  • Flexible Configuration: YAML files and command-line overrides for easy customization
  • Experience Store: Ready-to-use out of the box โ€” thereโ€™s no need for you to manually summarize experiences. You can directly leverage existing, comprehensive experience datasets to greatly enhance your agentโ€™s capabilities.

ExperienceMaker Architecture


๐Ÿ› ๏ธ Installation

Option 1: Install from PyPI (Recommended)

pip install experiencemaker

Option 2: Install from Source

git clone https://github.com/modelscope/ExperienceMaker.git
cd ExperienceMaker
pip install .

โš™๏ธ Environment Setup

Create a .env file in your project root directory:

# Required: LLM API configuration
LLM_API_KEY="sk-xxx"
LLM_BASE_URL="https://xxx.com/v1"

# Required: Embedding model configuration  
EMBEDDING_MODEL_API_KEY="sk-xxx"
EMBEDDING_MODEL_BASE_URL="https://xxx.com/v1"

# Optional: Elasticsearch configuration (if using Elasticsearch backend)

๐Ÿš€ Quick Start

๐ŸŒ HTTP Service

For testing and development, use the local_file backend:

experiencemaker \
  http_service.port=8001 \
  llm.default.model_name=qwen3-32b \
  embedding_model.default.model_name=text-embedding-v4 \
  vector_store.default.backend=local_file

๐Ÿ’ก Pro Tip: Check out our Configuration Guide for detailed configuration topics including custom pipelines, operation parameters, and advanced configuration methods.

The service will start on http://localhost:8001

๐Ÿ”Œ MCP Server

ExperienceMaker now supports Model Context Protocol (MCP) for seamless integration with MCP-compatible clients like Claude Desktop:

experiencemaker_mcp \
  mcp_transport=stdio \
  llm.default.model_name=qwen3-32b \
  embedding_model.default.model_name=text-embedding-v4 \
  vector_store.default.backend=local_file

For SSE transport (Server-Sent Events):

experiencemaker_mcp \
  mcp_transport=sse \
  http_service.port=8001 \
  llm.default.model_name=qwen3-32b \
  embedding_model.default.model_name=text-embedding-v4 \
  vector_store.default.backend=local_file

๐Ÿ”— For detailed MCP setup and usage examples, see our MCP Quick Start Guide.

๐Ÿ” Production Setup with Elasticsearch Backend

experiencemaker \
  http_service.port=8001 \
  llm.default.model_name=qwen3-32b \
  embedding_model.default.model_name=text-embedding-v4 \
  vector_store.default.backend=elasticsearch

Setup Elasticsearch:

export ES_HOSTS="http://localhost:9200"
# Quick setup using Elastic's official script
curl -fsSL https://elastic.co/start-local | sh

๐Ÿ“– Need Help? Refer to Vector Store Setup for comprehensive deployment guidance.

๐Ÿ“ Your First ExperienceMaker Script

Here's how to get started! Note the workspace_id serves as your experience storage namespace. Experiences in different workspaces remain completely isolated and cannot access each other.

๐Ÿ“Š Call Summarizer Examples

Transform conversation trajectories into valuable experiences using batch summarization. Each trajectory contains:

  • Message: Complete conversation history between user and agent
  • Score: Performance rating (0-1 scale, where 0=failure, 1=success)

The summarizer analyzes these trajectories to extract actionable insights and patterns for future interactions.

Python
import requests

response = requests.post(url="http://0.0.0.0:8001/summarizer", json={
  "workspace_id": "test_workspace",
  "traj_list": [
    {"messages": [{"role": "user", "content": "hello world"}], "score": 1.0}
  ]
})

experience_list = response.json()["experience_list"]
for experience in experience_list:
  print(experience)
curl
curl -X POST "http://0.0.0.0:8001/summarizer" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "test_workspace",
    "traj_list": [
      {
        "messages": [{"role": "user", "content": "hello world"}],
        "score": 1.0
      }
    ]
  }'
Node.js
const fetch = require('node-fetch');
// or: import fetch from 'node-fetch';

async function callSummarizer() {
  try {
    const response = await fetch('http://0.0.0.0:8001/summarizer', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        workspace_id: "test_workspace",
        traj_list: [
          {
            messages: [{ role: "user", content: "hello world" }],
            score: 1.0
          }
        ]
      })
    });

    const data = await response.json();
    const experienceList = data.experience_list;
    
    experienceList.forEach(experience => {
      console.log(experience);
    });
  } catch (error) {
    console.error('Error:', error);
  }
}

callSummarizer();

๐Ÿ” Call Retriever Examples

Intelligently search and retrieve the most relevant experiences from your workspace to enhance decision-making. The retriever:

  • Finds the top-k most similar experiences based on semantic similarity to your query
  • Returns pre-assembled context ready for immediate use, or raw experience data for custom processing
  • Leverages your workspace's accumulated knowledge to provide contextually relevant insights
Python
import requests

response = requests.post(url="http://0.0.0.0:8001/retriever", json={
  "workspace_id": "test_workspace",
  "query": "what is the meaning of life?",
  "top_k": 1,
})

experience_merged: str = response.json()["experience_merged"]
print(f"experience_merged={experience_merged}")
curl
curl -X POST "http://0.0.0.0:8001/retriever" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "test_workspace",
    "query": "what is the meaning of life?",
    "top_k": 1
  }'
Node.js
const fetch = require('node-fetch');
// or: import fetch from 'node-fetch';

async function callRetriever() {
  try {
    const response = await fetch('http://0.0.0.0:8001/retriever', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        workspace_id: "test_workspace",
        query: "what is the meaning of life?",
        top_k: 1
      })
    });

    const data = await response.json();
    const experienceMerged = data.experience_merged;
    
    console.log(`experience_merged=${experienceMerged}`);
  } catch (error) {
    console.error('Error:', error);
  }
}

callRetriever();

๐Ÿ’พ Dump Experiences From Vector Store

Export and backup your valuable experience data for archival, analysis, or migration purposes. This operation:

  • Extracts all experiences from the specified workspace in the vector store
  • Saves them to a structured JSONL file at {path}/{workspace_id}.jsonl
  • Preserves complete experience metadata and embeddings for future restoration
Python
import requests

response = requests.post(url="http://0.0.0.0:8001/vector_store", json={
  "workspace_id": "test_workspace",
  "action": "dump",
  "path": "./",
})
print(response.json())
curl
curl -X POST "http://0.0.0.0:8001/vector_store" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "test_workspace",
    "action": "dump",
    "path": "./"
  }'
Node.js
const fetch = require('node-fetch');
// or: import fetch from 'node-fetch';

async function dumpExperiences() {
  try {
    const response = await fetch('http://0.0.0.0:8001/vector_store', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        workspace_id: "test_workspace",
        action: "dump",
        path: "./"
      })
    });

    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error('Error:', error);
  }
}

dumpExperiences();

๐Ÿ“ฅ Load Experiences To Vector Store

Import and restore previously exported experience data to populate your workspace with existing knowledge. This operation:

  • Reads experience data from the JSONL file located at {path}/{workspace_id}.jsonl
  • Reconstructs the vector embeddings and indexes them in the specified workspace
  • Enables immediate access to imported experiences for retrieval and decision-making
Python
import requests

response = requests.post(url="http://0.0.0.0:8001/vector_store", json={
  "workspace_id": "test_workspace",
  "action": "load",
  "path": "./",
})

print(response.json())
curl
curl -X POST "http://0.0.0.0:8001/vector_store" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "test_workspace",
    "action": "load",
    "path": "./"
  }'
Node.js
const fetch = require('node-fetch');
// or: import fetch from 'node-fetch';

async function loadExperiences() {
  try {
    const response = await fetch('http://0.0.0.0:8001/vector_store', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        workspace_id: "test_workspace",
        action: "load",
        path: "./"
      })
    });

    const data = await response.json();
    console.log(data);
  } catch (error) {
    console.error('Error:', error);
  }
}

loadExperiences();

๐Ÿ’ก Need More Advanced Operations? For additional workspace management features(e.g. delete_workspace, copy_workspace), advanced configuration options, and troubleshooting guidance, check out our comprehensive Quick Start Guide.

๐ŸŽญ Want to See It in Action? We've prepared a simple react agent that demonstrates how to enhance agent capabilities by integrating summarizer and retriever components, achieving significantly better performance.


๐Ÿงช Experiments

๐ŸŒ Experiment on Appworld

We test ExperienceMaker on Appworld with qwen3-8b:

Method pass@1 pass@2 pass@4
w/o ExperienceMaker (baseline) 0.083 0.140 0.228
w ExperienceMaker
experience(Direct Use) 0.109 0.175 0.281

Pass@K measures the probability that at least one out of K generated samples successfully completes the task (achieves score=1). The current experiments use an internal AppWorld environment which may have slight discrepancies, and we will soon update with experimental results from the standard AppWorld environment.

You may find more details to reproduce this experiment in quickstart.md

๐ŸงŠ Experiment on Frozenlake

Without Experience With Experience
without experience with experience

We test on 100 random frozenlake map with qwen3-8b:

Method pass rate
w/o ExperienceMaker (baseline) 0.66
w ExperienceMaker
[1] experience(Direct Use) 0.72 (+9.1%)
[2] experience(LLM Rewritten) 0.72 (+9.1%)

We also noticed that in such simple scenarios, not using LLM rewriting may actually yield better results.

Therefore, in some simple scenarios, you can also try disabling LLM rewriting by simply changing the following in default_config.yaml:

rewrite_experience_op:
  params:
    enable_llm_rewrite: false  # change this to false

You may find more details to reproduce this experiment in quickstart.md

๐Ÿ”ง Experiment on BFCL-V3

Coming Soon! Stay tuned for comprehensive evaluation results.


๐Ÿช Pre-built Experience Libraries

ExperienceMaker provides pre-built experience libraries to jumpstart your agent's capabilities. You can directly load these curated experiences into your workspace and start benefiting from accumulated knowledge immediately.

๐Ÿ“ฆ Available Experience Libraries

  • appworld_v1.jsonl: Comprehensive experiences from Appworld agent interactions, covering complex task planning and execution patterns
  • bfcl_v1.jsonl: Function calling experiences from Berkeley Function-Calling Leaderboard tasks

๐Ÿš€ Quick Start with Pre-built Experiences

Here's how to load and use the Appworld experience library:

Step 1: Load Pre-built Experiences

Python
import requests

# Load Appworld experiences into your workspace
response = requests.post(url="http://0.0.0.0:8001/vector_store", json={
    "workspace_id": "appworld_v1",
    "action": "load",
    "path": "./library/",
})

print(f"loading result result={response.json()}")
curl
curl -X POST "http://0.0.0.0:8001/vector_store" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "appworld_v1",
    "action": "load",
    "path": "./library/"
  }'

Step 2: Retrieve Relevant Experiences

Now you can query the loaded experiences to get contextual guidance for your tasks:

Python
import requests

# Query for app interaction experiences
response = requests.post(url="http://0.0.0.0:8001/retriever", json={
    "workspace_id": "appworld_v1",
    "query": "How to navigate to settings and update user profile information?",
    "top_k": 1,
})

experience_merged = response.json()["experience_merged"]
print(f"Retrieved experiences: {experience_merged}")
curl
curl -X POST "http://0.0.0.0:8001/retriever" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": "appworld_v1",
    "query": "How to navigate to settings and update user profile information?",
    "top_k": 1
  }'

๐Ÿ“š Additional Resources


๐Ÿค Contributing

We warmly welcome contributions from the community! Here's how you can help make ExperienceMaker even better:

๐Ÿ› Report Issues

  • Bug reports with detailed reproduction steps
  • Feature requests and enhancement suggestions
  • Documentation improvements and clarifications
  • Performance optimization ideas

๐Ÿ’ป Code Contributions

  • New operations and tools development
  • Backend implementations and optimizations
  • API enhancements and new endpoints
  • Test coverage improvements and quality assurance

๐Ÿ“ Documentation

  • Usage examples and comprehensive tutorials
  • Best practices guides and design patterns
  • Translation and localization efforts

๐Ÿ“„ Citation

If you use ExperienceMaker in your research or projects, please cite:

@software{ExperienceMaker,
  title = {ExperienceMaker: A Comprehensive Framework for AI Agent Experience Generation and Reuse},
  author = {The ExperienceMaker Team},
  url = {https://github.com/modelscope/ExperienceMaker},
  month = {08},
  year = {2025},
}

โš–๏ธ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

experiencemaker-0.1.1.tar.gz (71.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

experiencemaker-0.1.1-py3-none-any.whl (98.1 kB view details)

Uploaded Python 3

File details

Details for the file experiencemaker-0.1.1.tar.gz.

File metadata

  • Download URL: experiencemaker-0.1.1.tar.gz
  • Upload date:
  • Size: 71.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for experiencemaker-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9fcc1c5da7522ea4da535eff183db97134bc4571fbe4cd096a713e70bf4eab87
MD5 53c435abf4823db2c6c6ab7f5588ebdd
BLAKE2b-256 26d8414105e23cc44f58f62ccce820ae580fec01f5ab0628713d20675098027e

See more details on using hashes here.

File details

Details for the file experiencemaker-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for experiencemaker-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da9364d02b741f67de2ba67638c476c9b09dfad34577cf3b8d2a233823dc4bef
MD5 0c479575d08426697a86b283ac2def57
BLAKE2b-256 c698276ea857257a6b290b484156c8b180524837d386675232e74e1158e938ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page