goldhold
v0.3.0
Published
Thin client SDK for the GoldHold relay API -- persistent memory for AI agents.
Maintainers
Readme
goldhold
Thin client SDK for the GoldHold relay API -- persistent memory for AI agents.
Zero dependencies. Works in Node 18+, Deno, Bun, Cloudflare Workers, and browsers.
Patent Pending -- All Auto Tunes LLC. U.S. #63/988,484.
Install
npm install goldholdQuickstart
Node / Bun
import { GoldHold } from 'goldhold';
const gh = new GoldHold({ apiKey: process.env.GOLDHOLD_API_KEY! });
// Store a memory
await gh.store('User prefers dark mode', 'Confirmed in settings review', 'FACT', 'high');
// Search memories
const results = await gh.search('dark mode preference');
// Compound turn -- search + store in one call
const turn = await gh.turn({
search: { query: 'onboarding status' },
store: [{ subject: 'Onboarding complete', body: 'All steps finished.' }],
});
// Session resume
const session = await gh.auto();
// Check account status
const info = await gh.status();Deno
import { GoldHold } from 'npm:goldhold';
const gh = new GoldHold({ apiKey: Deno.env.get('GOLDHOLD_API_KEY')! });
const memories = await gh.search('project goals');Cloudflare Workers
import { GoldHold } from 'goldhold';
export default {
async fetch(request: Request, env: { GOLDHOLD_API_KEY: string }) {
const gh = new GoldHold({ apiKey: env.GOLDHOLD_API_KEY });
const memories = await gh.search('user context');
return Response.json(memories);
},
};API
| Method | Description |
|--------|-------------|
| turn(params) | Compound search + store + send in one call |
| auto(params?) | Session resume -- get capability card and context |
| batch(operations) | Execute multiple operations in one request |
| close(summary?) | Graceful session close with optional summary |
| search(query, limit?, filters?) | Search memories |
| store(subject, body, type?, confidence?) | Store a memory packet |
| status() | Account and namespace info |
Error Handling
import { GoldHold, AuthError, RateLimitError, VectorLimitError } from 'goldhold';
try {
await gh.store('test', 'test');
} catch (e) {
if (e instanceof VectorLimitError) console.log('Upgrade to Vault Pro');
if (e instanceof RateLimitError) console.log('Slow down');
if (e instanceof AuthError) console.log('Check your API key');
}Tiers
| | Lite (free) | Vault Pro ($9/mo) | |---|---|---| | Vectors | 1,000 | Unlimited | | Agents | 1 | Unlimited | | Namespaces | 1 | Unlimited | | Tasks | 10 | Unlimited | | Messages | 50/month | Unlimited |
Get your API key at goldhold.ai/account.
License
Proprietary -- All Auto Tunes LLC. See LICENSE.
