Real-Time Universal Search Infra for Developers
Documentation โข Website
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
.
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)
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);
๐ 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.
A detailed overview of Retake's architecture can be found in our documentation.
For more information on how to contribute, please see our Contributing Guide.
Retake is Elastic License 2.0 licensed.