> ## Documentation Index
> Fetch the complete documentation index at: https://new.docs.falkordb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# FalkorDBLite (TypeScript)

> Embedded FalkorDB runtime for Node.js and TypeScript

FalkorDBLite for Node.js/TypeScript launches an embedded `redis-server` with the FalkorDB module and returns a connected FalkorDB client. It is ideal for local development, demos, CI jobs, or small apps that want a zero-config graph database that starts and stops with the application.

## Requirements

* Node.js 20 or later
* Ability to download the FalkorDB module during `npm install`
* Linux x64 and macOS arm64 are supported; Windows users should run under WSL2 or use a remote server

## Installation

```bash theme={null}
npm install falkordblite

# Optional: also install the remote client when you plan to connect to an external server
npm install falkordb
```

## Quick start

```ts theme={null}
import { FalkorDB } from 'falkordblite';

const db = await FalkorDB.open();
const graph = db.selectGraph('quickstart');

await graph.query('CREATE (p:Person {name: "Ada"})');
const result = await graph.roQuery('MATCH (p:Person) RETURN p.name');
console.log(result.data); // => [ [ 'Ada' ] ]

await db.close();
```

## Persist data between runs

Provide a path to keep data on disk. When set, FalkorDBLite enables periodic snapshots automatically.

```ts theme={null}
const db = await FalkorDB.open({ path: '/tmp/falkordb-lite' });
const graph = db.selectGraph('inventory');
await graph.query('CREATE (:Product {id: 1, name: \"Laptop\"})');
await db.close();
```

## Work with multiple graphs

Use separate graph IDs to isolate datasets within the same embedded instance.

```ts theme={null}
const db = await FalkorDB.open();

const users = db.selectGraph('users');
const orders = db.selectGraph('orders');

await users.query('CREATE (:User {id: 1, email: \"a@example.com\"})');
await orders.query('CREATE (:Order {id: 10, total: 99.5})');

await db.close();
```

## Configuration options

Set options on `FalkorDB.open()` to control the embedded server:

| Option             | Type                                            | Default             | Purpose                                             |
| ------------------ | ----------------------------------------------- | ------------------- | --------------------------------------------------- |
| `path`             | `string`                                        | temporary directory | Data directory; enables persistence and snapshots.  |
| `redisServerPath`  | `string`                                        | auto                | Use a custom `redis-server` binary.                 |
| `modulePath`       | `string`                                        | auto                | Use a custom FalkorDB module (`.so`) path.          |
| `maxMemory`        | `string`                                        | unset               | Redis `maxmemory`, e.g. `"256mb"`.                  |
| `logLevel`         | `'debug' \| 'verbose' \| 'notice' \| 'warning'` | unset               | Redis log level.                                    |
| `logFile`          | `string`                                        | standard output     | Where the embedded server logs.                     |
| `timeout`          | `number`                                        | `10000`             | Startup timeout in milliseconds.                    |
| `additionalConfig` | `Record<string, string>`                        | none                | Extra redis.conf entries (e.g. `{ port: '6379' }`). |
| `falkordbVersion`  | `string`                                        | `v4.16.3`           | FalkorDB module release tag to download.            |
| `inheritStdio`     | `boolean`                                       | `false`             | Pipe `redis-server` output to the parent process.   |

The FalkorDB client returned by `selectGraph()` exposes the full FalkorDB Graph API (query, `roQuery`, indexes, constraints, profiling, etc.).

## Migrate to a remote FalkorDB server

Keep your graph logic and swap only the connection line:

```ts theme={null}
// Embedded
import { FalkorDB } from 'falkordblite';
const db = await FalkorDB.open();

// Remote
import { FalkorDB as RemoteFalkorDB } from 'falkordb';
const remote = await RemoteFalkorDB.connect({
  socket: { host: '127.0.0.1', port: 6379 },
});
```

## Resources

* [falkordblite-ts on GitHub](https://github.com/FalkorDB/falkordblite-ts)
* [Package on npm](https://www.npmjs.com/package/falkordblite)
* [Troubleshooting guide](https://github.com/FalkorDB/falkordblite-ts/blob/main/TROUBLESHOOTING.md)

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What Node.js version does FalkorDBLite for TypeScript require?">
    FalkorDBLite for TypeScript requires Node.js 20 or later. It supports Linux x64 and macOS arm64. Windows users should run under WSL2.
  </Accordion>

  <Accordion title="How do I enable data persistence in FalkorDBLite TypeScript?">
    Pass a `path` option to `FalkorDB.open()`: `const db = await FalkorDB.open({ path: './my-data' })`. This enables periodic snapshots and data persists between application restarts.
  </Accordion>

  <Accordion title="Can I control memory usage of the embedded server?">
    Yes. Use the `maxMemory` option: `FalkorDB.open({ maxMemory: '256mb' })`. This sets the Redis `maxmemory` configuration for the embedded instance.
  </Accordion>

  <Accordion title="How do I migrate from FalkorDBLite to a remote FalkorDB server?">
    Swap the import and connection line. Change from `import { FalkorDB } from 'falkordblite'` with `FalkorDB.open()` to `import { FalkorDB } from 'falkordb'` with `FalkorDB.connect({ socket: { host, port } })`.
  </Accordion>

  <Accordion title="What happens if the FalkorDB module fails to download during npm install?">
    Check your network connectivity and ensure the target platform is supported (Linux x64 or macOS arm64). You can also provide a custom module path via the `modulePath` option.
  </Accordion>
</AccordionGroup>
