Skip to content

v0.4.0 (2024-03-06)

Choose a tag to compare

@philippgille philippgille released this 06 Mar 22:46

Highlights in this release are optional persistence, an extended interface, support for creating embeddings with Ollama, the exporting of the Document struct, and more Go-idiomatic methods to add documents to collections.

Added

  • Extended the interface:
    • DB.ListCollections() (PR #12)
    • DB.GetCollection() (PR #13 + #19)
    • DB.DeleteCollection() (PR #14)
    • DB.Reset() (PR #15)
    • DB.GetOrCreateCollection() (PR #22)
    • Collection.Count() (PR #27)
    • Document struct, NewDocument() function, Collection.AddDocument() and Collection.AddDocuments() methods (PR #34)
      • More Go-idiomatic alternatives to Collection.Add()
  • Added various unit tests (PR #20, #39)
  • Added optional persistence! Via multiple PRs:
  • Added support for creating embeddings with Ollama (PR #32)
  • Added example documentation (PR #42)

Improved

  • Improved example (PR #11, #28, #33)
  • Stop exporting Collection.Metadata (PR #16)
    • Goal: Prevent direct modifications which could cause data races in case of the user doing a modification while chromem-go for example ranges over it during a Collection.Query() call.
  • Copy metadata in constructors (PR #17)
    • Goal: Prevent direct modifications which could cause data races in case of the user doing a modification while chromem-go for example ranges over it.
  • Improved CI (PR #18)
    • Add Go 1.22 to test matrix, update used GitHub Action from v4 to v5, use race detector during tests
  • Reorganize code internally (PR #21)
  • Switched to newer recommended check for file related ErrNotExist errors (PR #29)
  • Added more validations in several existing methods (PR #30)
  • Internal variable renamed (PR #37)
  • Fail unit tests immediately (PR #40)

Fixed

  • Fixed metadatas validation in Collection.AddConcurrently() (PR #35)
  • Fixed Godoc of Collection.Query() method (PR #36)
  • Fixed length of result slice (PR #38)
  • Fixed filter test (PR #41)

Breaking changes

  • Because functions can't be (de-)serialized, GetCollection requires a new parameter of type EmbeddingFunc, in order to set the correct func when using a DB with persistence and it just loaded the collections and documents from storage. (PR #25)
  • Some methods now return an error (due to file operations when persistence is used)
  • Additional validations will return an early error, but most (if not all) prior calls with the invalid parameters probably lead to some errors down the line anyway
  • Collection.Metadata is not exported anymore
  • Result.Document field was renamed to Result.Content, to avoid confusion with the now exported Document struct