Metadata-Version: 2.1
Name: neurostore
Version: 0.2.0
Summary: A package for storing and managing LLM queries.
Maintainer-email: Kunal Kapur <kunalkapur888@gmail.com>
License: == Neurostore License (MIT) ==
        
        MIT License
        
        Copyright (c) [2024] [Kunal Kapur]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/kunal-kapur/neurostore
Keywords: openAI,milvus,vector database
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pymilvus
Requires-Dist: pymilvus[model]
Requires-Dist: openai
Requires-Dist: keybert
Requires-Dist: numpy<2
Provides-Extra: dev
Requires-Dist: black>24.1.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy>1.10.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine>=5.1.1; extra == "dev"

# Neurostore

This package serves as a way to 'cache' previous queries from LLMs to reduce the number of API calls necessary by using Milvus vector databases. 
A user can use their choice of embedding model from OpenAI to small Albert models that can be run locally. This allows for more optimized storage and more efficient search when finding previous queries/answers


## Getting started 
```bash
pip install neurostore
```
### Configure your environment variables for you desired LLM 
(e.g 
```bash
  export OPENAI_API_KEY=....
```

#### Store an run as you would normally 
Query your desired LLM as you normally would
```python

cache = Neurostore()
my_message = [
    {
        "role": "system",
        "content": "Put something about fish at the beginning of each prompt",
    },
    {"role": "user", "content": "Tell me about birds"},
]
cache.create(messages=my_message, store=True, model="gpt-3.5-turbo-1106",temperature=0.5)
print(cache.query(messages=my_message, num_results=2))
```


## Diagram

![neurostore](https://github.com/user-attachments/assets/eb022955-508c-48eb-871a-2f9b789d9807)
