Skip to main content

SAGE Tool Use SIAS - Sample-Importance-Aware Selection for tool selection and agent training

Project description

SAGE Tool Use SIAS (Sample-Importance-Aware Selection)

Tool selection algorithm using sample-importance-aware selection for agent training and tool curation

PyPI version Python 3.10+ License: MIT

🎯 Overview

sage-agentic-tooluse-sias provides Sample-Importance-Aware Selection algorithms specifically designed for:

  • Tool Selection: Select important tools for agent use
  • Agent Training: Select important trajectories for fine-tuning
  • Continual Learning: Efficient sample selection for continual/lifelong learning
  • Tool/Trajectory Curation: Curate representative samples for agent development

📦 Installation

# Basic installation
pip install isage-agentic-tooluse-sias

# Development installation
pip install isage-agentic-tooluse-sias[dev]

🚀 Quick Start

Continual Learning

from sage_sias import OnlineContinualLearner, SIASSample

# Create continual learner
learner = OnlineContinualLearner(
    buffer_size=1000,
    replay_ratio=0.3,
)

# Add samples
new_samples = [
    SIASSample(sample_id="s1", text="tool call trace A"),
    SIASSample(sample_id="s2", text="tool call trace B"),
]
training_batch = learner.update_buffer(new_samples)

# Inspect replay buffer
important_samples = learner.buffer_snapshot()

Coreset Selection

from sage_sias import CoresetSelector

# Create coreset selector
selector = CoresetSelector(
    strategy="hybrid",
)

# Select representative samples
coreset = selector.select(samples=dataset, target_size=100)

📚 Key Components

1. Continual Learner (continual_learner.py)

Manages sample selection for continual learning:

  • Buffer management with importance-based eviction
  • Multiple selection strategies (loss_topk, diversity, hybrid, random)
  • Support for experience replay

2. Coreset Selector (coreset_selector.py)

Selects representative subsets:

  • Loss/diversity/hybrid/random selection
  • Diversity-aware sampling
  • Importance scoring
  • Support for large-scale datasets

3. Core Types (core_types.py)

Common data types and protocols:

  • Sample representation
  • Sample protocol
  • Selection summary

🔧 Architecture

sage_sias/
├── continual_learner.py    # Continual learning with buffer management
├── coreset_selector.py      # Coreset selection algorithms
├── core_types.py            # Common types and protocols
└── __init__.py              # Public API exports

🎓 Use Cases

  1. Agent Training: Select important trajectories for fine-tuning
  2. Data Pruning: Reduce dataset size while maintaining performance
  3. Active Learning: Query most informative samples
  4. Memory Management: Maintain representative samples in limited buffers
  5. Transfer Learning: Select relevant samples for adaptation

🔗 Integration with SAGE

This package is part of the SAGE ecosystem but can be used independently:

# Standalone usage
from sage_sias import OnlineContinualLearner, CoresetSelector, SIASSample

learner = OnlineContinualLearner(buffer_size=2048, replay_ratio=0.25)
selector = CoresetSelector(strategy="hybrid")

samples = [
    SIASSample(sample_id="a", text="query weather"),
    SIASSample(sample_id="b", text="query calendar"),
]
selected = selector.select(samples=samples, target_size=1)
batch = learner.update_buffer(selected)

📖 Documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License - see LICENSE file for details.

🙏 Acknowledgments

Originally part of the SAGE framework, now maintained as an independent package for broader community use.

📧 Contact

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

isage_agentic_tooluse_sias-0.1.1.2.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

isage_agentic_tooluse_sias-0.1.1.2-py2.py3-none-any.whl (11.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file isage_agentic_tooluse_sias-0.1.1.2.tar.gz.

File metadata

File hashes

Hashes for isage_agentic_tooluse_sias-0.1.1.2.tar.gz
Algorithm Hash digest
SHA256 cce002fe0efb8edf4aa8d26f6926c0c7ec6b60e4a01580b44b8b143a70b57afd
MD5 60504b70747a89bff9f290eff81535d2
BLAKE2b-256 c2f69d90d824ce1878e6d2b322297c8b549d832967fb8675f5b09f99c88f946f

See more details on using hashes here.

File details

Details for the file isage_agentic_tooluse_sias-0.1.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for isage_agentic_tooluse_sias-0.1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 166c1952dca27ff9b3df206baa9b2ae1da8c3ae8cb26162fd01fa62b60fc2c2d
MD5 c00ff80dea24abc5495ae27faab4a4e1
BLAKE2b-256 dc2210ad015606b6a00b81cccb1606237e1b6ad0a13edefec355bbea25a6b201

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