{"_id":"@cubememory/sdk","_rev":"5-b9fae9049cbd4bc9b7a572933a39270c","name":"@cubememory/sdk","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@cubememory/sdk","version":"0.1.0","keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory"],"author":{"name":"Ronny Guerreiro"},"license":"MIT","_id":"@cubememory/sdk@0.1.0","maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"dist":{"shasum":"b018b1d37f8c8c74218997d173c7990f3b30de31","tarball":"https://registry.npmjs.org/@cubememory/sdk/-/sdk-0.1.0.tgz","fileCount":6,"integrity":"sha512-+yLHUGzUucLUWfPFAPUsvkTUntJ9pnOWIBdOZVOHSwnS0uc4aASha2pXGr+fHbJsCPDF4uIMujqmAVsRY2HTxQ==","signatures":[{"sig":"MEUCIA1R7ddEB/OEPZAFnT8DiHp8lO0FxQ5umQI9YaLPMiD0AiEAqhFMXJgcbQY61llDkkeni8NA2FWkzVo/R9oKXSDHi20=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23917},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"}},"scripts":{"build":"node build.js","prepublishOnly":"node build.js"},"_npmUser":{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"},"_npmVersion":"9.2.0","description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1780512324283_0.13041923906102437","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cubememory/sdk","version":"0.1.1","keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory","embedding","ai-memory","pkm","notes"],"author":{"name":"Ronny Guerreiro","email":"ynnor.guerreiro@gmail.com"},"license":"MIT","_id":"@cubememory/sdk@0.1.1","maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"homepage":"https://cubememory.com.br","bugs":{"url":"https://github.com/cubememory/sdk/issues"},"dist":{"shasum":"bf3f252941dc0512cb0a263866f0c13bbf27d998","tarball":"https://registry.npmjs.org/@cubememory/sdk/-/sdk-0.1.1.tgz","fileCount":7,"integrity":"sha512-lESRhmoipQPTkH3BbVtPMSeQPFnG9bQzqmCg2YkapAZpLK79FAac7sFuNC62JbNVjBDVhyHp2537pK0ipAz1hw==","signatures":[{"sig":"MEUCIGEAyShlLbb3/aPa+EPzpQSmhZ9WwJLlLhAUDOYbCadlAiEA90AV2AacitdCha+iS+vRhBoWuKBppqKmDR1ifPV1IAU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28692},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"}},"scripts":{"build":"node build.js","prepublishOnly":"node build.js"},"_npmUser":{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"},"repository":{"url":"git+https://github.com/cubememory/sdk.git","type":"git"},"_npmVersion":"9.2.0","description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1780512452398_0.7559171690665794","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@cubememory/sdk","version":"0.1.2","keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory","embedding","ai-memory","pkm","notes"],"author":{"name":"Ronny Guerreiro","email":"ynnor.guerreiro@gmail.com"},"license":"MIT","_id":"@cubememory/sdk@0.1.2","maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"homepage":"https://cubememory.com.br","bugs":{"url":"https://github.com/cubememory/sdk/issues"},"dist":{"shasum":"c6f648b77e12836325c305b98cea00ac39a6a75a","tarball":"https://registry.npmjs.org/@cubememory/sdk/-/sdk-0.1.2.tgz","fileCount":7,"integrity":"sha512-KBihf60JFd+4ZwdckTaSLePCQRJYFAO5HJQEOsEhhQn7PfeiccFzvUfxDqAfyrGQqQ5sFrLeBkLnsjyGp0PN6w==","signatures":[{"sig":"MEYCIQChCG+9ERJKTIp7wOuicsBM5biS0xgLsqurEfu+zuSN+wIhAKZwdemwMfdrxLshxlV2SRmJWeaQxSFsE0xSgUgNYn1v","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30798},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"}},"scripts":{"build":"node build.js","prepublishOnly":"node build.js"},"_npmUser":{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"},"repository":{"url":"git+https://github.com/cubememory/sdk.git","type":"git"},"_npmVersion":"9.2.0","description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.2_1780513894935_0.823874564592106","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@cubememory/sdk","version":"0.1.3","keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory","embedding","ai-memory","pkm","notes"],"author":{"name":"Cube Memory","email":"dev@cubememory.com.br"},"license":"MIT","_id":"@cubememory/sdk@0.1.3","maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"homepage":"https://cubememory.com.br","bugs":{"url":"https://github.com/cubememory/sdk/issues"},"dist":{"shasum":"0d60a8928735e51e64eab887051048a0770db830","tarball":"https://registry.npmjs.org/@cubememory/sdk/-/sdk-0.1.3.tgz","fileCount":7,"integrity":"sha512-eiht6FniEPqlloTcmujRVViixB+/0nX0CcOnnjEEo5unKopYjJpazG1gm2SuDPZMcXgvXbbMo+6JA9yKNShMzg==","signatures":[{"sig":"MEUCIGx+VVitThpx/M43O59D3IQopbLP8GvsgfpsapJsZYO6AiEA0wpnEZrqCBkZEfzCAk1a1LbEPWMihIFWptdWrP6FA9c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31384},"main":"dist/index.cjs.js","types":"dist/index.d.ts","module":"dist/index.esm.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.cjs.js"}},"scripts":{"build":"node build.js","prepublishOnly":"node build.js"},"_npmUser":{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"},"repository":{"url":"git+https://github.com/cubememory/sdk.git","type":"git"},"_npmVersion":"9.2.0","description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.3_1780888910525_0.2540082503048633","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@cubememory/sdk","version":"0.1.4","description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","main":"dist/index.cjs.js","module":"dist/index.esm.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.esm.js","require":"./dist/index.cjs.js","types":"./dist/index.d.ts"}},"scripts":{"build":"node build.js","prepublishOnly":"node build.js"},"keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory","embedding","ai-memory","pkm","notes"],"author":{"name":"Cube Memory","email":"dev@cubememory.com.br"},"license":"MIT","homepage":"https://cubememory.com.br","repository":{"type":"git","url":"git+https://github.com/cubememory/sdk.git"},"bugs":{"url":"https://github.com/cubememory/sdk/issues"},"devDependencies":{"typescript":"^5.4.0"},"_id":"@cubememory/sdk@0.1.4","_nodeVersion":"20.19.4","_npmVersion":"9.2.0","dist":{"integrity":"sha512-+715CNCwiooOrS7cZYAz6z5A/sbDs5t3kcotQOo2SDUSG2K5DXE1E65ABqTLDY8sMRdRE77ro7nBujfheLjYTQ==","shasum":"66fc6a06e2bcd36c0a461174923071c6118ea459","tarball":"https://registry.npmjs.org/@cubememory/sdk/-/sdk-0.1.4.tgz","fileCount":7,"unpackedSize":30490,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDRbvqwc88uyxp6ahhtnb/coqWxOk46y3o4aZGMK0UfEAiEA4/mMFO8jb8Av7iDLMNLwd1X1IWcuuX9gamHlNvUGARQ="}]},"_npmUser":{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"},"directories":{},"maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.4_1780889587082_0.5121339628915096"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-03T18:45:24.128Z","modified":"2026-06-08T03:33:07.330Z","0.1.0":"2026-06-03T18:45:24.431Z","0.1.1":"2026-06-03T18:47:32.563Z","0.1.2":"2026-06-03T19:11:35.082Z","0.1.3":"2026-06-08T03:21:50.653Z","0.1.4":"2026-06-08T03:33:07.214Z"},"bugs":{"url":"https://github.com/cubememory/sdk/issues"},"author":{"name":"Cube Memory","email":"dev@cubememory.com.br"},"license":"MIT","homepage":"https://cubememory.com.br","keywords":["vector-search","semantic-search","rag","llm-memory","mcp","cube-memory","embedding","ai-memory","pkm","notes"],"repository":{"type":"git","url":"git+https://github.com/cubememory/sdk.git"},"description":"Official JavaScript/TypeScript SDK for Cube Memory — semantic search with 100% exact recall","maintainers":[{"name":"cubememory","email":"ynnor.guerreiro@gmail.com"}],"readme":"# @cubememory/sdk\n\nOfficial JavaScript/TypeScript SDK for **Cube Memory** — semantic search with **100% exact recall**, isolated multi-tenant islands, and native MCP support.\n\n[![npm version](https://img.shields.io/npm/v/@cubememory/sdk)](https://www.npmjs.com/package/@cubememory/sdk)\n[![PyPI](https://img.shields.io/pypi/v/cubememory)](https://pypi.org/project/cubememory/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n\n## Install\n\n```bash\nnpm install @cubememory/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { createCubeClient } from '@cubememory/sdk';\n\nconst cube = createCubeClient('https://cubememory.com.br/gateway', 'cm_live_YOUR_KEY');\n\n// Semantic search — 100% exact cosine recall (no ANN approximation)\nconst results = await cube.index('my-docs').search('wireless headphones', { limit: 10 });\n\n// Index a document\nawait cube.index('my-docs').insert({\n  id: 'doc-001',\n  text: 'Noise cancelling Sony WH-1000XM5',\n  metadata: { price: 349, brand: 'Sony' },\n});\n\n// LLM Memory (agent remembers between sessions)\nawait cube.memory.store('User prefers dark mode and speaks Portuguese');\nconst ctx = await cube.memory.search('user preferences');\n\n// PKM Notes\nawait cube.notes.upsert({ title: 'Meeting Q3', text: 'Discussed the roadmap...', tags: ['meeting'] });\nconst notes = await cube.notes.search('roadmap');\n```\n\n## CDN (no bundler)\n\n```html\n<script src=\"https://cubememory.com.br/sdk.js\"></script>\n<script>\n  const cube = CubeMemory.createCubeClient('https://cubememory.com.br/gateway', 'cm_live_YOUR_KEY');\n  cube.index('docs').search('hello world').then(console.log);\n</script>\n```\n\n## API Reference\n\n### `createCubeClient(baseUrl, apiKey, options?)`\n\nReturns a `CubeClient` instance.\n\n| Param | Type | Description |\n|---|---|---|\n| `baseUrl` | `string` | Gateway URL, e.g. `https://cubememory.com.br/gateway` |\n| `apiKey` | `string` | Your API key (`cm_live_xxx`) |\n| `options.projectId` | `string` | Project ID (`proj_xxx`) |\n\n---\n\n### `cube.index(name)`\n\n| Method | Description |\n|---|---|\n| `.insert({ id, text, metadata? })` | Index a document |\n| `.insertMany(docs[])` | Batch index |\n| `.search(query, { limit?, threshold?, filter? })` | Semantic search |\n| `.get(id)` | Fetch by ID |\n| `.delete(id)` | Remove document |\n| `.stats()` | Index statistics |\n\n---\n\n### `cube.memory`\n\nAgent memory — persists context between LLM sessions.\n\n| Method | Description |\n|---|---|\n| `.store(text, layer?)` | Save a memory (`long-term` or `short-term`) |\n| `.search(query, limit?)` | Semantic search over memories |\n| `.list(limit?)` | List all memories |\n| `.delete(id)` | Delete a memory |\n\n---\n\n### `cube.notes`\n\nPKM Notes — Obsidian-style knowledge base with AI auto-connections.\n\n| Method | Description |\n|---|---|\n| `.upsert({ title, text, tags?, id? })` | Create or update a note |\n| `.list()` | List all notes |\n| `.get(id)` | Get note with full content and related notes |\n| `.search(query, limit?)` | Semantic search across notes |\n| `.delete(id)` | Delete note and its chunks |\n\n---\n\n## MCP Integration\n\nConnect any LLM (Claude, GPT, Cursor, Windsurf) directly to your Cube Memory:\n\n```json\n{\n  \"mcpServers\": {\n    \"cube-memory\": {\n      \"type\": \"http\",\n      \"url\": \"https://cubememory.com.br/gateway/v1/mcp\",\n      \"headers\": {\n        \"Authorization\": \"Bearer cm_live_YOUR_KEY\",\n        \"X-Project-Id\": \"proj_YOUR_PROJECT\"\n      }\n    }\n  }\n}\n```\n\nAvailable MCP tools: `search_memory`, `store_memory`, `list_memories`, `search_notes`, `get_note`.\n\n---\n\n## Python SDK\n\n```bash\npip install cubememory\n```\n\n```python\nfrom cubememory import CubeClient\n\ncube = CubeClient('https://cubememory.com.br/gateway', 'cm_live_YOUR_KEY', 'proj_YOUR_PROJECT')\nresults = cube.index('my-docs').search('wireless headphones', limit=10)\n```\n\n### REST API (raw `requests`)\n\n```bash\npip install requests\n```\n\n```python\nimport requests\n\nH = {\n    'Authorization': 'Bearer cm_live_YOUR_KEY',\n    'X-Project-Id': 'proj_YOUR_PROJECT',\n}\n\n# save a memory\nrequests.post('https://cubememory.com.br/gateway/v1/memory',\n    headers=H, json={'text': 'user prefers short answers'})\n\n# recall before LLM call (semantic search)\nctx = requests.post('https://cubememory.com.br/gateway/v1/memory/search',\n    headers=H, json={'query': user_input, 'limit': 5}).json()\nmemories = [r['text_preview'] for r in ctx['results']]\n```\n\n---\n\n## Why Cube Memory?\n\n| | Cube Memory | Bancos vetoriais baseados em ANN/HNSW |\n|---|:---:|:---:|\n| **100% exact recall** | ✅ cosine float32 | ❌ ANN approximation |\n| **Multi-tenant isolation** | ✅ island per project | ⚠️ shared index with filters |\n| **MCP native** | ✅ built-in | ❌ |\n| **Self-host footprint** | ✅ minimal, single-host friendly | ❌ heavy multi-service clusters |\n| **LGPD/GDPR** | ✅ data never leaves your server | ❌ cloud by default |\n\n---\n\n## Links\n\n- **Dashboard:** [cubememory.com.br](https://cubememory.com.br)\n- **PyPI:** [pypi.org/project/cubememory](https://pypi.org/project/cubememory/)\n- **Issues:** [github.com/cubememory/sdk](https://github.com/cubememory/sdk)\n","readmeFilename":"README.md"}