Code Monkey home page Code Monkey logo

hyperdb's Introduction

HyperDB

HyperDB Logo

A hyper-fast local vector database for use with LLM Agents.

Want to invest? Now accepting SAFEs ($135M cap minimum.)

Join the HyperDBiscord

Advantages

  • 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

Usage

Here's an example of using HyperDB to store and query documents with information about all 151 original pokemon in an instant:

import json
from hyperdb import HyperDB

# Load documents from the JSONL file
documents = []

with open("demo/pokemon.jsonl", "r") as f:
    for line in f:
        documents.append(json.loads(line))

# Instantiate HyperDB with the list of documents
db = HyperDB(documents, key="info.description")

# Save the HyperDB instance to a file
db.save("demo/pokemon_hyperdb.pickle.gz")

# Load the HyperDB instance from the save file
db.load("demo/pokemon_hyperdb.pickle.gz")

# Query the HyperDB instance with a text input
results = 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

hyperdb's People

Contributors

cs2716 avatar erik-dunteman avatar fergusfettes avatar hayabhay avatar jdagdelen avatar parasj avatar praneetneuro avatar rjadr avatar rysuds avatar shroominic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyperdb's Issues

Investor link

Hey just a heads up I had my checkbook out, but it looks like your investor link goes to some kind of pop-tart cat video

K8 Support

Are you considering adding K8 support for easier deployments to Cloud services?

Query to understand performance of hyperDB

Hi, firstly thanks a lot for this!

I was looking at the implementation of the files and tried to figure out what makes the performance better than other dbs?

  1. I could not find any direct usage of MKL BLAS library , is it somehow internally implemented ?
  2. Is the search proving to be the speed up , with the OpenAI embeddings the metric(cosine similarity) seems to be helping in retrieving the queries faster...
    It would be great if you could help with my queries thanks!

Enterprise features

We need features like cloud deployment, access management, data compliance, etc

Then we can easily markup the valuation to $100M

Vector "truthiness

File [/opt/homebrew/Caskroom/miniconda/base/envs/ai_env/lib/python3.10/site-packages/hyperdb/hyperdb.py:64](https://file+.vscode-resource.vscode-cdn.net/opt/homebrew/Caskroom/miniconda/base/envs/ai_env/lib/python3.10/site-packages/hyperdb/hyperdb.py:64), in HyperDB.add_document(self, document, vector)
     63 def add_document(self, document, vector=None):
---> 64     vector = vector or self.embedding_function([document])[0]
     65     if self.vectors is None:
     66         self.vectors = np.empty((0, len(vector)), dtype=np.float32)

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

How should we be evaluating vector as true? just Non-None?

🦙 LLAMA embeddings

Will you add support for LLAMA? 🦙 embeddings are not normalized to unit length like the OpenAI embeddings, meaning you can both represent direction and magnitude.

pypi version out of date

Love the project! Just wanted to point out that the pip version of the library does not have return_similarities as a parameter on HyperDB.query

Term sheet

Dear HyperDB gmbh,

We at Trendly VC are excited to offer you a seed investment of $5 million for your cutting-edge, buzzworthy, and undeniably innovative vector database technology. We are confident that this investment will take your company to the moon and beyond!

Below are the terms of our investment:

Valuation: $100 million pre-money valuation, $105 million post-money valuation.

Convertible note: This investment will be made in the form of a convertible note, which will convert into equity upon the company's next funding round or liquidity event, whichever occurs first.

Liquidation preference: Trendly VC will have a 2x liquidation preference over common stockholders in the event of a liquidation or sale of the company.

Board seat: Trendly VC will have the right to appoint one board member to hypoDB's board of directors.

Trendly VC hype package: As part of this investment, Trendly VC will provide hypeDB with a customized package of trendy buzzwords, including "synergy," "disruptive," "game-changing," and "unicorn potential." We believe these buzzwords will help hypedB attract additional investment and media attention.

We look forward to working with you and helping you ride the hype train to success!

Best regards,
Trendly VC

Rebranding to HyperBS

Subtle suggestion to rebrand the "entire" package with the name HyperB(etter)S(earch). I feel
This better reflects the potential of Hyper !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.