@dakera-ai/langchain

May 16, 2026 · View on GitHub

CI npm Downloads Node License: MIT dakera.ai Docs Docs

LangChain.js integration for Dakera — persistent semantic memory and server-side vector search, no local embedding model required.

ClassDescription
DakeraMemoryDrop-in BaseMemory for LangChain.js conversation chains
DakeraVectorStoreVectorStore backed by Dakera's server-side embedding engine

Quick Start

Step 1 — Run Dakera

Dakera is a self-hosted memory server. Spin it up with Docker:

docker run -d \
  --name dakera \
  -p 3300:3300 \
  -e DAKERA_ROOT_API_KEY=dk-mykey \
  ghcr.io/dakera-ai/dakera:latest

For a production setup with persistent storage, use Docker Compose:

curl -sSfL https://raw.githubusercontent.com/Dakera-AI/dakera-deploy/main/docker-compose.yml \
  -o docker-compose.yml
DAKERA_API_KEY=dk-mykey docker compose up -d

curl http://localhost:3300/health  # → {"status":"ok"}

Full deployment guide: github.com/Dakera-AI/dakera-deploy

Step 2 — Install the integration

npm install @dakera-ai/langchain @dakera-ai/dakera @langchain/core

Step 3 — Use it

import { DakeraMemory } from "@dakera-ai/langchain";
import { ConversationChain } from "langchain/chains";
import { ChatOpenAI } from "@langchain/openai";

const memory = new DakeraMemory({
  apiUrl: "http://localhost:3300",
  apiKey: "dk-mykey",
  agentId: "my-agent",
});

const chain = new ConversationChain({
  llm: new ChatOpenAI({ model: "gpt-4o" }),
  memory,
});

// Memory persists across sessions and restarts
const response = await chain.call({ input: "My project is called NeuralBridge." });
console.log(response.response);

Installation

npm install @dakera-ai/langchain @dakera-ai/dakera @langchain/core

Requirements: Node.js ≥ 20, a running Dakera server (see Step 1 above)


DakeraMemory

Persistent conversation memory for LangChain.js chains. Stores and recalls conversation history using Dakera's hybrid search.

import { DakeraMemory } from "@dakera-ai/langchain";
import { ConversationChain } from "langchain/chains";
import { ChatOpenAI } from "@langchain/openai";

const memory = new DakeraMemory({
  apiUrl: "http://localhost:3300",
  apiKey: process.env.DAKERA_API_KEY!,
  agentId: "my-agent",
  recallK: 5,       // how many past memories to surface per turn
  importance: 0.7,  // importance score for stored memories
});

const chain = new ConversationChain({
  llm: new ChatOpenAI({ model: "gpt-4o" }),
  memory,
});

// First session
await chain.call({ input: "My name is Alice and I'm building a chatbot." });

// Later session — memory persists across restarts
const { response } = await chain.call({ input: "What was I building?" });
console.log(response); // "You mentioned you were building a chatbot."

Options

OptionTypeDefaultDescription
apiUrlstringDakera server URL (e.g. http://localhost:3300)
apiKeystring""Dakera API key
agentIdstringAgent identifier for memory namespacing
recallKnumber5Number of memories to recall per turn
minImportancenumber0Minimum importance threshold for recall
memoryKeystring"history"Key injected into the chain prompt
inputKeystringfirst keyInput key used as recall query
importancenumber0.7Importance score assigned to stored memories

DakeraVectorStore

Server-side embedded vector store for RAG. Dakera handles embeddings — no local model, no OpenAI embeddings API needed.

import { DakeraVectorStore } from "@dakera-ai/langchain";

const vectorstore = new DakeraVectorStore({
  apiUrl: "http://localhost:3300",
  apiKey: process.env.DAKERA_API_KEY!,
  namespace: "my-docs",
});

// Index documents (server handles embedding)
await vectorstore.addDocuments([
  { pageContent: "Dakera is a persistent memory platform for AI agents.", metadata: { source: "docs" } },
  { pageContent: "It supports Python, JavaScript, Rust, and Go SDKs.", metadata: { source: "docs" } },
]);

// Semantic search
const results = await vectorstore.similaritySearch("What languages are supported?", 4);
console.log(results[0].pageContent);

RAG chain

import { RetrievalQAChain } from "langchain/chains";
import { ChatOpenAI } from "@langchain/openai";
import { DakeraVectorStore } from "@dakera-ai/langchain";

const vectorstore = new DakeraVectorStore({
  apiUrl: "http://localhost:3300",
  apiKey: process.env.DAKERA_API_KEY!,
  namespace: "my-docs",
});

const chain = RetrievalQAChain.fromLLM(
  new ChatOpenAI({ model: "gpt-4o" }),
  vectorstore.asRetriever({ k: 4 }),
);

const { text } = await chain.call({ query: "How does memory decay work?" });
console.log(text);

From texts (LangChain convention)

const store = await DakeraVectorStore.fromTexts(
  ["Document one content", "Document two content"],
  [{ source: "a" }, { source: "b" }],
  null, // embeddings param — unused, Dakera handles server-side embedding
  { apiUrl: "http://localhost:3300", apiKey: "dk-mykey", namespace: "docs" },
);

Options

OptionTypeDefaultDescription
apiUrlstringDakera server URL
apiKeystring""Dakera API key
namespacestringVector namespace to read/write
embeddingModelstringnamespace defaultServer-side embedding model override

PackageFrameworkLanguage
langchain-dakeraLangChainPython
crewai-dakeraCrewAIPython
llamaindex-dakeraLlamaIndexPython
autogen-dakeraAutoGenPython


License

MIT © Dakera AI


dakera.ai · Documentation · Request Early Access