Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wilsonsilva/learning-vector-embeddings
Pet project to practice AI-related technologies
https://github.com/wilsonsilva/learning-vector-embeddings
ai astradb cassandra huggingface langchain llm openai python python3
Last synced: about 2 months ago
JSON representation
Pet project to practice AI-related technologies
- Host: GitHub
- URL: https://github.com/wilsonsilva/learning-vector-embeddings
- Owner: wilsonsilva
- Created: 2023-10-28T06:36:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-28T06:36:41.000Z (over 1 year ago)
- Last Synced: 2024-12-17T02:39:15.667Z (about 2 months ago)
- Topics: ai, astradb, cassandra, huggingface, langchain, llm, openai, python, python3
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vector Embeddings + LangChain Test
## Introduction
A question and answer system that uses vector embeddings to find the most similar question to the user's input.
The system is built using the [LangChain](https://python.langchain.com/docs/integrations/toolkits/python) library.The embeddings are stored in an AstraDB Vector database.
## Setup
1. Create an account in OpenAPI and get the API key.
2. Create a vector database in Datastax and get the connection details
3. Download the database's Secure Connect Bundle and place it in the root of the project.
4. Setup the environment variables in `main.py`
5. Install the dependencies:```bash
pip install -r requirements.txt
```6. Run the program:
```bash
python main.py
```## Usage
```txt
Loading data from huggingfaceGenerating embeddings and storing in AstraDB
Inserted 50 headlines.
Enter your question (or type 'quit' to exit): What is an amoeba?
QUESTION: "What is an amoeba?"
ANSWER: "An amoeba is a single-celled organism."
DOCUMENTS BY RELEVANCE
0.9274 "Biologists Torture Amoeba For Information On Where Life Came ..."
0.9274 "Biologists Torture Amoeba For Information On Where Life Came ..."
0.9274 "Biologists Torture Amoeba For Information On Where Life Came ..."
0.9274 "Biologists Torture Amoeba For Information On Where Life Came ..."What's your next question (or type 'quit' to exit): quit
Process finished with exit code 0
```