Skip to content

v0.3.0: Major restructuring to modular architecture

Choose a tag to compare

@botirkhaltaev botirkhaltaev released this 05 Sep 11:33
· 48 commits to master since this release

🏗️ 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