Giter VIP home page Giter VIP logo

jaxnodelangchain's Introduction

JaxNode Langchain Demo

Create a empty folder in your home directory.

$ cd ~/
$ mkdir pgvector

Now that you have added a folder to your home directory for persisting your database. Now we can run a docker command to start a vector store for our RAG application.

$ docker run -d --name pgvector -e POSTGRES_PASSWORD=password -v ${HOME}/pgvector/:/var/lib/postgresql/data -p 5432:5432 pgvector/pgvector:pg16

Now that we have started a database server on our computer with Docker, we can log into the running container to create a database that we can use to store our vectors.

$ docker exec -it pgvector psql -U postgres
$ create database jaxnodevector;
# DATABASE CREATED
$ CREATE EXTENSION IF NOT EXISTS vector;
# EXTENSION vector CREATED
\q

The first line creates an interactive terminal on our container, and uses the psql command line application for us to interact with the postgres system database. On the second line we create a database called jaxnodevector.

On the last line we use the \q command to exit out of the psql program.

Create a table to store our vectors

Now that we have a postgres database with the PGVector extension, we can create a table to store our vectors. I have created a script you can use to do this in this example. Run the following script with Node.js or the JavaScript engine of your choice.

$ npm run pgvector:setup

This script will connect to your

Ollama

Now we can install Ollama locally. Go to Ollama.ai to download Ollama or install using docker.

$ docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
$ docker exec -it ollama ollama run llama2

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.