Skip to main content

Embedin - Empower AI with persistent memory

PyPI Coverage Status

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

Metadata

Release files for embedin 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for embedin 0.2.1
File Size Uploaded
embedin-0.2.1.tar.gz 22.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for embedin 0.2.1
File Interpreter ABI Platform
embedin-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 57.2 kB

Release files / embedin-0.2.1.tar.gz

Download URL embedin-0.2.1.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c83573a7ad8890302d3b1471cfa1efa6bbcd6d73cb7f99efdd3b3b70ee758ed8
BLAKE2b-256 checksum
How to use checksums
d19ebf11fe19f9be46d967f1f46d7a13c7cde3c8c2b9dab03e1bdd8655958c61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / embedin-0.2.1-py3-none-any.whl

Download URL embedin-0.2.1-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bce8d9e1f4725c94bd31c37560d443f2d0f01c6deafc7ab864f3971895ef4429
BLAKE2b-256 checksum
How to use checksums
ee5f85db44d7fe44bfa56cbf96c5d91d1b9c90b66b99b786126b6c78402c9ef8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page