Skip to content

Instantly share code, notes, and snippets.

View metaskills's full-sized avatar
🐙
Being Inkcellent to Each Other

Ken Collins metaskills

🐙
Being Inkcellent to Each Other
View GitHub Profile
@metaskills
metaskills / embedding_store.rb
Created June 30, 2023 17:19 — forked from peterc/embedding_store.rb
Using SQLite to store OpenAI vector embeddings from Ruby
# Example of using SQLite VSS with OpenAI's text embedding API
# from Ruby.
# Note: Install/bundle the sqlite3, sqlite_vss, and ruby-openai gems first
# OPENAI_API_KEY must also be set in the environment
# Other embeddings can be used, but this is the easiest for a quick demo
# More on the topic at
# https://observablehq.com/@asg017/introducing-sqlite-vss
# https://observablehq.com/@asg017/making-sqlite-extension-gem-installable