EmbedInDB
v0.2.1
Embedinは、MySQL、PostgreSQL、MS SQL Serverなどの人気のあるデータベースを、努力をゼロのベクトルデータベースにシームレスに変換するオープンソースベクトルデータベースと効率的なライブラリです。
Embedinは、自然言語処理、画像認識、推奨システムなどのAIアプリケーションにとって理想的なソリューションであり、迅速なインデックス作成と検索を提供します。そのシンプルなAPIとクエリ言語は、使いやすさとシームレスな統合を保証します。
Python 3.7以上。
pip install embedin from embedin import Embedin
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ])
result = client . query ( "These are tests" , top_k = 1 ) # Query the most similar text from the collection
print ( result ) from embedin import Embedin
url = 'sqlite:///test.db'
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-postgres例
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_POSGRES_URL' , "postgresql+psycopg2://embedin:embedin@localhost/embedin_db" )
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-mysql例
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_MYSQL_URL' , "mysql+pymysql://embedin:embedin@localhost/embedin_db" )
client = Embedin ( collection_name = "test_collection" , texts = [ "This is a test" , "Hello world!" ], url = url )
result = client . query ( "These are tests" , top_k = 1 ) cd docker
docker-compose up embedin-mssql例
import os
from embedin import Embedin
url = os . getenv ( 'EMBEDIN_MSSQL_URL' , "mssql+pymssql://sa:StrongPassword123@localhost/tempdb" )
client = Embedin ( collection_name = "test_collection" , url = url )
client . add_data ( texts = [ "This is a test" ], meta_data = [{ "source" : "abc4" }])
result = client . query ( "These are tests" , top_k = 1 )寄稿者ガイドを参照してください