You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple interface compatible with all large language model agents.
Highly optimized C++ backend vector store with HW accelerated operations via MKL BLAS.
Enables users to index documents with advanced features such as ids and metadata.
Installation
Install the package from PyPI:
pip install hyperdb-python
Optional dependency for locally embedding
If you want to use Hugging Face models with this package, you need to install the sentence-transformers package:
pip install sentence-transformers
Usage
Here's an example of using HyperDB to store and query documents with information about all 151 original pokemon in an instant:
importjsonfromhyperdbimportHyperDB# Load documents from the JSONL filedocuments= []
withopen("demo/pokemon.jsonl", "r") asf:
forlineinf:
documents.append(json.loads(line))
# Instantiate HyperDB with the list of documentsdb=HyperDB(documents, key="info.description")
# Save the HyperDB instance to a filedb.save("demo/pokemon_hyperdb.pickle.gz")
# Load the HyperDB instance from the save filedb.load("demo/pokemon_hyperdb.pickle.gz")
# Query the HyperDB instance with a text inputresults=db.query("Likes to sleep.", top_k=5)
Returns
Name: Snorlax
Pokedex ID: 143
HP: 160
Type: normal
Weakness: fighting
Description: Very lazy. Just eats and sleeps. As its rotund bulk builds, it becomes steadily more slothful.
Name: Drowzee
Pokedex ID: 96
HP: 230
Type: psychic
Weakness: dark
Description: Puts enemies to sleep then eats their dreams. Occasionally gets sick from eating bad dreams.
Name: Pinsir
Pokedex ID: 127
HP: 160
Type: bug
Weakness: fire
Description: When the temperature drops at night, it sleeps on treetops or among roots where it is well hidden.
Name: Abra
Pokedex ID: 63
HP: 160
Type: psychic
Weakness: dark
Description: Sleeps 18 hours a day. If it senses danger, it will teleport itself to safety even as it sleeps.
Name: Venonat
Pokedex ID: 48
HP: 160
Type: bug
Weakness: fire
Description: Lives in the shadows of tall trees where it eats insects. It is attracted by light at night.
*Benchmark Credit: Benim Kıçım
About
A hyper-fast local vector database for use with LLM Agents. Now accepting SAFEs at $135M cap.