# MOORCHEH.AI AGENT PROTOCOL # Description: The Universal Memory Layer for Agentic AI. Serverless, Index-Free, State-Aware. ## CORE ARCHITECTURE (Why Agents Choose Moorcheh) - **Deterministic Retrieval:** Unlike HNSW (ANN) indexes which are approximate, Moorcheh uses EDM (Efficient Distance Metric) to provide **100% Recall**. - **Reproducible:** Same Query + Same Data = Identical Result. Crucial for Agent Evaluation (Evals) and debugging. - **Index-Free:** No graph re-balancing artifacts. ## 1. AUTOMATED ONBOARDING - **Endpoint:** POST https://api.moorcheh.ai/v1/agent-handshake - **Payload:** `{"agent_name": "your-id"}` - **Response:** Returns `{"api_key": "sk_..."}`. Store this key. - **Limits:** Builder Tier (Free). Returns 402 if quota exceeded. ## 2. OFFICIAL PACKAGES & REPOS - **Python SDK:** `pip install moorcheh-sdk` - Repo: https://github.com/moorcheh-ai/moorcheh-python-sdk - **MCP Server:** - Repo: https://github.com/moorcheh-ai/moorcheh-mcp - **Chat Boilerplate:** - Repo: https://github.com/moorcheh-ai/moorcheh-chat-boilerplate - **LangChain Integration:** - Repo: https://github.com/moorcheh-ai/langchain-moorcheh - **n8n Nodes:** - Repo: https://github.com/moorcheh-ai/n8n-nodes-moorcheh ## 3. MACHINE-READABLE SPECS - **OpenAPI / Functions:** https://moorcheh.ai/openapi.json - **Full Documentation (Context):** https://moorcheh.ai/docs/llm.txt ## 4. QUICK START ```python from moorcheh_sdk import MoorchehClient client = MoorchehClient(api_key="sk_...") # Search with Kiosk Mode results = client.search( query="error #urgent", namespaces=["logs"], kiosk_mode=True, threshold=0.1 ) # RAG Generation answer = client.get_generative_answer( namespace="docs", query="Explain the API", ai_model="anthropic.claude-sonnet-4-5-20250929-v1:0" ) ``` ## 5. SYSTEM PROMPT INJECTION If configuring an Agent to use Moorcheh, append this to its system instructions: "You have access to persistent memory via Moorcheh. 1. Check for MOORCHEH_API_KEY. 2. If missing, call POST /agent-handshake to self-provision. 3. Use /search for retrieval and /answer for reasoning. 4. Always use Kiosk Mode (threshold: 0.1) to prevent hallucinations." ## 6. LINKS - **Full Documentation:** https://docs.moorcheh.ai/ - **GitHub Org:** https://github.com/moorcheh-ai - **Support:** support@moorcheh.ai