A lightweight vector database
Project description
Embedin - Empower AI with persistent memory
Embedin is an open-source vector database and efficient library that seamlessly converts popular databases like MySQL, PostgreSQL, and MS SQL Server into vector databases with zero effort.
Embedin is an ideal solution for AI applications like natural language processing, image recognition, and recommendation systems, offering fast indexing and retrieval. Its simple API and query language ensure ease of use and seamless integration.
Minimum Requirements
Python 3.7 or higher.
Installation
pip install embedin
Quick Start
Store embeddings in memory
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)
Store embeddings in SQLite
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)
Store embeddings in PostgreSQL
Start PostgreSQL Docker container
cd docker
docker-compose up embedin-postgres
example
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)
Store embeddings in MySQL
Start MySQL Docker container
cd docker
docker-compose up embedin-mysql
example
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)
Store embeddings in SQL Server
Start SQL Server Docker container
cd docker
docker-compose up embedin-mssql
example
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)
More References
Contribute
Please refer Contributors Guide
TODO
- unit test fail on faiss index (segmentation fault)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
embedin-0.2.2a0.tar.gz
(23.9 kB
view hashes)
Built Distribution
embedin-0.2.2a0-py3-none-any.whl
(51.2 kB
view hashes)
Close
Hashes for embedin-0.2.2a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b060e1b0bd36c6ba0ee5a1346c0e56a03445dd259eea3729128586a519adb616 |
|
MD5 | 53125c3e20d2de01560874e11ab5263b |
|
BLAKE2b-256 | d38581c1f4e8c1638f2ebebf0423edd227705d2f90e5d872945bed9ffc83f6f2 |