GithubHelp home page GithubHelp logo

harshithmullapudi / retake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paradedb/paradedb

1.0 0.0 1.0 1.31 MB

Real-Time Universal Search Infra for Developers

Home Page: https://getretake.com

License: Other

JavaScript 1.55% Python 72.80% TypeScript 24.50% Dockerfile 1.15%

retake's Introduction

Retake

Retake

Real-Time Universal Search Infra for Developers

Stars Release License

Retake is the fastest way to implement universal search in your app.

Built to stay in sync with fast-changing databases, Retake abstracts away the complexity of search by acting as a search layer around Postgres. Retake also provides simple search SDKs that snap into any Python or Typescript application.

You don't need to worry about managing separate vector stores and text search engines, uploading and embedding documents, or reindexing data. Just write search queries and let Retake handle the rest.

To get started, simply download the docker compose file and run:

docker compose up

By default, this will start the Retake engine at http://localhost:8000 with API key retake-test-key.

Usage

Python

Install the SDK

pip install retakesearch

The core API is just a few functions.

from retakesearch import Client, Index, Database, Table, Search

client = Client(api_key="retake-test-key", url="http://localhost:8000")

database = Database(
    host="***",
    user="***",
    password="***",
    port=5432
    dbname="***"
)

columns = ["column1"]
table = Table(
    name="table_name",
    columns=columns
)

index = client.create_index("my_index")
# Note: The table must have a primary key
index.add_source(database, table)

index.vectorize(columns)

# Keyword (BM25) search
query = Search().query("match", column1="my query")
response = index.search(query)

# Semantic (vector-based) search
query = Search().with_semantic("my_query", columns)
response = index.search(query)

# Neural (keyword + semantic) search
query = Search().with_neural("my_query", columns)
response = index.search(query)

print(response)

Typescript

Install the SDK

npm install retake-search

The core API is just a few functions.

import { Client, Database, Table, Search } from "retake-search";
import { withSemantic, withNeural, matchQuery } from "retake-search/helpers";

const client = new Client("retake-test-key", "http://localhost:8000");

// Replace with your database credentials
const columns = ["column_to_search"];
const database = new Database({
  host: "***",
  user: "***",
  password: "***",
  dbName: "***",
  port: 5432,
});
const table = new Table({
  table: "table_name",
  columns: columns,
});

const index = client.create_index("table_name");

// Note: The table must have a primary key
index.addSource(database, table);
index.vectorize(columns);

// Keyword (BM25) search
const bm25Query = Search().query(matchQuery("column_to_search", "my query"));
index.search(bm25Query);

// Semantic (vector-based) search
const semanticQuery = Search().query(withSemantic("my query", columns));
index.search(semanticQuery);

// Neural (keyword + semantic) search
const neuralQuery = Search().query(withNeural("my query", columns));
index.search(neuralQuery);

Key Features

๐Ÿ”„ Always in Sync

Retake leverages logical-replication-based Change-Data-Capture (CDC) to integrate directly with Postgres. As data changes or new data arrives, Retake ensures that the indexed data is kept in sync.

๐Ÿง  Intelligent Vector Cache

Whenever data is changed in Postgres, Retake also updates the embedding/vector representation of that data behind the scenes. Vectors are automatically cached for lightning-fast query results with semantic understanding.

๐Ÿš€ Low-Code SDK

Retake provides intuitive search SDKs that drop into any Python or Typescript application (other languages coming soon). The core API is just a few functions.

โšก Open/ElasticSearch DSL Compatible

Retake enables developers to query with the full expressiveness of the OpenSearch DSL (domain-specific language).

๐ŸŒ Deployable Anywhere

Retake is deployable anywhere, from a laptop to a distributed cloud system.

How Retake Works

A detailed overview of Retake's architecture can be found in our documentation.

Contributing

For more information on how to contribute, please see our Contributing Guide.

License

Retake is Elastic License 2.0 licensed.

retake's People

Contributors

rebasedming avatar philippemnoel avatar mauaraujo avatar

Stargazers

Sourcery AI avatar

Forkers

sourcery-ai-bot

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.