quivr/README.md

143 lines
3.5 KiB
Markdown
Raw Normal View History

2023-05-13 03:02:45 +03:00
# Quiver
<p align="center">
<img src="./logo.png" alt="quiver-logo" width="30%">
<p align="center">
2023-05-13 17:37:18 +03:00
Quiver is your second brain in the cloud, designed to easily store and retrieve unstructured information. It's like Obsidian but powered by generative AI.
2023-05-13 03:02:45 +03:00
## Features
- **Store Anything**: Quiver can handle almost any type of data you throw at it. Text, images, code snippets, you name it.
- **Generative AI**: Quiver uses advanced AI to help you generate and retrieve information.
- **Fast and Efficient**: Designed with speed and efficiency in mind. Quiver makes sure you can access your data as quickly as possible.
- **Secure**: Your data is stored securely in the cloud and is always under your control.
2023-05-13 03:27:12 +03:00
- **Compatible Files**:
- **Text**
- **Markdown**
- **PDF**
- **Audio**
- **Video**
- **Open Source**: Quiver is open source and free to use.
2023-05-13 03:16:41 +03:00
## Demo
2023-05-13 20:56:54 +03:00
https://github.com/StanGirard/quiver/assets/19614572/a3cddc6a-ca28-44ad-9ede-3122fa918b51
2023-05-13 03:16:41 +03:00
2023-05-13 03:02:45 +03:00
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
What things you need to install the software and how to install them.
2023-05-13 03:13:56 +03:00
- Python 3.10 or higher
2023-05-13 03:02:45 +03:00
- Pip
- Virtualenv
- Supabase account
- Supabase API key
- Supabase URL
### Installing
2023-05-13 03:13:56 +03:00
- Clone the repository
2023-05-13 03:02:45 +03:00
2023-05-13 03:13:56 +03:00
```bash
2023-05-13 17:37:18 +03:00
git clone git@github.com:StanGirard/quiver.git & cd quiver
2023-05-13 03:13:56 +03:00
```
2023-05-13 03:02:45 +03:00
2023-05-13 03:13:56 +03:00
- Create a virtual environment
```bash
virtualenv venv
```
- Activate the virtual environment
```bash
source venv/bin/activate
```
- Install the dependencies
```bash
pip install -r requirements.txt
```
2023-05-13 18:28:09 +03:00
- Copy the streamlit secrets.toml example file
2023-05-13 03:13:56 +03:00
```bash
2023-05-13 18:28:09 +03:00
cp .streamlit/secrets.toml.example .streamlit/secrets.toml
2023-05-13 03:13:56 +03:00
```
2023-05-13 18:28:09 +03:00
- Add your credentials to .streamlit/secrets.toml file
2023-05-13 03:13:56 +03:00
```toml
supabase_url = "SUPABASE_URL"
supabase_service_key = "SUPABASE_SERVICE_KEY"
openai_api_key = "OPENAI_API_KEY"
```
2023-05-13 17:37:18 +03:00
- Run the migration script on the Supabase database via the web interface
2023-05-13 03:13:56 +03:00
```sql
-- Enable the pgvector extension to work with embedding vectors
create extension vector;
-- Create a table to store your documents
create table documents (
id bigserial primary key,
content text, -- corresponds to Document.pageContent
metadata jsonb, -- corresponds to Document.metadata
embedding vector(1536) -- 1536 works for OpenAI embeddings, change if needed
);
CREATE FUNCTION match_documents(query_embedding vector(1536), match_count int)
RETURNS TABLE(
id bigint,
content text,
metadata jsonb,
-- we return matched vectors to enable maximal marginal relevance searches
embedding vector(1536),
similarity float)
LANGUAGE plpgsql
AS $$
# variable_conflict use_column
BEGIN
RETURN query
SELECT
id,
content,
metadata,
embedding,
1 -(documents.embedding <=> query_embedding) AS similarity
FROM
documents
ORDER BY
documents.embedding <=> query_embedding
LIMIT match_count;
END;
$$;
```
- Run the app
```bash
streamlit run main.py
```
2023-05-13 03:02:45 +03:00
## Built With
* [Python](https://www.python.org/) - The programming language used.
* [Streamlit](https://streamlit.io/) - The web framework used.
* [Supabase](https://supabase.io/) - The open source Firebase alternative.
2023-05-13 03:13:56 +03:00
## Contributing
Open a pull request and we'll review it as soon as possible.