Git Product home page Git Product logo

repo-ai's Introduction

repo-ai

Ask questions about GitHub repositories using Langchain for Node.js. This is a database free example of using Langchain to work with the OpenAI GPT API.

Setup

Create a .env file with your credentials or set them up as environment variables:

OPENAI_API_KEY=
GITHUB_TOKEN=

CLI

You can run the code in this repo via the CLI by leveraging the -cli suffixed files.

1. Generate embeddings

To generate the embeddings, run npx ts-node generate-cli.ts "https://github.com/Vheissu/cortex-device-list" which will populate local vector embeddings. Make sure you change to the repository you want to create embeddings for.

2. Search

After you've created embeddings, you can run npx ts-node search-cli.ts "My question here" to ask your question about the repository.

Frontend

There is also a simple front-end application in the frontend which will allow you to use a simple interface to query your repo. Please ensure you run the local server first before you attempt to ask a question: npx ts-node server.ts which will run on port 3000.

Also, don't forget to generate your embeddings first. The server will look for a vectors folder which will contain the generate vectors to do cosine similarity search.

To run the front-end app, go into the frontend directory and npm start (assuming you also ran npm install too) and the browser will open the app.

repo-ai's People

Contributors

vheissu avatar

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.