{"_id":"@dakera-ai/langchain","_rev":"4-89d6e5e81c3341dfc08aeb1b0cd3d8f3","name":"@dakera-ai/langchain","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@dakera-ai/langchain","version":"0.1.0","keywords":["langchain","dakera","memory","vector","ai","rag","typescript"],"author":{"name":"Dakera Team"},"license":"MIT","_id":"@dakera-ai/langchain@0.1.0","maintainers":[{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"}],"homepage":"https://github.com/dakera-ai/dakera-langchain-js","bugs":{"url":"https://github.com/dakera-ai/dakera-langchain-js/issues"},"dist":{"shasum":"01d600c67c8281121e5027637c4ec6cb9c33e7fd","tarball":"https://registry.npmjs.org/@dakera-ai/langchain/-/langchain-0.1.0.tgz","fileCount":7,"integrity":"sha512-XVj3Pw/ucqeE6iuBrSTFLBko2tEcTgV3m1QoDlkhX3mPQAefpQ2UJnv+312IugUQGb7+eoU/6YZ4wZSPpBAEaw==","signatures":[{"sig":"MEQCIBvPRu7LuS/N8O3+GTY8L4PssoMXnmbYIhmV7l27A09WAiBhgBdqDWbiKucQX1Xp3HOCTripD6aJAFXNp81F52SPsw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34600},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"4e1f3900ee853f133cc0ed3626792ff055e04775","scripts":{"lint":"eslint src tests --ext .ts","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"},"overrides":{"uuid":"^14.0.0"},"repository":{"url":"git+https://github.com/dakera-ai/dakera-langchain-js.git","type":"git"},"_npmVersion":"10.9.7","description":"LangChain.js integration for Dakera AI memory platform","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^4.1.5","typescript":"^5.4.0","@types/node":"^20.0.0","@langchain/core":"^1.1.41","@dakera-ai/dakera":"^0.8.6"},"peerDependencies":{"@langchain/core":">=1.1.0","@dakera-ai/dakera":">=0.8.6"},"_npmOperationalInternal":{"tmp":"tmp/langchain_0.1.0_1778678409502_0.7251205807899126","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dakera-ai/langchain","version":"0.1.1","keywords":["langchain","dakera","memory","vector","ai","rag","typescript"],"author":{"name":"Dakera Team"},"license":"MIT","_id":"@dakera-ai/langchain@0.1.1","maintainers":[{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"}],"homepage":"https://github.com/dakera-ai/dakera-langchain-js","bugs":{"url":"https://github.com/dakera-ai/dakera-langchain-js/issues"},"dist":{"shasum":"c4c0359fc3307937a485dc06c811634ce90a550f","tarball":"https://registry.npmjs.org/@dakera-ai/langchain/-/langchain-0.1.1.tgz","fileCount":7,"integrity":"sha512-69Z7eedQFI+UvE60Ky5m+rCM2LZVkAQafi65i+9Aak/pciwIBhrBcm8yTfVItv+oiCFEO4sC3OubdysG1TDJ0g==","signatures":[{"sig":"MEUCIQCbLl88wGlgsCAgh79A5JjB2sl7z1HY1rg7bV9LjzU8/wIgVjqN03PSoSH8i6OsHcdnUiNYnMLnedpw7KSjf9TVSiQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34633},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"5b119a2bd6f36b93539a66381940d4a7bac1b4e7","scripts":{"lint":"eslint src tests --ext .ts","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"},"overrides":{"uuid":"^14.0.0"},"repository":{"url":"git+https://github.com/dakera-ai/dakera-langchain-js.git","type":"git"},"_npmVersion":"10.9.7","description":"LangChain.js integration for Dakera AI memory platform","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^4.1.5","typescript":"^5.9.3","@types/node":"^25.7.0","@langchain/core":"^1.1.41","@dakera-ai/dakera":"^0.11.54"},"peerDependencies":{"@langchain/core":">=1.1.0","@dakera-ai/dakera":">=0.11.54"},"_npmOperationalInternal":{"tmp":"tmp/langchain_0.1.1_1778688980938_0.19867807449020103","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dakera-ai/langchain","version":"0.1.2","keywords":["langchain","dakera","memory","vector","ai","rag","typescript"],"author":{"name":"Dakera Team"},"license":"MIT","_id":"@dakera-ai/langchain@0.1.2","maintainers":[{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"}],"homepage":"https://github.com/dakera-ai/dakera-langchain-js","bugs":{"url":"https://github.com/dakera-ai/dakera-langchain-js/issues"},"dist":{"shasum":"49c58f1125829ba78f2e03bdfd28d36dce322553","tarball":"https://registry.npmjs.org/@dakera-ai/langchain/-/langchain-0.1.2.tgz","fileCount":7,"integrity":"sha512-9TUR5i19rvTIXumajw1aJGSLytlryADXvECvz/KnjOK/zSzoUMg1ElzB4rbsb9foWkfdrMDVzBp+9sj/wh+5Lw==","signatures":[{"sig":"MEQCIFdn/Ljk3o8ERXBAzuzziu+84s7oPavtiv6g3Q8F68iXAiAfAHVOG9ZN/+JMsaqQS1JF7SrKJiHjepWoGHL6ZVtAyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34661},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.mjs","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"86243b7ff012d880be8332b8ac115f7af0a20346","scripts":{"lint":"eslint src tests --ext .ts","test":"vitest run","build":"tsup src/index.ts --format cjs,esm --dts --clean","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"},"overrides":{"uuid":"^14.0.0","langsmith":">=0.6.0"},"repository":{"url":"git+https://github.com/dakera-ai/dakera-langchain-js.git","type":"git"},"_npmVersion":"10.9.7","description":"LangChain.js integration for Dakera AI memory platform","directories":{},"_nodeVersion":"22.22.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^4.1.5","typescript":"^5.9.3","@types/node":"^25.7.0","@langchain/core":"^1.1.41","@dakera-ai/dakera":"^0.11.54"},"peerDependencies":{"@langchain/core":">=1.1.0","@dakera-ai/dakera":">=0.11.54"},"_npmOperationalInternal":{"tmp":"tmp/langchain_0.1.2_1778699114911_0.6953398016893577","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dakera-ai/langchain","version":"0.2.0","description":"LangChain.js integration for Dakera AI memory platform","main":"dist/index.js","module":"dist/index.mjs","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm --dts --clean","test":"vitest run","test:watch":"vitest","lint":"eslint src tests --ext .ts","typecheck":"tsc --noEmit"},"keywords":["langchain","dakera","memory","vector","ai","rag","typescript"],"author":{"name":"Dakera Team"},"license":"MIT","homepage":"https://github.com/dakera-ai/dakera-langchain-js","repository":{"type":"git","url":"git+https://github.com/dakera-ai/dakera-langchain-js.git"},"bugs":{"url":"https://github.com/dakera-ai/dakera-langchain-js/issues"},"peerDependencies":{"@dakera-ai/dakera":">=0.11.54","@langchain/core":">=1.1.0"},"devDependencies":{"@dakera-ai/dakera":"^0.11.54","@langchain/core":"^1.1.41","@types/node":"^25.7.0","tsup":"^8.0.0","typescript":"^5.9.3","vitest":"^4.1.5"},"engines":{"node":">=20"},"publishConfig":{"registry":"https://registry.npmjs.org","access":"public"},"overrides":{"uuid":"^14.0.0","langsmith":">=0.6.0"},"_id":"@dakera-ai/langchain@0.2.0","gitHead":"c0b64651860bb04d720230f05cc99054b74b953a","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-o5pHqSVHgzxxpHNtnFuvKlan1YfUnVGSDv3MYr226hz6j00oYtdP/5rXZ55OZPB8tWF1WNqPROUXRxkyqyHIUQ==","shasum":"500ba72bd60e644146a2c32cba8b9fe48cfc0c22","tarball":"https://registry.npmjs.org/@dakera-ai/langchain/-/langchain-0.2.0.tgz","fileCount":7,"unpackedSize":57777,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG1rtZwSELIVdK36JoYgydvJ0io3VWKGYZrbeapdBXi9AiEAisL2RNsk5MX++W+/yKmlF/8ak2vWBnSKUvV0FJFdRXM="}]},"_npmUser":{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"},"directories":{},"maintainers":[{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/langchain_0.2.0_1779015449880_0.03422028727566917"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T13:20:09.444Z","modified":"2026-05-17T10:57:30.242Z","0.1.0":"2026-05-13T13:20:09.634Z","0.1.1":"2026-05-13T16:16:21.108Z","0.1.2":"2026-05-13T19:05:15.088Z","0.2.0":"2026-05-17T10:57:30.103Z"},"bugs":{"url":"https://github.com/dakera-ai/dakera-langchain-js/issues"},"author":{"name":"Dakera Team"},"license":"MIT","homepage":"https://github.com/dakera-ai/dakera-langchain-js","keywords":["langchain","dakera","memory","vector","ai","rag","typescript"],"repository":{"type":"git","url":"git+https://github.com/dakera-ai/dakera-langchain-js.git"},"description":"LangChain.js integration for Dakera AI memory platform","maintainers":[{"name":"ferhimedamine","email":"ferhi.med.amine@gmail.com"}],"readme":"# @dakera-ai/langchain\n\n[![CI](https://github.com/Dakera-AI/dakera-langchain-js/actions/workflows/ci.yml/badge.svg)](https://github.com/Dakera-AI/dakera-langchain-js/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/@dakera-ai/langchain)](https://www.npmjs.com/package/@dakera-ai/langchain)\n[![Downloads](https://img.shields.io/npm/dm/@dakera-ai/langchain)](https://www.npmjs.com/package/@dakera-ai/langchain)\n[![Node](https://img.shields.io/node/v/@dakera-ai/langchain)](https://www.npmjs.com/package/@dakera-ai/langchain)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![dakera.ai](https://img.shields.io/badge/dakera.ai-website-22c55e?style=flat-square)](https://dakera.ai) [![Docs](https://img.shields.io/badge/docs-dakera.ai%2Fdocs-3b82f6?style=flat-square)](https://dakera.ai/docs)\n[![Docs](https://img.shields.io/badge/docs-dakera.ai-D4A843)](https://dakera.ai/docs)\n\n**LangChain.js integration for [Dakera](https://github.com/Dakera-AI/dakera-deploy) — persistent semantic memory and server-side vector search, no local embedding model required.**\n\n| Class | Description |\n|-------|-------------|\n| `DakeraMemory` | Drop-in `BaseMemory` for LangChain.js conversation chains |\n| `DakeraVectorStore` | `VectorStore` backed by Dakera's server-side embedding engine |\n\n---\n\n## Quick Start\n\n### Step 1 — Run Dakera\n\nDakera is a self-hosted memory server. Spin it up with Docker:\n\n```bash\ndocker run -d \\\n  --name dakera \\\n  -p 3300:3300 \\\n  -e DAKERA_ROOT_API_KEY=dk-mykey \\\n  ghcr.io/dakera-ai/dakera:latest\n```\n\nFor a production setup with persistent storage, use Docker Compose:\n\n```bash\ncurl -sSfL https://raw.githubusercontent.com/Dakera-AI/dakera-deploy/main/docker-compose.yml \\\n  -o docker-compose.yml\nDAKERA_API_KEY=dk-mykey docker compose up -d\n\ncurl http://localhost:3300/health  # → {\"status\":\"ok\"}\n```\n\n> Full deployment guide: [github.com/Dakera-AI/dakera-deploy](https://github.com/Dakera-AI/dakera-deploy)\n\n### Step 2 — Install the integration\n\n```bash\nnpm install @dakera-ai/langchain @dakera-ai/dakera @langchain/core\n```\n\n### Step 3 — Use it\n\n```typescript\nimport { DakeraMemory } from \"@dakera-ai/langchain\";\nimport { ConversationChain } from \"langchain/chains\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst memory = new DakeraMemory({\n  apiUrl: \"http://localhost:3300\",\n  apiKey: \"dk-mykey\",\n  agentId: \"my-agent\",\n});\n\nconst chain = new ConversationChain({\n  llm: new ChatOpenAI({ model: \"gpt-4o\" }),\n  memory,\n});\n\n// Memory persists across sessions and restarts\nconst response = await chain.call({ input: \"My project is called NeuralBridge.\" });\nconsole.log(response.response);\n```\n\n---\n\n## Installation\n\n```bash\nnpm install @dakera-ai/langchain @dakera-ai/dakera @langchain/core\n```\n\n**Requirements:** Node.js ≥ 20, a running Dakera server (see Step 1 above)\n\n---\n\n## DakeraMemory\n\nPersistent conversation memory for LangChain.js chains. Stores and recalls conversation history using Dakera's hybrid search.\n\n```typescript\nimport { DakeraMemory } from \"@dakera-ai/langchain\";\nimport { ConversationChain } from \"langchain/chains\";\nimport { ChatOpenAI } from \"@langchain/openai\";\n\nconst memory = new DakeraMemory({\n  apiUrl: \"http://localhost:3300\",\n  apiKey: process.env.DAKERA_API_KEY!,\n  agentId: \"my-agent\",\n  recallK: 5,       // how many past memories to surface per turn\n  importance: 0.7,  // importance score for stored memories\n});\n\nconst chain = new ConversationChain({\n  llm: new ChatOpenAI({ model: \"gpt-4o\" }),\n  memory,\n});\n\n// First session\nawait chain.call({ input: \"My name is Alice and I'm building a chatbot.\" });\n\n// Later session — memory persists across restarts\nconst { response } = await chain.call({ input: \"What was I building?\" });\nconsole.log(response); // \"You mentioned you were building a chatbot.\"\n```\n\n### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiUrl` | `string` | — | Dakera server URL (e.g. `http://localhost:3300`) |\n| `apiKey` | `string` | `\"\"` | Dakera API key |\n| `agentId` | `string` | — | Agent identifier for memory namespacing |\n| `recallK` | `number` | `5` | Number of memories to recall per turn |\n| `minImportance` | `number` | `0` | Minimum importance threshold for recall |\n| `memoryKey` | `string` | `\"history\"` | Key injected into the chain prompt |\n| `inputKey` | `string` | first key | Input key used as recall query |\n| `importance` | `number` | `0.7` | Importance score assigned to stored memories |\n\n---\n\n## DakeraVectorStore\n\nServer-side embedded vector store for RAG. Dakera handles embeddings — no local model, no OpenAI embeddings API needed.\n\n```typescript\nimport { DakeraVectorStore } from \"@dakera-ai/langchain\";\n\nconst vectorstore = new DakeraVectorStore({\n  apiUrl: \"http://localhost:3300\",\n  apiKey: process.env.DAKERA_API_KEY!,\n  namespace: \"my-docs\",\n});\n\n// Index documents (server handles embedding)\nawait vectorstore.addDocuments([\n  { pageContent: \"Dakera is a persistent memory platform for AI agents.\", metadata: { source: \"docs\" } },\n  { pageContent: \"It supports Python, JavaScript, Rust, and Go SDKs.\", metadata: { source: \"docs\" } },\n]);\n\n// Semantic search\nconst results = await vectorstore.similaritySearch(\"What languages are supported?\", 4);\nconsole.log(results[0].pageContent);\n```\n\n### RAG chain\n\n```typescript\nimport { RetrievalQAChain } from \"langchain/chains\";\nimport { ChatOpenAI } from \"@langchain/openai\";\nimport { DakeraVectorStore } from \"@dakera-ai/langchain\";\n\nconst vectorstore = new DakeraVectorStore({\n  apiUrl: \"http://localhost:3300\",\n  apiKey: process.env.DAKERA_API_KEY!,\n  namespace: \"my-docs\",\n});\n\nconst chain = RetrievalQAChain.fromLLM(\n  new ChatOpenAI({ model: \"gpt-4o\" }),\n  vectorstore.asRetriever({ k: 4 }),\n);\n\nconst { text } = await chain.call({ query: \"How does memory decay work?\" });\nconsole.log(text);\n```\n\n### From texts (LangChain convention)\n\n```typescript\nconst store = await DakeraVectorStore.fromTexts(\n  [\"Document one content\", \"Document two content\"],\n  [{ source: \"a\" }, { source: \"b\" }],\n  null, // embeddings param — unused, Dakera handles server-side embedding\n  { apiUrl: \"http://localhost:3300\", apiKey: \"dk-mykey\", namespace: \"docs\" },\n);\n```\n\n### Options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiUrl` | `string` | — | Dakera server URL |\n| `apiKey` | `string` | `\"\"` | Dakera API key |\n| `namespace` | `string` | — | Vector namespace to read/write |\n| `embeddingModel` | `string` | namespace default | Server-side embedding model override |\n\n---\n\n## Related packages\n\n| Package | Framework | Language |\n|---------|-----------|----------|\n| `langchain-dakera` | LangChain | Python |\n| `crewai-dakera` | CrewAI | Python |\n| `llamaindex-dakera` | LlamaIndex | Python |\n| `autogen-dakera` | AutoGen | Python |\n\n---\n\n## Links\n\n- [Dakera Server](https://github.com/Dakera-AI/dakera-deploy) — self-hosted memory server\n- [Dakera JS SDK](https://github.com/Dakera-AI/dakera-js) — low-level API client\n- [Integration guide](https://dakera.ai/integrations/langchain-js.html) — full setup walkthrough\n- [All integrations](https://dakera.ai/integrations/)\n\n---\n\n## License\n\nMIT © [Dakera AI](https://dakera.ai)\n\n---\n\n<div align=\"center\">\n\n**[dakera.ai](https://dakera.ai)** · [Documentation](https://dakera.ai/docs) · [Request Early Access](https://dakera.ai#cta)\n\n</div>\n","readmeFilename":"README.md"}