Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @thinkfleet/memory-sdk

TypeScript SDK for [memory.thinkfleet.ai](https://memory.thinkfleet.ai) β€” a managed memory + behavioral-pattern engine for AI agents.
TypeScript SDK for [app.memmesh.ai](https://app.memmesh.ai) β€” a managed memory + behavioral-pattern engine for AI agents.

Two resources:
- **`memory`** β€” admin + project memory CRUD, semantic search, promote/confirm/reject workflow, feedback
Expand Down Expand Up @@ -54,7 +54,7 @@ const hits = await tf.memory.admin.search({
const tf = new ThinkFleetMemory({
apiKey: 'sk-...', // Required
projectId: 'proj_...', // Required default
baseUrl: 'https://memory.thinkfleet.ai', // Default
baseUrl: 'https://app.memmesh.ai', // Default
maxRetries: 2, // Retries 429/5xx with backoff
timeout: 30_000, // ms
fetch: globalThis.fetch, // BYO fetch
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ npx tsx examples/financial-demo.ts --fetch-only
# Full end-to-end (needs a project with @thinkfleet/pack-financial enabled):
export THINKFLEET_API_KEY="sk-..."
export THINKFLEET_PROJECT_ID="..."
export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
export DEMO_TICKERS="AAPL,MSFT,NVDA" # optional
npm run demo:financial
```
Expand Down Expand Up @@ -70,7 +70,7 @@ npm install # pulls @anthropic-ai/sdk + zod (dev deps for this example)
export THINKFLEET_API_KEY="sk-..."
export THINKFLEET_PROJECT_ID="..."
export ANTHROPIC_API_KEY="sk-ant-..."
export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
npm run demo:nbo
```

Expand Down
6 changes: 3 additions & 3 deletions examples/financial-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Usage:
* export THINKFLEET_API_KEY="sk-..."
* export THINKFLEET_PROJECT_ID="..." # must have @thinkfleet/pack-financial enabled
* export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
* export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
* export DEMO_TICKERS="AAPL,MSFT,NVDA" # optional
* npx tsx examples/financial-demo.ts
*
Expand All @@ -34,7 +34,7 @@ import type { PriceInput, NewsInput } from '../src/index.js'
const FETCH_ONLY = process.argv.includes('--fetch-only')
const API_KEY = process.env.THINKFLEET_API_KEY
const PROJECT_ID = process.env.THINKFLEET_PROJECT_ID
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://memory.thinkfleet.ai'
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://app.memmesh.ai'
const TICKERS = (process.env.DEMO_TICKERS ?? 'AAPL,MSFT,NVDA')
.split(',')
.map((t) => t.trim().toUpperCase())
Expand All @@ -48,7 +48,7 @@ if (!FETCH_ONLY && (!API_KEY || !PROJECT_ID)) {
console.error('Missing required environment variables:')
console.error(' THINKFLEET_API_KEY=sk-...')
console.error(' THINKFLEET_PROJECT_ID=... (project must have @thinkfleet/pack-financial enabled)')
console.error(' THINKFLEET_BASE_URL=https://memory.thinkfleet.ai (optional)')
console.error(' THINKFLEET_BASE_URL=https://app.memmesh.ai (optional)')
console.error('\nOr run the data-pull half only: npx tsx examples/financial-demo.ts --fetch-only')
process.exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion examples/next-best-offer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* Usage:
* export THINKFLEET_API_KEY="sk-..."
* export THINKFLEET_PROJECT_ID="..."
* export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
* export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
* export ANTHROPIC_API_KEY="sk-ant-..."
* npx tsx examples/next-best-offer.ts
*
Expand Down
4 changes: 2 additions & 2 deletions examples/predict-anything.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Usage:
* export THINKFLEET_API_KEY="sk-..."
* export THINKFLEET_PROJECT_ID="..."
* export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
* export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
* export DEMO_SUBJECT="customer:acct-42" # optional, kind:externalId
* npx tsx examples/predict-anything.ts
*/
Expand All @@ -32,7 +32,7 @@ import type { PredictionTarget, TargetPrediction, Subject } from '../src/index.j

const API_KEY = process.env.THINKFLEET_API_KEY
const PROJECT_ID = process.env.THINKFLEET_PROJECT_ID
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://memory.thinkfleet.ai'
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://app.memmesh.ai'

const [subjectKind, subjectId] = (process.env.DEMO_SUBJECT ?? 'customer:acct-42').split(':')
const SUBJECT: Subject = { kind: subjectKind, externalId: subjectId }
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@thinkfleet/memory-sdk",
"version": "0.4.0",
"description": "TypeScript SDK for memory.thinkfleet.ai β€” admin + project memory CRUD, semantic search, feedback, and Lattice behavioral patterns",
"version": "0.4.1",
"description": "TypeScript SDK for app.memmesh.ai β€” admin + project memory CRUD, semantic search, feedback, and Lattice behavioral patterns",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down
8 changes: 4 additions & 4 deletions scripts/seed-lattice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* (the same UI surface β€” patterns ARE memories on the storage side)
*
* Usage:
* API_KEY=sk-... PROJECT_ID=proj_... BASE_URL=https://memory.thinkfleet.ai \
* API_KEY=sk-... PROJECT_ID=proj_... BASE_URL=https://app.memmesh.ai \
* npx tsx scripts/seed-lattice.ts
*
* Flags:
Expand All @@ -29,13 +29,13 @@ import { ThinkFleetMemory, MemoryItemType, MemoryScope } from '../src/index.js'

const API_KEY = process.env.API_KEY ?? process.env.THINKFLEET_API_KEY
const PROJECT_ID = process.env.PROJECT_ID ?? process.env.THINKFLEET_PROJECT_ID
const BASE_URL = process.env.BASE_URL ?? process.env.THINKFLEET_BASE_URL ?? 'https://memory.thinkfleet.ai'
const BASE_URL = process.env.BASE_URL ?? process.env.THINKFLEET_BASE_URL ?? 'https://app.memmesh.ai'

if (!API_KEY || !PROJECT_ID) {
console.error('Missing required environment variables:')
console.error(' API_KEY=sk-...')
console.error(' PROJECT_ID=proj_...')
console.error(' BASE_URL=https://memory.thinkfleet.ai (optional)')
console.error(' BASE_URL=https://app.memmesh.ai (optional)')
process.exit(1)
}

Expand Down Expand Up @@ -154,7 +154,7 @@ async function seedSubject(spec: SubjectSpec): Promise<number> {
// ── Main ────────────────────────────────────────────────────────────

async function main(): Promise<void> {
console.log('memory.thinkfleet.ai lattice seed script')
console.log('app.memmesh.ai lattice seed script')
console.log(` base: ${BASE_URL}`)
console.log(` project: ${PROJECT_ID}`)

Expand Down
8 changes: 4 additions & 4 deletions scripts/seed-memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Theme: AI-engineering team's institutional knowledge base.
*
* Usage:
* API_KEY=sk-... PROJECT_ID=proj_... BASE_URL=https://memory.thinkfleet.ai \
* API_KEY=sk-... PROJECT_ID=proj_... BASE_URL=https://app.memmesh.ai \
* npx tsx scripts/seed-memory.ts
*
* Flags:
Expand All @@ -21,13 +21,13 @@ import { ThinkFleetMemory, MemoryItemType, MemoryScope } from '../src/index.js'

const API_KEY = process.env.API_KEY ?? process.env.THINKFLEET_API_KEY
const PROJECT_ID = process.env.PROJECT_ID ?? process.env.THINKFLEET_PROJECT_ID
const BASE_URL = process.env.BASE_URL ?? process.env.THINKFLEET_BASE_URL ?? 'https://memory.thinkfleet.ai'
const BASE_URL = process.env.BASE_URL ?? process.env.THINKFLEET_BASE_URL ?? 'https://app.memmesh.ai'

if (!API_KEY || !PROJECT_ID) {
console.error('Missing required environment variables:')
console.error(' API_KEY=sk-...')
console.error(' PROJECT_ID=proj_...')
console.error(' BASE_URL=https://memory.thinkfleet.ai (optional)')
console.error(' BASE_URL=https://app.memmesh.ai (optional)')
process.exit(1)
}

Expand Down Expand Up @@ -202,7 +202,7 @@ async function cleanupSeed(): Promise<number> {
// ── Main ────────────────────────────────────────────────────────────

async function main(): Promise<void> {
console.log(`memory.thinkfleet.ai seed script`)
console.log(`app.memmesh.ai seed script`)
console.log(` base: ${BASE_URL}`)
console.log(` project: ${PROJECT_ID}`)

Expand Down
6 changes: 3 additions & 3 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface ThinkFleetMemoryOptions {
apiKey: string
/** Default project ID for all requests. Can be overridden per-call via `{ projectId: ... }`. */
projectId: string
/** Base URL of the memory.thinkfleet.ai API. Default: `https://memory.thinkfleet.ai`. */
/** Base URL of the app.memmesh.ai API. Default: `https://app.memmesh.ai`. */
baseUrl?: string
/** Retries 429 + 5xx with exponential backoff. Default 2. */
maxRetries?: number
Expand All @@ -32,7 +32,7 @@ export interface ThinkFleetMemoryOptions {
}

/**
* TypeScript client for memory.thinkfleet.ai.
* TypeScript client for app.memmesh.ai.
*
* Exposes two resources:
* - `memory` β€” admin + project memory CRUD, semantic search, feedback
Expand Down Expand Up @@ -76,7 +76,7 @@ export class ThinkFleetMemory {
const http = new HttpClient({
apiKey: options.apiKey,
projectId: options.projectId,
baseUrl: (options.baseUrl ?? 'https://memory.thinkfleet.ai').replace(/\/+$/, ''),
baseUrl: (options.baseUrl ?? 'https://app.memmesh.ai').replace(/\/+$/, ''),
maxRetries: options.maxRetries ?? 2,
timeout: options.timeout ?? 30000,
fetchFn: options.fetch ?? globalThis.fetch.bind(globalThis),
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lattice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {
} from '../types/lattice.js'

/**
* Lattice β€” behavioral pattern intelligence for memory.thinkfleet.ai.
* Lattice β€” behavioral pattern intelligence for app.memmesh.ai.
*
* Mines a contact's event history for repeatable behaviors and exposes
* a context bundle the agent can hand to a message-rendering step.
Expand Down
2 changes: 1 addition & 1 deletion src/resources/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function toBase64(bytes: Uint8Array): string {
}

/**
* Memory β€” primary surface for memory.thinkfleet.ai.
* Memory β€” primary surface for app.memmesh.ai.
*
* Two sub-resources:
* - `tf.memory` (this class) β€” current-user memories at
Expand Down
2 changes: 1 addition & 1 deletion src/types/lattice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Lattice β€” behavioral pattern intelligence.
*
* Types mirror what the memory.thinkfleet.ai backend exposes at
* Types mirror what the app.memmesh.ai backend exposes at
* `/api/v1/projects/{projectId}/lattice/*`. The server-side
* implementation is TS today; cuts over to a Rust gRPC engine in a
* follow-up.
Expand Down
10 changes: 5 additions & 5 deletions test-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
/**
* @thinkfleet/memory-sdk β€” integration smoke test
*
* Exercises every public SDK method against a live memory.thinkfleet.ai
* Exercises every public SDK method against a live app.memmesh.ai
* instance. Read-mostly, with one create+update+delete cycle so the
* project is left in the same state it started.
*
* Usage:
* export THINKFLEET_API_KEY="sk-..."
* export THINKFLEET_PROJECT_ID="..."
* export THINKFLEET_BASE_URL="https://memory.thinkfleet.ai" # optional
* export THINKFLEET_BASE_URL="https://app.memmesh.ai" # optional
* npx tsx test-app.ts
*
* Exit code 0 = all checks passed, 1 = at least one failed. Failures
Expand All @@ -23,13 +23,13 @@ import { ThinkFleetMemory, MemoryItemType, MemoryScope } from './src/index.js'

const API_KEY = process.env.THINKFLEET_API_KEY
const PROJECT_ID = process.env.THINKFLEET_PROJECT_ID
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://memory.thinkfleet.ai'
const BASE_URL = process.env.THINKFLEET_BASE_URL ?? 'https://app.memmesh.ai'

if (!API_KEY || !PROJECT_ID) {
console.error('Missing required environment variables:')
console.error(' THINKFLEET_API_KEY=sk-...')
console.error(' THINKFLEET_PROJECT_ID=...')
console.error(' THINKFLEET_BASE_URL=https://memory.thinkfleet.ai (optional)')
console.error(' THINKFLEET_BASE_URL=https://app.memmesh.ai (optional)')
process.exit(1)
}

Expand Down Expand Up @@ -67,7 +67,7 @@ function section(title: string): void {
// ── Checks ──────────────────────────────────────────────────────────

async function run(): Promise<void> {
console.log(`memory.thinkfleet.ai SDK smoke test`)
console.log(`app.memmesh.ai SDK smoke test`)
console.log(` base: ${BASE_URL}`)
console.log(` project: ${PROJECT_ID}`)

Expand Down
Loading