npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@falkordb/mem0

v0.1.1

Published

FalkorDB graph store backend for the mem0ai TypeScript SDK

Readme

Tests Coverage License Discord Twitter

@falkordb/mem0

Try Free

FalkorDB graph store backend for the mem0ai TypeScript SDK.

Drop-in replacement for mem0's Neo4j-based graph memory — use FalkorMemory instead of Memory and point it at a FalkorDB instance.

Prerequisites

Start FalkorDB with Docker

docker run -p 6379:6379 -it --rm falkordb/falkordb

Installation

npm install @falkordb/mem0 mem0ai

Quick Start

import { FalkorMemory } from "@falkordb/mem0";

const memory = new FalkorMemory({
  enableGraph: true,
  graphStore: {
    provider: "falkordb",
    config: {
      host: "localhost",
      port: 6379,
      graphName: "mem0", // optional, defaults to "mem0"
    },
  },
  llm: {
    provider: "openai",
    config: { apiKey: process.env.OPENAI_API_KEY },
  },
  embedder: {
    provider: "openai",
    config: { apiKey: process.env.OPENAI_API_KEY },
  },
  vectorStore: {
    provider: "memory",
    config: { dimension: 1536 },
  },
});

// Add memories — entities and relationships are extracted automatically
await memory.add("Alice works at Google and loves TypeScript.", {
  userId: "alice",
});

// Search — returns vector results + graph relations
const results = await memory.search("Where does Alice work?", {
  userId: "alice",
});
console.log(results);

// Clean up
await memory.close();

Configuration

FalkorMemoryConfig

Extends mem0's MemoryConfig with FalkorDB-specific graph store options:

| Field | Type | Description | |---|---|---| | graphStore.provider | "falkordb" | Must be "falkordb" | | graphStore.config.host | string | FalkorDB host (default: "localhost") | | graphStore.config.port | number | FalkorDB port (default: 6379) | | graphStore.config.password | string? | Optional auth password | | graphStore.config.username | string? | Optional auth username | | graphStore.config.graphName | string? | Graph name (default: "mem0") | | graphStore.llm | object? | Override LLM provider for graph operations | | graphStore.customPrompt | string? | Custom prompt for relationship extraction |

All other fields (llm, embedder, vectorStore, etc.) are passed through to mem0 as-is.

How It Works

FalkorMemory extends mem0's Memory class. When graphStore.provider is "falkordb", it:

  1. Calls super() with enableGraph: false to skip Neo4j initialization
  2. Creates a FalkorMemoryGraph instance backed by the FalkorDB driver
  3. Injects it as the internal graph memory handler

FalkorMemoryGraph reimplements mem0's MemoryGraph using the same LLM calls (entity extraction, relationship extraction, deletion decisions) and the same graph query patterns, adapted for FalkorDB.

Cypher Compatibility

The CypherTranslator handles the few Cypher dialect differences between Neo4j and FalkorDB:

| Neo4j | FalkorDB | Notes | |---|---|---| | elementId(n) | id(n) | FalkorDB uses id() | | round(x, 4) | round(x) | FalkorDB round() takes one argument | | apoc.merge.relationship(...) | MERGE (a)-[r:TYPE]->(b) | Safety net (mem0 v2.x doesn't use APOC) |

Standard Cypher features used by mem0 work as-is in FalkorDB: MERGE, MATCH, DETACH DELETE, timestamp(), reduce(), sqrt(), type(r), size(), range().

API

FalkorMemory

Same API as mem0's Memory class, plus:

  • close(): Promise<void> — Closes the FalkorDB connection. Call this when done.

FalkorMemoryGraph

Can be used standalone without the vector store layer:

import { FalkorMemoryGraph } from "@falkordb/mem0";

const graph = new FalkorMemoryGraph(config);
await graph.add("Bob likes pizza", { userId: "bob" });
const results = await graph.search("What does Bob like?", { userId: "bob" });
await graph.getAll({ userId: "bob" });
await graph.deleteAll({ userId: "bob" });
await graph.close();

FalkorDBGraph

Low-level FalkorDB driver wrapper with automatic Cypher translation:

import { FalkorDBGraph } from "@falkordb/mem0";

const db = new FalkorDBGraph({ host: "localhost", port: 6379 });
const rows = await db.query("MATCH (n) RETURN n.name AS name LIMIT 10");
await db.close();

CypherTranslator

Static utility for translating Neo4j Cypher to FalkorDB-compatible Cypher:

import { CypherTranslator } from "@falkordb/mem0";

const { query, params } = CypherTranslator.translate(
  "RETURN elementId(n) AS id",
  {}
);
// query: "RETURN id(n) AS id"

Development

npm install
npm test          # Run unit tests
npm run build     # Compile TypeScript

Integration Tests

Integration tests require a running FalkorDB instance:

FALKORDB_HOST=localhost OPENAI_API_KEY=sk-... npm test

License

MIT