Skip to content

Klaus-in-Tech/rag-app-with-pinecone-and-llama3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intro to Vector Databases with LangChain and Pinecone

This project demonstrates how to use vector databases with LangChain and Pinecone for document retrieval and question answering. It includes scripts for ingesting documents into a Pinecone vector store and retrieving information using LangChain.

Prerequisites

Setup

  1. Clone the repository:

    git clone https://github.com/Klaus-in-Tech/rag-app-with-pinecone-and-llama3
  2. Install the required packages:

    pip install -r requirements.txt
  3. Create a .env file in the root directory and add your Pinecone and LangChain API keys:

    PINECONE_API_KEY=<your-pinecone-api-key>
    PINECONE_INDEX_NAME=<your-pinecone-index-name>
    LANGCHAIN_API_KEY=<your-langchain-api-key>

Ingesting Documents

To ingest documents into the Pinecone vector store, run the ingestion.py script. This script reads a text file, splits it into chunks, and stores the chunks as vectors in Pinecone.

python ingestion.py

Retrieving Information

To retrieve information from the Pinecone vector store, run the retrieval.py script. This script uses LangChain to query the vector store and return relevant information.

python retrieval.py

Example Document

The medium_blog.txt file contains an example document about vector databases. This file is used in the ingestion process.

Project Structure

  • ingestion.py: Script for ingesting documents into Pinecone.
  • retrieval.py: Script for retrieving information from Pinecone.
  • medium_blog.txt: Example document used for ingestion.
  • README.md: Project documentation.

License

This project is licensed under the MIT License.

About

Exploring pinecone with langchain framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages