Skip to content

Releases: botirk38/semanticcache

v0.6.0: Provider-aware Token Limits

27 Nov 18:51

Choose a tag to compare

🚀 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 to EmbeddingProvider interface
  • 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

27 Nov 18:35

Choose a tag to compare

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/v9 from 9.14.09.17.0
  • Crypto Library: golang.org/x/crypto updated to latest version
  • CI Actions: actions/checkout from v5v6

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

27 Nov 18:33

Choose a tag to compare

What's Changed

This patch release simplifies the chunking configuration API for better usability.

Refactoring

  • Simplified API: Replaced WithChunking(config) and WithoutChunking() with a single WithChunking(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

27 Nov 18:25

Choose a tag to compare

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 BatchEmbeddingProvider interface
    • Implemented in OpenAI provider (up to 2048 texts per request)
    • Automatic fallback to individual embeddings if batch not supported
  • 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/strategy
  • WithoutChunking() 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

02 Oct 06:38

Choose a tag to compare

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

05 Sep 11:33

Choose a tag to compare

🏗️ 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 guide
    • AGENTS.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 options package, similarity functions to similarity package
  • API compatibility: Core functionality remains the same, only import paths changed

🔧 Migration Guide

  1. Update imports to use options.With*() functions
  2. Update similarity function calls to use similarity.*Similarity
  3. 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.0

Release v0.2.0

26 Jul 17:52

Choose a tag to compare

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