Moorcheh- Universal Memory Layer Operations
This skill provides comprehensive access to the Moorcheh platform including namespace management, data operations, semantic search with ITS scoring, and AI-powered answer generation.
Moorcheh Account
If the user does not have an account yet, direct them to the console to register and create a free account.
Create a Moorcheh account at console.moorcheh.ai.
Environment Variables
export MOORCHEH_API_KEY="your-api-key-here"
For full environment setup, see Environment Requirements.
Script Index
Namespace Management
- Create Namespace: Use to create a new text or vector namespace for organizing data. Text namespaces handle automatic embedding; vector namespaces require pre-computed embeddings.
- List Namespaces: Use to discover what namespaces exist in the account. This should be the first step before any operation.
- Delete Namespace: Use to permanently remove a namespace and all its data. This action is irreversible.
Data Operations
- Upload Text Data: Use to upload text documents with metadata to a text namespace. Documents are automatically embedded and indexed for semantic search.
- Get Documents: Use to fetch indexed text documents by ID (up to 100 IDs per call). For listing chunks without IDs, use Fetch Text Data; for similarity search, use Search.
- Upload File: Use to upload files (PDF, DOCX, XLSX, TXT, MD, CSV, JSON) to a text namespace via the pre-signed S3 URL flow (up to 5GB), or use
documents.upload_file in the SDK which performs that flow for you. Prefer this over Upload Text when the user has a file on disk- no manual extraction or huge JSON payloads.
- List Files: Use to list raw file objects in document storage (S3) for a namespace (
file_name, size, last_modified). Not the same as indexed text chunks- use Fetch Text Data or Search for pipeline-backed content.
- Delete Files: Use to delete storage file objects by name (S3-backed uploads). Not the same as Delete Data (remove indexed documents/vectors by ID).
- Upload Vectors: Use to upload pre-computed vector embeddings to a vector namespace. Best when you have your own embedding pipeline.
- Fetch Text Data: Use to list text and summary chunks in a text namespace (up to 100 per call) for export, UI, or inspection. Not a semantic search- use Search for queries.
- Delete Data: Use to remove specific documents or vectors from a namespace.
- Create Example Data: Use to create sample data for demos and testing when no data is available.
Search & AI
- Semantic Search: Primary search operation. Performs semantic search across one or more namespaces using ITS scoring. Supports text queries, metadata filters, keyword filters, and relevance thresholds.
- Generate AI Answer: Use to generate AI-powered answers from your data (RAG). Searches relevant context and synthesizes a natural-language answer. Supports chat history, custom prompts, and structured output.
Recommendations
- Always run List Namespaces first to discover available data before searching or uploading.
- For text data, prefer text namespaces- Moorcheh handles embedding automatically.
- Use ITS scoring thresholds (0.0–1.0) to control result quality. Higher = stricter matching.
- The Generate Answer endpoint is the primary RAG capability- use it for Q&A over documents.
Output Formats
- Search results include
id, score, label (relevance category), text, and metadata.
- AI answers include
answer, model, context_count, and optional structured_data (plus used_context when structured output is enabled).
Error Handling
401 Unauthorized: Verify MOORCHEH_API_KEY is set and valid
404 Namespace not found: Create the namespace first or check spelling (case-sensitive)
400 Vector dimension mismatch: Ensure vectors match the namespace's configured dimension
429 Too Many Requests: Implement exponential backoff
Code Generation Rules
Follow these rules when generating Python code that uses the Moorcheh SDK:
No Unicode Emoji in Output
Do not use emoji characters (e.g. ✅ ❌ 📁 ⏳ 🎉) in print() statements or log messages. On Windows with cp1252 encoding, these cause UnicodeEncodeError and mask actual success/failure output. Use plain ASCII prefixes instead:
| Instead of |
Use |
✅ Success |
[OK] Success |
❌ Error |
[ERROR] Error |
⏳ Waiting |
[WAIT] Waiting |
📁 folder |
- folder |
Use snake_case (REST and Python)
As of platform 1.5.10, Moorcheh accepts and returns snake_case only for the answer API (and related JSON). Legacy camelCase field names were removed. Use the same names in curl, TypeScript/Java backends, and Python (moorcheh_sdk kwargs match JSON keys).
Common fields: ai_model, chat_history, header_prompt, footer_prompt, structured_response, kiosk_mode, top_k, context_count, structured_data, follow_up_questions (inside structured_data when using the default schema).
Do not send camelCase; validation may reject the request.
1---2name: moorcheh3description: Use this skill to interact with Moorcheh, the Universal Memory Layer for Agentic AI. Provides semantic search with ITS (Information-Theoretic Scoring), namespace management, text and vector data operations, and AI-powered answer generation (RAG). Use when building applications that need semantic search, knowledge bases, document Q&A, AI memory systems, or retrieval-augmented generation.4---56# Moorcheh- Universal Memory Layer Operations78This skill provides comprehensive access to the Moorcheh platform including namespace management, data operations, semantic search with ITS scoring, and AI-powered answer generation.910## Moorcheh Account1112If the user does not have an account yet, direct them to the console to register and create a free account.1314Create a Moorcheh account at [console.moorcheh.ai](https://console.moorcheh.ai).1516## Environment Variables1718```bash19export MOORCHEH_API_KEY="your-api-key-here"20```2122For full environment setup, see [Environment Requirements](references/environment_requirements.md).2324## Script Index2526### Namespace Management2728- [Create Namespace](references/create_namespace.md): Use to **create a new text or vector namespace** for organizing data. Text namespaces handle automatic embedding; vector namespaces require pre-computed embeddings.29- [List Namespaces](references/list_namespaces.md): Use to **discover what namespaces exist** in the account. This should be the first step before any operation.30- [Delete Namespace](references/delete_namespace.md): Use to **permanently remove a namespace** and all its data. This action is irreversible.3132### Data Operations3334- [Upload Text Data](references/upload_text.md): Use to **upload text documents with metadata** to a text namespace. Documents are automatically embedded and indexed for semantic search.35- [Get Documents](references/get_documents.md): Use to **fetch indexed text documents by ID** (up to 100 IDs per call). For listing chunks without IDs, use Fetch Text Data; for similarity search, use Search.36- [Upload File](references/upload_file.md): Use to **upload files** (PDF, DOCX, XLSX, TXT, MD, CSV, JSON) to a text namespace via the **pre-signed S3 URL** flow (up to **5GB**), or use **`documents.upload_file`** in the SDK which performs that flow for you. **Prefer this over Upload Text when the user has a file on disk**- no manual extraction or huge JSON payloads.37- [List Files](references/list_files.md): Use to **list raw file objects** in document storage (S3) for a namespace (`file_name`, `size`, `last_modified`). Not the same as indexed text chunks- use **Fetch Text Data** or **Search** for pipeline-backed content.38- [Delete Files](references/delete_files.md): Use to **delete storage file objects by name** (S3-backed uploads). Not the same as **Delete Data** (remove indexed documents/vectors by ID).39- [Upload Vectors](references/upload_vectors.md): Use to **upload pre-computed vector embeddings** to a vector namespace. Best when you have your own embedding pipeline.40- [Fetch Text Data](references/fetch_text_data.md): Use to **list text and summary chunks** in a text namespace (up to 100 per call) for export, UI, or inspection. Not a semantic search- use Search for queries.41- [Delete Data](references/delete_data.md): Use to **remove specific documents or vectors** from a namespace.42- [Create Example Data](references/example_data.md): Use to **create sample data for demos and testing** when no data is available.4344### Search & AI4546- [Semantic Search](references/search.md): **Primary search operation.** Performs semantic search across one or more namespaces using ITS scoring. Supports text queries, metadata filters, keyword filters, and relevance thresholds.47- [Generate AI Answer](references/generate_answer.md): Use to **generate AI-powered answers from your data (RAG)**. Searches relevant context and synthesizes a natural-language answer. Supports chat history, custom prompts, and structured output.4849## Recommendations5051- Always run **List Namespaces** first to discover available data before searching or uploading.52- For text data, prefer **text namespaces**- Moorcheh handles embedding automatically.53- Use **ITS scoring thresholds** (0.0–1.0) to control result quality. Higher = stricter matching.54- The **Generate Answer** endpoint is the primary RAG capability- use it for Q&A over documents.5556## Output Formats5758- Search results include `id`, `score`, `label` (relevance category), `text`, and `metadata`.59- AI answers include `answer`, `model`, `context_count`, and optional `structured_data` (plus `used_context` when structured output is enabled).6061## Error Handling6263- `401 Unauthorized`: Verify `MOORCHEH_API_KEY` is set and valid64- `404 Namespace not found`: Create the namespace first or check spelling (case-sensitive)65- `400 Vector dimension mismatch`: Ensure vectors match the namespace's configured dimension66- `429 Too Many Requests`: Implement exponential backoff6768## Code Generation Rules6970Follow these rules when generating Python code that uses the Moorcheh SDK:7172### No Unicode Emoji in Output7374Do **not** use emoji characters (e.g. ✅ ❌ 📁 ⏳ 🎉) in `print()` statements or log messages. On Windows with cp1252 encoding, these cause `UnicodeEncodeError` and mask actual success/failure output. Use plain ASCII prefixes instead:7576| Instead of | Use |77|---|---|78| `✅ Success` | `[OK] Success` |79| `❌ Error` | `[ERROR] Error` |80| `⏳ Waiting` | `[WAIT] Waiting` |81| `📁 folder` | `- folder` |8283### Use snake_case (REST and Python)8485As of **platform 1.5.10**, Moorcheh accepts and returns **snake_case** only for the answer API (and related JSON). Legacy camelCase field names were removed. Use the same names in curl, TypeScript/Java backends, and Python (`moorcheh_sdk` kwargs match JSON keys).8687Common fields: `ai_model`, `chat_history`, `header_prompt`, `footer_prompt`, `structured_response`, `kiosk_mode`, `top_k`, `context_count`, `structured_data`, `follow_up_questions` (inside `structured_data` when using the default schema).8889Do not send camelCase; validation may reject the request.