Skip to main content
Glama
README.md
# ToteDB Core

Carry your AI work forward. ToteDB imports conversation exports into local SQLite, keeps alternate replies distinguishable from the current path, and creates a brief another client can read.

[Try the browser explorer](https://totedb.eti-charterx-2003.chatgpt.site/) · [Download the built developer kit](https://totedb.eti-charterx-2003.chatgpt.site/downloads/ToteDB-0.2.0-alpha.2.zip)

## Run from this repository

Use Node.js 24 and npm 11. From your terminal run

```sh
git clone https://github.com/carterverse/totedb-core.git
cd totedb-core
npm ci --ignore-scripts
npm run build
npm run demo
```

Run `npm run check` for the TypeScript checks and test suite.

## Run from the prebuilt ZIP

Use Node.js 24 LTS and npm 11. Extract the ZIP, open a terminal in the folder containing this README and run:

```sh
npm ci --omit=dev --ignore-scripts
npm run demo
```

The CLI is already built. Installation downloads the locked dependencies. The sample uses an isolated temporary database, imports four messages, replays the export, retrieves an alternate reply, writes a handoff and prints a brief. It removes its temporary database when finished. The commands below create durable data.

## Use an export

```sh
node dist/cli.js project create --workspace Personal --name "My notes"
```

Copy the returned project ID. Substitute it for PROJECT_ID below and substitute your export path for the example path.

```sh
node dist/cli.js validate "./conversations.json" --provider openai
node dist/cli.js import openai "./conversations.json" --project PROJECT_ID --dry-run
node dist/cli.js import openai "./conversations.json" --project PROJECT_ID
node dist/cli.js import report RUN_ID --format json --output report.json
node dist/cli.js search "platform" --project PROJECT_ID
node dist/cli.js search "audio" --project PROJECT_ID --include-alternates
node dist/cli.js memory save --project PROJECT_ID --kind handoff --title "Next review" --content "Check the map proof."
node dist/cli.js brief --project PROJECT_ID
```

The import prints RUN_ID in the runId field. For split OpenAI exports, extract the ZIP and pass the folder containing conversations-NNN.json to both validate and import. For Claude conversation arrays, use the claude provider and a single JSON file. Exit code 2 indicates warnings or conflicts. Read the output before proceeding. Re-importing a file can add new messages and records conflicts.

## Use in an MCP client

For a client that supports a local stdio server, configure the command as node and the arguments as the absolute path to dist/cli.js followed by serve, --transport and stdio. For example:

```json
{
  "mcpServers": {
    "totedb": {
      "command": "node",
      "args": ["/absolute/path/to/totedb/dist/cli.js", "serve", "--transport", "stdio"]
    }
  }
}
```

Set TOTEDB_DB to the same absolute database path in both clients if overriding the default. Use list_projects, save_handoff and get_project_brief to resume across clients. This preview is intended for local, single-user operation.

## Data and limits

The default database is ~/.totedb/totedb.sqlite. Use --db with the CLI or TOTEDB_DB to choose a different file. Message text remains readable in the SQLite file and in exported briefs. Review a brief before sending it to another person or AI provider. To back up an existing database, run node dist/cli.js db migrate and keep the SQLite backup identified by backupPath.

OpenAI current_node ancestry determines the selected path. A missing or invalid current_node triggers a warning and a fallback. Claude input is read in exported message order. Attachment references can survive import even when the underlying files are unavailable. A single-file import parses JSON in memory. Provider formats and platform compatibility vary. Broader export coverage and desktop-client validation remain in progress.

## Build and test the source

```sh
npm ci --ignore-scripts
npm run check
npm run build
```

Public preview 0.2.0-alpha.2 derives from core revision 7f1277bb5a33c72200ec7505f9f3eb0c8bc8cd8c. This distribution refreshes the dependency lock, corrects URL and inline-credential redaction bookkeeping, updates the advertised version, and includes a self-contained example. The license is Apache-2.0. See LICENSE and NOTICE.