Skip to main content

Moorcheh

Moorcheh is a lightning-fast semantic search engine and vector store. Instead of using simple distance metrics like L2 or Cosine, Moorcheh uses Maximally Informative Binarization (MIB) and Information-Theoretic Score (ITS) to retrieve accurate document chunks. The following tutorial will allow you to use Moorcheh and LangChain to upload and store text documents and vector embeddings as well as retrieve relevant chunks for all of your queries.

Setup

First, install the necessary package:

Initialization

Get started with Moorcheh
  1. Sign up or log in at the Moorcheh Console.
  2. Go to the “API Keys” tab and generate an API key.
  3. Save the key as an environment variable named MOORCHEH_API_KEY (you’ll use it below).
  4. To create a namespace for storing data:
    • In the Console, open the “Namespaces” tab and click “Create namespace”; or
    • Initialize it programmatically using the vector store code in the next section.
  5. Use your API key to create namespaces, upload documents, and retrieve answers.
For more information about the Moorcheh SDK functions, see the GitHub repository.

Importing packages

Import the below packages:

Code setup

Set your Moorcheh API Key in your environment variables:
Set up your namespace name, type, and create the vector store:

Adding documents

Delete documents

Query engine

Once your namespace has been created and you have uploaded documents into it, you can ask queries about the documents directly through the vector store. Set the query and LLM you would like to answer your query. For more information on supported LLMs, please visit our GitHub page.

Further resources

For more information about Moorcheh, feel free to visit the resources below: