Skip to content

πŸš€ CubicAgent-OpenAI v2.3.6 - AI-Powered Summarizer Tools

Choose a tag to compare

@hainayanda hainayanda released this 06 Aug 11:34
· 26 commits to main since this release

πŸš€ CubicAgent-OpenAI v2.3.6 - AI-Powered Summarizer Tools

🌟 Major New Feature: AI-Powered Summarizer Tools

We're excited to introduce AI-Powered Summarizer Tools, a revolutionary feature that automatically creates intelligent summarizer variants of all your MCP tools using dedicated gpt-4o-mini models for cost-effective analysis.

✨ What's New

πŸ€– Automatic Tool Enhancement

  • Auto-generates summarize_* variants for every available MCP tool
  • Dynamic tool creation when server tools are fetched
  • Zero configuration needed - works with any existing MCP tool

πŸ’° Cost-Effective Intelligence

  • Uses gpt-4o-mini for summarization (cheaper than main models)
  • Separate token usage tracking for budget optimization
  • Configurable via OPENAI_SUMMARIZER_MODEL environment variable

🎯 Custom Summarization

  • _prompt parameter for tailored summarization instructions
  • Examples: "Focus on errors only", "Extract key metrics", "Highlight anomalies"
  • Returns both original results AND AI-generated summary

πŸ“Š Enhanced Monitoring

  • Token usage tracking for each summarization
  • Cost optimization insights
  • Performance analytics

πŸ”§ Configuration

Add to your .env file:

OPENAI_SUMMARIZER_MODEL=gpt-4o-mini

πŸ“– Usage Examples

{
  "name": "summarize_getLogs",
  "arguments": {
    "_prompt": "Focus on errors and warnings only",
    "userId": 123,
    "timeRange": "24h"
  }
}

Returns:

{
  "success": true,
  "originalTool": "getLogs",
  "originalResult": { /* complete original data */ },
  "summary": "Found 3 errors related to database connectivity...",
  "tokensUsed": 45
}

πŸ—οΈ Technical Improvements

Extended OpenAI Model Support:

  • All GPT-4o models (gpt-4o, gpt-4o-mini)
  • All GPT-4 variants (gpt-4, gpt-4-turbo, gpt-4-turbo-preview, etc.)
  • All GPT-3.5 models (gpt-3.5-turbo variants)

Robust Architecture:

  • Collision-safe _prompt parameter using underscore prefix
  • Comprehensive error handling and validation
  • Automatic integration with InternalToolAggregator
  • Complete backward compatibility

Enhanced Documentation:

  • 170+ lines of comprehensive usage examples
  • Best practices and optimization guidelines
  • Cost-effective deployment strategies

πŸ§ͺ Testing

Comprehensive Test Suite:

  • Unit tests for all SummarizerToolInstance functionality
  • Integration tests with real OpenAI API calls
  • Error handling and edge case coverage
  • Token usage validation and monitoring

🎯 Benefits

βœ… Intelligent Filtering - Extract only relevant information from large datasets
βœ… Cost Optimization - Use cheaper models for analysis while keeping premium models for reasoning
βœ… Custom Insights - Get summaries tailored to your specific questions
βœ… Reduced Complexity - Process large tool outputs more efficiently
βœ… Flexible Perspectives - Same data, different viewpoints based on prompts
βœ… Zero Configuration - Works automatically with any MCP tool

πŸ“‹ Environment Variables

New:

  • OPENAI_SUMMARIZER_MODEL (optional) - Enables AI-powered summarization

Enhanced:

  • Extended OPENAI_MODEL enum with all OpenAI model variants
  • Improved validation and error messages

πŸ”„ Version Alignment

This release aligns with the Cubicler ecosystem versioning strategy:

  • CubicAgent-OpenAI: v2.3.6 (this release)
  • CubicAgentKit: v2.3.4 (dependency)
  • Cubicler: v2.3.0 (compatible)

πŸ“¦ Installation

# npm
npm install @cubicler/cubicagent-openai@2.3.6

# Global CLI
npm install -g @cubicler/cubicagent-openai@2.3.6

# Direct usage
npx @cubicler/cubicagent-openai@2.3.6

πŸ”— Full Changelog

  • feat: Add AI-powered summarizer tools with gpt-4o-mini integration
  • feat: Add OPENAI_SUMMARIZER_MODEL environment variable
  • feat: Implement SummarizerToolInstance class for individual tool summarization
  • feat: Add createSummarizerTools factory function for dynamic tool creation
  • feat: Auto-generate summarize_* variants for all available MCP tools
  • feat: Include token usage tracking for cost monitoring and optimization
  • enhance: Update OpenAIService to create summarizer tools when server tools are fetched
  • enhance: Add summarizer tools to InternalToolAggregator for seamless registration
  • enhance: Extend message helper to document available summarizer tools in system prompt
  • enhance: Support _prompt parameter for custom summarization instructions
  • docs: Update README.md with comprehensive summarizer tools documentation
  • config: Add OPENAI_SUMMARIZER_MODEL to .env.example with gpt-4o-mini default
  • config: Expand environment.ts schema to support all OpenAI models
  • test: Add comprehensive unit tests for SummarizerToolInstance
  • test: Add integration tests for real OpenAI API summarization
  • chore: Bump version to 2.3.6 to align with Cubicler ecosystem

πŸ™ Acknowledgments

This release represents a significant step forward in making AI agent interactions more intelligent and cost-effective. The summarizer tools feature enables developers to get focused insights from tool results while maintaining complete access to original data.


⭐ Don't forget to star the repository if you find CubicAgent-OpenAI useful!

πŸ› Found an issue? Report it on GitHub Issues