Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moorcheh.ai/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The moorcheh-client package provides a Python SDK (MoorchehApiClient) for calling the Moorcheh on-prem API, plus the moorcheh CLI for starting the runtime and running the same operations from the shell. No API keys are required — the client talks directly to your local Moorcheh instance.

Package

PyPImoorcheh-client
Importfrom moorcheh import MoorchehApiClient, MoorchehApiError
CLImoorcheh (installed with the same package)
pip install moorcheh-client

Start the server

The Python client requires a running Moorcheh instance. Start it with the CLI:
moorcheh up
Default API base URL: http://localhost:8080 Use a different port if you started with moorcheh up --server-port 8081.

Client

from moorcheh import MoorchehApiClient

client = MoorchehApiClient("http://localhost:8080", timeout=30)
ArgumentDefaultDescription
base_urlMoorcheh API URL (trailing slash is stripped)
timeout30Request timeout in seconds
All methods return parsed JSON as a dict. HTTP failures raise MoorchehApiError.

Methods

GroupMethodDescription
Healthhealth()Server status and global item quota
Namespacescreate_namespace()Create a text or vector namespace
list_namespaces()List namespaces with item counts
delete_namespace()Delete a namespace (async)
delete_namespace_job_status()Poll namespace delete job
Dataupload_namespace_documents()Upload text documents (async)
upload_namespace_vectors()Upload precomputed vectors (async)
upload_job_status()Poll upload job
Itemsget_namespace_items()Get items by id
delete_namespace_items()Delete items by id
Searchsearch()Semantic search (text or vector query)

Errors

Non-2xx HTTP responses raise MoorchehApiError with:
  • status_code — HTTP status (for example 400, 404, 409)
  • body — parsed JSON error body when available
  • is_item_limit_exceededTrue for 409 quota errors on uploads
from moorcheh import MoorchehApiError

try:
    client.upload_namespace_documents("docs", {"documents": [...]})
except MoorchehApiError as e:
    if e.is_item_limit_exceeded:
        print(e.body)  # items, max_items, requested_new
    else:
        print(e.status_code, e.body)
Search validation errors return HTTP 400 with "status": "error" in the body (not "failure").

Data location

moorcheh up persists data under ~/.moorcheh/data. moorcheh down stops containers but keeps your data.

Next steps