Coder Social home page Coder Social logo

llm-answer-engine's Introduction

Perplexity Inspired LLM Answer Engine

This repository contains the code and instructions needed to build a sophisticated answer engine that leverages the capabilities of Groq, Mixtral, Langchain.JS, Brave Search, and OpenAI. Designed to efficiently return sources, answers, and follow-up questions based on user queries, this project is an ideal starting point for developers interested in natural language processing and search technologies.

YouTube Tutorial

Build a Perplexity-Inspired Answer Engine Using Groq, Mixtral, Langchain, Brave & OpenAI in 10 Min

Watch the tutorial here for a detailed guide on setting up and running this project. The video covers every step of the process, from API key acquisition to server deployment.

Technologies Used

  • Express.js: A web application framework for Node.js, used to create server-side applications.
  • Body-Parser: A middleware for Express.js, it's used to parse incoming request bodies before your handlers.
  • Groq & Mixtral: Technologies for processing and understanding user queries.
  • Langchain.JS: A JavaScript library focused on text operations, such as text splitting and embeddings.
  • Brave Search: A privacy-focused search engine used for sourcing relevant content.
  • OpenAI: Leveraged for generating coherent and contextually relevant answers and follow-up questions.
  • Cheerio: Utilized for HTML parsing, allowing the extraction of content from web pages.

Getting Started

Prerequisites

  • Ensure Node.js and npm are installed on your machine.
  • Obtain API keys from Groq, OpenAI, and Brave Search.

Obtaining API Keys

Installation

  1. Clone the repository: git clone https://github.com/developersdigest/llm-answer-engine
  2. Install the required dependencies: npm install or bun install
  3. Create a .env file in the root of your project and add your API keys:
    GROQ_API_KEY=<your_groq_api_key>
    BRAVE_SEARCH_API_KEY=<your_brave_search_api_key>
    OPENAI_API_KEY=<your_openai_api_key>
    

Running the Server

To start the server, execute: npm start The server will be listening on port 3005.

Usage

Make a POST request to localhost:3005 with a JSON body containing your query and the desired parameters:

{
  "message": "Tell me the Anthropic's Claude 3",
  "returnSources": true,
  "returnFollowUpQuestions": true,
  "embedSourcesInLLMResponse": false,
  "textChunkSize": 800,
  "textChunkOverlap": 200,
  "numberOfSimilarityResults": 2,
  "numberOfPagesToScan": 4
}

The engine will process your query and return a comprehensive answer along with sources and, if requested, follow-up questions.

Contributing

Contributions to the project are welcome. Feel free to fork the repository, make your changes, and submit a pull request. You can also open issues to suggest improvements or report bugs.

License

This project is licensed under the MIT License - see the LICENSE file for more details.

I'm the developer behind Developers Digest. If you find my work helpful or enjoy what I do, consider supporting me. Here are a few ways you can do that:

llm-answer-engine's People

Contributors

developersdigest 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.