Giter Club home page Giter Club logo

mongo-vector-embeddings-helsinki-python-meetup-demo's Introduction

Vector Embeddings Demo

A starter kit for embeddings creation and vector search with Python and MongoDB.

Getting started

  • Clone this repository
  • Requirements:
  • Create a virtual environment and install the dependencies
poetry install
  • Activate the virtual environment
poetry shell

For embeddings creation and vector search you will also need the following env variables:

  • OPENAI_API_KEY:
  • MONGO_DEMO_URI:
    • A MongoDB connection string in the following format:
      mongodb+srv://username:[email protected]/database?retryWrites=true&w=majority
      (you might also need to add &tls=true&tlsAllowInvalidCertificates=true)

Getting and storing embeddings

Use the command make create_and_store_embeddings items_path=<path_to_file> to create and store embeddings for the demo data that is provided. Use items/demo_items.csv as items_path if you want to compute the embeddings from the provided dataset. Note that this option takes several hours to run, and you will be charged according to OpenAI's pricing. There is also a smaller dataset with precomputed embeddings. Use items/demo_items_with_embeddings.csv if you only want to store those to your database.

Creating indexes

You can find the commands for creating the necessary indexes in the mongo.ipynb file.

Trying it out

demo.ipynb contains several commands for performing and visualizing vector search. Note that using the get_text_embedding function uses the OpenAI API and is not free.

mongo-vector-embeddings-helsinki-python-meetup-demo's People

Contributors

matiasjokela avatar

Stargazers

 avatar  avatar

Watchers

 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.