Releases: botirk38/semanticcache
v0.6.0: Provider-aware Token Limits
🚀 Release v0.6.0: Provider-aware Token Limits
✨ Features
- Provider-aware chunking: Implement intelligent chunking that respects embedding model token limits
- Auto-configuration: Cache automatically detects and sets MaxTokens from the embedding provider
- Efficient processing: Only chunks text when it exceeds the model's token capacity, avoiding unnecessary overhead
🔧 API Changes
- Added
GetMaxTokens()method toEmbeddingProviderinterface - OpenAI provider now exposes model-specific token limits (8191 tokens for supported models)
🧪 Testing
- Added comprehensive tests for chunking behavior with MaxTokens thresholds
- Updated mock providers to implement new interface methods
- All tests pass with 90%+ coverage
📝 Changes
- Modified
cache.Set()to count tokens first before chunking decisions - Updated chunker logic to use MaxTokens instead of ChunkSize for threshold checks
- Enhanced error handling and validation for token counting operations
🔄 Migration Notes
This is a minor version bump with backward-compatible changes. Existing code will continue to work, but chunking behavior is now more efficient by avoiding unnecessary processing of texts that fit within model limits.
v0.5.2 - Go 1.25.3 and Dependency Updates
What's Changed
This patch release updates the Go version and brings in the latest dependency updates.
Go Version Update
- Go 1.25.3: Updated from Go 1.24 to 1.25.3
- CI Updates: Updated GitHub Actions workflows to use Go 1.25
Dependency Updates
- Redis Client:
github.com/redis/go-redis/v9from9.14.0→9.17.0 - Crypto Library:
golang.org/x/cryptoupdated to latest version - CI Actions:
actions/checkoutfromv5→v6
Maintenance
- All tests pass with the new Go version
- CI pipeline updated to use Go 1.25
- Security and performance improvements from dependency updates
Full Changelog: v0.5.1...v0.5.2
v0.5.1 - Simplified Chunking API
What's Changed
This patch release simplifies the chunking configuration API for better usability.
Refactoring
- Simplified API: Replaced
WithChunking(config)andWithoutChunking()with a singleWithChunking(enabled bool, config ...chunker.ChunkConfig)function - Backward Compatible: Default chunking behavior remains unchanged (enabled by default)
- Flexible Configuration: Optional config parameter allows custom chunking settings when enabling
API Changes
Before:
// Enable with custom config
options.WithChunking(customConfig)
// Disable chunking
options.WithoutChunking()After:
// Enable with defaults (unchanged default behavior)
options.WithChunking(true)
// Enable with custom config
options.WithChunking(true, customConfig)
// Disable chunking
options.WithChunking(false)Testing
- All existing tests pass
- Updated test code to use new API
- No breaking changes to functionality
Full Changelog: v0.5.0...v0.5.1
v0.5.0 - Automatic Text Chunking
What's New
This release adds automatic text chunking with aggregate embeddings for handling documents that exceed embedding model token limits.
Features
-
Automatic Text Chunking: New chunker package with configurable strategies
FixedOverlapChunker: splits text with configurable size and overlap- Uses tiktoken for accurate token counting (cl100k_base encoding)
- Default: 512 token chunks with 50 token overlap, 8191 max tokens
-
Batch Embedding Support: Efficient multi-text embedding
- New
BatchEmbeddingProviderinterface - Implemented in OpenAI provider (up to 2048 texts per request)
- Automatic fallback to individual embeddings if batch not supported
- New
-
Aggregate Embedding Approach
- Chunks text when exceeding token limits
- Embeds all chunks using batch API for performance
- Averages chunk embeddings into single aggregate embedding
- Stores as single entry (no derived keys needed)
-
Improved Precision: Converted from float32 to float64
- Uses OpenAI's native float64 format
- Updated all similarity functions and backends
- Better precision for similarity calculations
Configuration
- Chunking enabled by default with sensible defaults
WithChunking()to customize chunk size/overlap/strategyWithoutChunking()to disable if not needed- Zero-config works out of the box
Testing
- Comprehensive chunker package tests
- Cache integration tests for aggregate embeddings
- All existing tests pass
Full Changelog: https://github.com/botirkhaltaev/semanticcache/compare/v0.4.0...v0.5.0
v0.4.0 - Async Operations Support
feat: add async methods for all backends - Add asynchronous SetAsync and GetAsync methods for FIFO, LFU, LRU backends - Add async support for Redis backend - Improve performance and responsiveness with non-blocking operations - Add comprehensive examples and performance guide - Update documentation with async operations section
v0.3.0: Major restructuring to modular architecture
🏗️ Major Restructuring to Modular Architecture
This release represents a significant architectural improvement, transforming the semantic cache library from a monolithic to a clean, modular structure.
✨ New Features
- Modular Package Structure: Split functionality into dedicated packages
similarity/- All similarity algorithms (cosine, euclidean, etc.)options/- Functional configuration options
- Enhanced Documentation: Added comprehensive AI agent instructions
CLAUDE.md- Claude-specific development guideAGENTS.md- Universal AI agent instructions
🔧 Improvements
- Cleaner Imports: More intuitive package organization
- Better Code Organization: Logical separation of concerns
- Enhanced Developer Experience: Clearer API structure
- Comprehensive Testing: All tests passing with zero linting errors
📖 Updated Usage
Before (v0.2.x):
cache := semanticcache.New(
semanticcache.WithLRUBackend(100),
semanticcache.WithSimilarityComparator(semanticcache.CosineSimilarity),
)After (v0.3.0):
import (
"github.com/botirk38/semanticcache"
"github.com/botirk38/semanticcache/options"
"github.com/botirk38/semanticcache/similarity"
)
cache := semanticcache.New(
options.WithLRUBackend(100),
options.WithSimilarityComparator(similarity.CosineSimilarity),
)⚠️ Breaking Changes
- Import paths changed: Update your imports to use the new package structure
- Function locations: Options moved to
optionspackage, similarity functions tosimilaritypackage - API compatibility: Core functionality remains the same, only import paths changed
🔧 Migration Guide
- Update imports to use
options.With*()functions - Update similarity function calls to use
similarity.*Similarity - All other API usage remains identical
🛠️ Development
- Zero linting issues (
golangci-lint run) - All tests passing (
go test ./...) - Clean modular architecture
- Ready for production use
📦 Installation
go get github.com/botirk38/semanticcache@v0.3.0Release v0.2.0
Major Features
- 🔌 Pluggable backends architecture
- 🔌 Pluggable providers architecture
- 🚀 Redis backend support with vector search
- 💾 Multiple in-memory cache strategies (LRU, LFU, FIFO)
Security Fixes
- 🔒 Fix TLS MinVersion vulnerability in Redis backend
Enhancements
- 📡 Redis URL parsing with TLS configuration
- 📚 Improved documentation and project structure
- 🧪 Enhanced testing coverage
- ⚙️ CI/CD improvements with dependency management