Skip to main content

SemanticSearch

//ellmental/com.theagilemonkeys.ellmental.semanticsearch/SemanticSearch

SemanticSearch

class SemanticSearch

Semantic Search

The Semantic Search component allows you to index and search for semantically similar texts. Under the hoods, it uses the Embeddings Model and the Vector Store modules.

Constructors

SemanticSearch[jvm]
constructor()

Functions

NameSummary
learn[jvm]
suspend fun learn(input: LearnInput)
"Learns" a list of texts to make them available in future semantic searches. It uses the EmbeddingsModel to calculate text embeddings for each piece of text. Then it uses the VectorStore to persist them.
search[jvm]
suspend fun search(text: String, itemsLimit: Int): SearchOutput
Performs a semantic search operation using the provided text as reference. It will look for texts stored in the VectorStore that are "semantically close" to the provided one and return a ranked list of results.