Skip to main content

Search Engine for the AI Era

Combine keyword, semantic, and vector search in a single query. TopK delivers the most relevant results with record-low latency.

Quick Start

Get up and running with TopK in minutes

1

Install the SDK

Choose your preferred language and install the TopK SDK:
npm install topk-js
2

Get your API key

Sign up at console.topk.io and generate your API key. Initialize the client:
import { Client } from "topk-js"

const client = new Client({
  apiKey: "YOUR_TOPK_API_KEY",
  region: "aws-us-east-1-elastica"
});
3

Create your first collection

Define a schema and create a collection with semantic search enabled:
import { text, semanticIndex } from "topk-js/schema"

await client.collections().create("books", {
  title: text().required().index(semanticIndex()),
});
4

Run your first search

Add documents and perform a semantic search:
import { select, fn, field } from "topk-js/query"

// Add documents
await client.collection("books").upsert([
  { _id: "gatsby", title: "The Great Gatsby" },
  { _id: "1984", title: "1984" },
]);

// Search with semantic similarity
const results = await client.collection("books").query(
  select({
    title: field("title"),
    similarity: fn.semanticSimilarity("title", "classic American novel"),
  }).topk(field("similarity"), 10)
);

Key Features

Everything you need for modern search experiences

Semantic Search

Automatic embeddings and similarity search without managing vector models

Vector Search

Bring your own embeddings with support for multiple vector types and dimensions

Keyword Search

BM25 full-text search with relevance scoring and filtering

True Hybrid Search

Combine multiple search techniques in a single query for optimal results

Multi-Vector Search

Search across multiple vector representations simultaneously

Reranking

Built-in reranking to improve result quality

Explore the APIs

Comprehensive documentation for all TopK operations

Collections API

Create and manage collections with custom schemas

Documents API

Upsert, query, update, and delete documents

Query API

Powerful query language with filtering and ranking

SDK Reference

Complete API documentation for Python and JavaScript SDKs

Python SDK

Complete reference for the TopK Python SDK

JavaScript SDK

Complete reference for the TopK JavaScript SDK

Ready to get started?

Sign up for a free account and start building powerful search experiences in minutes.