@smritheon/memora-core
v0.2.1
Published
Memora SDK: verifiable agent provenance via gateway (baseUrl + apiKey). Write, query, read, verify.
Readme
@smritheon/memora-core
Package: npmjs.com/package/@smritheon/memora-core
Memora SDK — add verifiable execution provenance to existing workflows without rewriting them. Works beside Temporal, LangGraph, CrewAI, Dapr, and custom agent runtimes. Does not replace orchestration.
Documentation
- Hosted console docs: getmemora.dev/docs
- Full SDK reference: docs/SDK.md
- Missions vs on-chain scope: docs/MISSION-AND-ONCHAIN.md
- Protocol spec: SPEC.md
Install
npm install @smritheon/memora-core
# or
pnpm add @smritheon/memora-coreQuickstart (hosted)
Get a per-agent API key from getmemora.dev → Identities → Credentials.
import { Memora } from "@smritheon/memora-core";
const memora = new Memora({
agentId: process.env.MEMORA_AGENT_ID!, // from console
apiKey: process.env.MEMORA_API_KEY!, // per-agent key from console
// Self-hosted: add baseUrl: process.env.MEMORA_BASE_URL // e.g. https://api.your-domain.com
});
const result = await memora.trace("my-run", async (trace) => {
await trace.event("task_started", { ts: Date.now() });
const output = await yourExistingWorkflow();
await trace.event("task_completed", { status: "success" });
return output;
});Add Memora without rewriting your workflow
// Drop-in wrapper — call site unchanged
const analyseRisk = memora.wrap("risk-analysis", existingAnalyser);
const result = await analyseRisk(portfolio);
// Custom event granularity
const decision = await memora.trace("treasury-rebalance", async (trace) => {
await trace.event("input_received", { input });
const outcome = await existingWorkflow(input);
await trace.event("decision_made", { outcome });
return outcome;
});
// Tool calls with input/output hashing
const transfer = memora.tool("transfer_funds", async (args) => bankTransfer(args));
const receipt = await transfer({ amount: 100, to: "0x..." });Integration API
| Method | Purpose |
| ------------------------- | ---------------------------------------------------------------------------------- |
| memora.trace(runId, fn) | Wrap any function in a traced run. Explicit event granularity via trace.event(). |
| memora.wrap(name, fn) | Drop-in wrapper. Records start/complete/failed automatically. |
| memora.tool(name, fn) | Tool call wrapper. Records input hash, output hash, duration. |
Memora is not an orchestrator
Memora adds provenance, replay, and attestation to whatever you already run. It does not manage retries, state, or scheduling.
| Your stack | Memora adds | | --------------------------- | ---------------------- | | Temporal / LangGraph / Dapr | Execution provenance | | Custom agent runtime | Signed event lineage | | Any async TypeScript | Replayable audit trail |
Configuration
| Option | Required | Description |
|--------|----------|-------------|
| agentId | Yes | Agent UUID from web console |
| apiKey | Yes (writes) | Per-agent key → Authorization: Bearer |
| baseUrl | No | Memora API URL — defaults to https://api.getmemora.dev for hosted |
| ipfsGatewayUrl | No | IPFS gateway for decrypting stored payloads (optional) |
Deprecated MemoraConfig.mode and MemoraConfig.backend are ignored. Integrity and provenance policy are set in the web console, not the SDK.
For low-level write / query / read / verify, use memora.client or see the full SDK reference.
Deployment policy (console + indexer)
Provenance backend and integrity mode are configured in the web console — not in the SDK.
| Setting | Where | Values |
| ------------------ | --------------------------- | ---------------------------------- |
| Provenance backend | Workspace → Settings | enterprise or hedera |
| Integrity mode | Agent detail → Write policy | standard, attested, verified |
The SDK sends writes; the indexer enforces policy. See the full SDK reference for write/query/read/verify details.
Replay
Verify any execution record with the Memora CLI:
pnpm --filter @memora/cli -- replay verify --memory <event_id>Self-hosting
Deploy Memora from the memora repository:
Point the SDK at your deployment:
const memora = new Memora({
agentId: process.env.MEMORA_AGENT_ID!,
apiKey: process.env.MEMORA_API_KEY!,
baseUrl: "https://api.your-domain.com",
});License
Licensed under the Apache License, Version 2.0. See LICENSE and the memora repository.
