Skip to main content

Installation

Install the Trix SDK for your preferred language and platform. We offer official SDKs for TypeScript, Python, and a CLI tool.

System Requirements

Trix SDKs are lightweight with minimal dependencies. Here's what you need:

SDKMinimum VersionNotes
Node.js / TypeScriptNode.js 18+TypeScript types included, ESM and CJS supported
PythonPython 3.9+Type hints included, async/await supported
C# / .NET.NET 6+Async/await, nullable reference types supported
CLIAny OSStandalone binary, no runtime required
REST APIAny HTTP clientNo SDK needed, works with curl, fetch, etc.

Node.js / TypeScript

Install the official Trix client for Node.js and TypeScript projects:

npm install @trixdb/client

TypeScript support: Type definitions are bundled — no need to install @types packages.

Basic usage:

import { Trix } from '@trixdb/client';

const trix = new Trix({
  apiKey: process.env.TRIX_API_KEY
});

// Store and search memories
await trix.memories.create({ content: 'User prefers dark mode' });
const results = await trix.memories.list({ q: 'user preferences' });

Python

Install the Trix SDK for Python projects:

pip install trixdb

Async support: The Python SDK supports both sync and async operations. Use client.memories.create() for sync or await client.memories.create() for async.

C# / .NET

Install the Trix SDK for .NET projects:

dotnet add package Trix

.NET versions: The SDK targets .NET 6.0+ and supports .NET 7, .NET 8, and future versions.

CLI

Install the Trix command-line interface for terminal-based workflows:

npm install -g @trixdb/cli

Great for scripting: The CLI outputs JSON by default, making it easy to pipe into jq or other tools.

REST API

No SDK required. Use any HTTP client to interact with Trix directly:

// Store a memory
const response = await fetch('https://api.trixdb.com/v1/memories', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.TRIX_API_KEY}`,
    'Content-Type': 'application/json',
    'X-Trix-Session': 'user_123'
  },
  body: JSON.stringify({ content: 'User prefers dark mode' })
});

const memory = await response.json();
console.log('Stored:', memory.id);

Base URL: https://api.trixdb.com/v1

See the API Reference for complete endpoint documentation.

Verify Installation

After installation, verify everything is working with a quick connection test:

import { Trix } from '@trixdb/client';

const trix = new Trix({
  apiKey: process.env.TRIX_API_KEY
});

// Check connection
const status = await trix.ping();

if (status.ok) {
  console.log('✓ Connected to Trix');
  console.log('  Version:', status.version);
  console.log('  Latency:', status.latencyMs, 'ms');
} else {
  console.error('✗ Connection failed');
}

Troubleshooting

Common installation issues and solutions:

EACCES Permission Error (npm)

If you get permission errors with npm global install, fix npm permissions or use a version manager like nvm.

npm config set prefix ~/.npm-global
SSL Certificate Error

If you're behind a corporate proxy, you may need to configure your certificate bundle.

export NODE_EXTRA_CA_CERTS=/path/to/cert.pem
Module Not Found (Python)

Ensure you're using the correct Python environment. Try using python3 -m pip instead of pip.

python3 -m pip install trixdb
API Key Not Found

Make sure your environment variable is set correctly and your shell session is reloaded.

source ~/.bashrc  # or ~/.zshrc

Still having issues? Check our Troubleshooting Guide or open an issue on GitHub.

Next Steps

Now that Trix is installed, continue with: