A lightweight vector database
Project description
Embedin - Empower AI with persistent memory
What is Embedin
Embedin is a highly efficient software library designed to seamlessly convert widely-used databases, such as MySQL, PostgreSQL, and MS SQL Server, into a vector database with minimal effort. Its lightweight design enables quick and easy integration into your existing software stack, allowing you to leverage the benefits of a vector database without the need for extensive modifications to your current system.
With fast indexing and retrieval, it's ideal for high-performance applications such as natural language processing, image recognition, and recommendation systems. Embedin's simple API and query language make it easy to use and integrate.
Installation
pip install embedin
Quick Start
Using memory
from embedin.client import Client
client = Client(collection_name="test_collection", texts=["This is a test", "Hello world!"])
result = client.query("These are tests", top_k=1)
print(result)
Using Sqlite
from embedin.client import Client
url = 'sqlite:///test.db'
client = Client(collection_name="test_collection", texts=["This is a test", "Hello world!"])
result = client.query("These are tests", top_k=1)
Using PostgreSQL
import os
from embedin.client import Client
url = os.getenv('EMBEDIN_POSGRES_URL', "postgresql+psycopg2://embedin:embedin@localhost/embedin_db")
client = Client(collection_name="test_collection", texts=["This is a test", "Hello world!"])
result = client.query("These are tests", top_k=1)
Using MySQL
import os
from embedin.client import Client
url = os.getenv('EMBEDIN_MYSQL_URL', "mysql+pymysql://embedin:embedin@localhost/embedin_db")
client = Client(collection_name="test_collection", texts=["This is a test", "Hello world!"])
result = client.query("These are tests", top_k=1)
Using MS-SQL
import os
from embedin.client import Client
url = os.getenv('EMBEDIN_MSSQL_URL', "mssql+pymssql://sa:StrongPassword123@localhost/tempdb")
client = Client(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)
For development
Clone the repo
git clone https://github.com/EmbedInAI/embedin.git
Start PostgreSQL DB (Only necessary for using PostgreSQL as the storage)
cd docker
docker-compose up embedin-postgres
Start MySQL DB (Only necessary for using MySQL as the storage)
cd docker
docker-compose up embedin-mysql
Start MS-SQL DB (Only necessary for using MS-SQL as the storage)
cd docker
docker-compose up embedin-mssql
Run unit test with coverage report
coverage run -m unittest discover -s tests -p '*.py'
coverage report
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
Built Distribution
File details
Details for the file embedin-0.2.1.tar.gz
.
File metadata
- Download URL: embedin-0.2.1.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c83573a7ad8890302d3b1471cfa1efa6bbcd6d73cb7f99efdd3b3b70ee758ed8 |
|
MD5 | ef4861e24755fe00a13c388c7a3607a4 |
|
BLAKE2b-256 | d19ebf11fe19f9be46d967f1f46d7a13c7cde3c8c2b9dab03e1bdd8655958c61 |
File details
Details for the file embedin-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: embedin-0.2.1-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bce8d9e1f4725c94bd31c37560d443f2d0f01c6deafc7ab864f3971895ef4429 |
|
MD5 | 08759fdc70e11796dfd0e9f6a09f70ab |
|
BLAKE2b-256 | ee5f85db44d7fe44bfa56cbf96c5d91d1b9c90b66b99b786126b6c78402c9ef8 |