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.

Install

pip install moorcheh-edge

Two ways to use the package

ApproachWhen to use
MoorchehEdge SDKStart Docker + call API from Python
MoorchehEdgeApiClientTalk to an already running server

SDK example

from moorcheh_edge import MoorchehEdge

with MoorchehEdge(port=8080) as client:
    print(client.health())
    client.upload([{"id": "a", "vector": [...]}])  # 1024 floats
    print(client.search(query=[...], top_k=5))

HTTP client example

from moorcheh_edge import MoorchehEdgeApiClient

client = MoorchehEdgeApiClient("http://localhost:8080")
print(client.health())
client.upload_vectors({"vectors": [{"item_id": "a", "vector": [...]}]})
print(client.search({"query": [...], "top_k": 5}))

Errors

Failed API calls raise MoorchehEdgeApiError with:
  • status_code
  • message
  • body — parsed JSON from the server when available
from moorcheh_edge import MoorchehEdgeApiError

try:
    client.upload_vectors({"vectors": [...]})
except MoorchehEdgeApiError as exc:
    if exc.is_item_limit_exceeded:
        print(exc.body)