Giter VIP home page Giter VIP logo

hello-wordsmith's Introduction

Hello Wordsmith

This is the Hello Wordsmith package. This is a simple wrapper around the llama-index CLI project with some opinionated defaults. We aim to provide a "Hello World" experience using Retrieval-Augmented Generation (RAG). For more context on what RAG is, tradeoffs and, and a detailed walthrough of this project, see this The Pragmatic Engineer article.

For detailed information about the llamaindex-rag project, visit the official documentation.

Pre-requisites for usage

An active OpenAI subscription. Ensure you are registered with OpenAI, your billing details added and have an API key to use

Installation

Follow these steps to install and set up your environment:

Setup:

  1. pip install git+https://github.com/wordsmith-ai/hello-wordsmith -q
  2. export OPENAI_API_KEY="sk-..."

Note:
It's best practice to work in a virtual Python environment, as opposed to your system's default Python installation. Popular solutions include venv, conda, and pipenv. If you do use your system Python, make sure the bin dir is on your PATH, e.g. export PATH="/Library/Frameworks/Python.framework/Versions/3.x/bin:${PATH}

Use:

  1. hello-wordsmith // Launch an interactive chat.
  2. hello-wordsmith -q 'What is article III about?' // Single question and answer
  3. hello-wordsmith -f "./my_directory/*" --chunk-size 256 --chunk-overlap 128 // Ingest and index your own data to query with custom document chunk sizes and overlaps
  4. hello-wordsmith --clear // Clear stored data

Example installation and usage via venv

Using Python 3, on a Mac:

  1. python3 -m venv hello-wordsmith // Initialize the venv virtual environment folder
  2. cd hello-wordsmith
  3. source ./bin/activate // Launch the virtual environment
  4. pip install git+https://github.com/wordsmith-ai/hello-wordsmith -q // Install the hello-wordsmith package, suppressing output with the -q flag. Remove this flag to see install progress
  5. export OPENAI_API_KEY="sk-..." // Export your OpenAI key
  6. hello-wordsmith -q 'What is article III about?' // Send a single question, and wait for the answer to arrive using the RAG
  7. hello-wordsmith --chunk-size 256 --chunk-overlap 64 // Start the interactive assistant to ask questions and answers:
example

Explore:
As you can see, this repo is an extremely simplistic first step towards building a RAG system on your data. You can open up these files and explore how changing parameters like chunk size, or the embedding model that we use, can influence the performance of the system.

hello-wordsmith's People

Contributors

ross-mcnairn-dev avatar gergelyorosz avatar rmcnairn avatar igor-kupczynski 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.