gptme-ace

Context optimization plugin for gptme, providing hybrid retrieval, semantic matching, and context curation for the lesson system. plugins/gptme-ace View on GitHub

ACE - Agentic Context Engineering Plugin

Context optimization plugin for gptme, providing hybrid retrieval, semantic matching, and context curation for the lesson system.

Research Background

Based on Agentic Context Engineering (ACE) research (Stanford/SambaNova/UC Berkeley, October 2025):

Also incorporates insights from:

Features

Hybrid Lesson Matching

Replaces simple keyword matching with multi-signal retrieval:

Signal Weight Description
Keyword 25% Traditional keyword matching
Semantic 40% Embedding-based similarity
Effectiveness 25% Historical usage success
Recency 10% Recently used lessons boosted
Tool Bonus +20% Bonus for matching tools

Semantic Deduplication

Uses sentence embeddings to detect similar lessons:

Retrieval Analytics

Tracks retrieval patterns for continuous improvement:

Installation

# Basic installation
pip install gptme-ace

# With embeddings support (recommended)
pip install gptme-ace[embeddings]

# Full installation (includes analytics tools)
pip install gptme-ace[full]

Configuration

Enable hybrid matching via environment variable:

export GPTME_LESSONS_HYBRID=true

Usage

As gptme Plugin

The plugin automatically enhances gptme's lesson matching when enabled:

# gptme.toml
[plugins]
enabled = ["gptme_ace"]

Programmatic Usage

from gptme_ace import GptmeHybridMatcher, LessonEmbedder

# Initialize with embeddings
embedder = LessonEmbedder()
matcher = GptmeHybridMatcher(embedder=embedder)

# Match lessons
results = matcher.match(lessons, context, threshold=0.5)

Dependencies

Required:

Optional (embeddings):

Migration from packages/ace

This plugin was migrated from Bob's workspace (packages/ace/) to gptme-contrib for broader use. The core functionality is preserved:

License

MIT