EmbedInDB
v0.2.1
O Embedin é um banco de dados vetorial de código aberto e uma biblioteca eficiente que converte perfeitamente bancos de dados populares como MySQL, PostgreSQL e MS SQL Server em bancos de dados vetoriais com esforço zero.
O Embedin é uma solução ideal para aplicativos de IA, como processamento de linguagem natural, reconhecimento de imagens e sistemas de recomendação, oferecendo indexação e recuperação rápidas. Sua API simples e linguagem de consulta garantem a facilidade de uso e a integração perfeita.
Python 3.7 ou superior.
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-postgresexemplo
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-mysqlexemplo
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-mssqlexemplo
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 )Por favor, consulte o guia dos colaboradores