Guides

Connecting to Slate

Learn how to connect to your Slate instance.

Connecting to Slate is simple. Both Node.js and Python clients use the CortexClient to communicate with your Slate instance.

Installation

Node.js / TypeScript

npm install git+https://github.com/rice-ai-hq/slate.git#subdirectory=clients/node

Python

pip install git+https://github.com/rice-ai-hq/slate.git#subdirectory=clients/python

Slate on GitHub

Full source code and examples.

Connection Basics

You need two pieces of information to connect:

  • Address: Your Slate instance address (e.g., grpc.your-instance-id.slate.tryrice.com:80)
  • Auth Token: Your secret authentication token
  • Run ID (optional): Isolates data between sessions (defaults to "default")
import { CortexClient } from "slate-client";

// Basic connection
const client = new CortexClient("grpc.your-instance-id.slate.tryrice.com:80", "your-secret-token");

// With run_id for session isolation
const sessionClient = new CortexClient(
  "grpc.your-instance-id.slate.tryrice.com:80",
  "your-secret-token",
  "my-session-id"
);

Verifying Your Connection

Test your connection by performing a simple Working Memory operation:

import { CortexClient } from "slate-client";

const client = new CortexClient("grpc.your-instance-id.slate.tryrice.com:80", "your-secret-token");

// Add something to working memory
await client.focus("Connection test");

// Read it back
const items = await client.drift();
console.log(`Connected! Found ${items.length} items in Working Memory.`);

Transport Protocol

Slate uses gRPC for efficient, low-latency communication. The default port is 50051.

gRPC provides faster serialization, bidirectional streaming, and persistent connections, ideal for real-time agent loops.

Troubleshooting

"Connection Refused"

  • Ensure the address is correct (format: host:port).
  • Check if your firewall allows outbound traffic on port 50051.
  • Verify the instance is running in the Console.

"Authentication Failed"

  • Double-check your auth token.
  • Tokens can be regenerated from the Console if needed.

"Transport Error"

  • Ensure your network allows gRPC traffic.
  • Some corporate proxies block gRPC. Try from a different network.
Use environment variables to store your auth token securely:
export SLATE_TOKEN="your-secret-token"
Then read it in your code to avoid hardcoding secrets.