Coder Social home page Coder Social logo

michael-d-anderson / embedbase Goto Github PK

View Code? Open in Web Editor NEW

This project forked from different-ai/embedbase

0.0 0.0 0.0 11.14 MB

Hook LLMs to your data

Home Page: https://docs.embedbase.xyz

License: MIT License

Shell 0.04% JavaScript 1.02% Python 30.20% TypeScript 55.80% CSS 1.35% Makefile 1.19% PLpgSQL 0.17% Jupyter Notebook 8.35% Dockerfile 0.14% Solidity 1.75%

embedbase's Introduction


embedbasevector

Embedbase

Seamless data connections to LLMs


Discord PyPI
Deploy to Render
Open In Colab

Open-source API & SDK to sync your data and easily hook them up to LLMs

Used by AVA and serving 100k request a day


Check out the docs for more info.

Table of Contents

The 3 ways to use Embedbase

  • Embedbase Cloud: Build embeddings-powered apps in minutes | npm i embedbase-js | ⏱️ 3min
  • Embedbase.py: Choose your own db, embeddings models, and get started with a simple | pip install embedbase | ⏱️ 5 min
  • Embedbase self-hosted: Get Embedbase Cloud on your infra | docker-compose up | ⏱️ 15 min

What are people building

Getting started

Let's install Python dependencies:

pip install embedbase sentence-transformers

Run a local-first instance of Embedbase:

embedbase run

pika-1681921124330-1x

🔥 Embedbase now runs! Look here to see how to use the sdk

ℹ️ Look at the code you just ran here, feel free to modify it to your needs.

Managed Instance

The fastest way to get started with Embedbase is signing up for free to Embedbase Cloud.

Dashboard Screenshot

How to use

SDK

npm i embedbase-js

import { createClient } from 'embedbase-js'

const question = 'What can I do with Embedbase API?'

const embedbase = createClient(
  'https://api.embedbase.xyz',
  'api-key')

const context = await embedbase
.dataset('embedbase-docs')
.createContext('What can I do with Embedbase API?', { limit: 3 });

console.log(context) 
[
  "Embedbase API allows to store unstructured data...",
  "Embedbase API has 3 main functions a) provides a plug and play solution to store embeddings b) makes it easy to connect to get the right data into llms c)..",
  "Embedabase API is self-hostable...",
]

// refer to https://github.com/openai/openai-node for the exact api
openai.createCompletion(
  `Write a response to question: ${question} 
  based on the follwing context ${context.toString()}`
)
// answer:
// You can use the Embedbase API to store unstructured data and then use the data to connect it to LLMs

Inserting data

const URL = 'http://localhost:8000'
const VAULT_ID = 'people'
// if using the hosted version
const API_KEY = '<https://app.embedbase.xyz/signup>'
fetch(`${URL}/v1/${VAULT_ID}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      // if using the hosted version, uncomment
      // 'Authorization': `Bearer ${API_KEY}`
    },
    body: JSON.stringify({
      documents: [{
        data: 'Elon is sipping a tea on Mars',
      }],
    }),
  });

Searching

fetch(`${URL}/v1/${VAULT_ID}/search`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      // 'Authorization': `Bearer ${API_KEY}`
    },
    body: JSON.stringify({
      query: 'Something about a red planet',
    }),
  });

Result:

{
  "query": "Something about a red planet",
  "similarities": [
    {
      "score": 0.828773,
      "id": "ABCU75FEBE",
      "data": "Elon is sipping a tea on Mars",
    }
  ]
}

Docs and support

Check out our tutorials for step-by-step guides, how-to's, and best practices, our documentation is powered by GPT-4, so you can ask question directly.

Ask a question in our Discord community to get support.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

embedbase's People

Contributors

louis030195 avatar ashgansh avatar dependabot[bot] avatar skyyap avatar stanbar 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.