Skip to content

Configuration

EngramSDK is configured through EngramConfig. This page maps each field to runtime behavior, risk, and production guidance.

Configuration Philosophy

The config surface is intentionally split between:

  • capability controls (provider, keys, network, attestation)
  • safety controls (budget ceiling, renew threshold, safety margin)
  • operational controls (identity path, logs, verbosity, endpoint overrides)

This aligns with the PRD goal: autonomous execution that remains inspectable and bounded.

Production Baseline

ts
import { EngramSDK } from 'engramjs'
import { createProvider } from '@engram-sdk/providers'

const sdk = new EngramSDK({
  storageProvider: await createProvider('synapse'),
  operatorPrivateKey: process.env.OPERATOR_PRIVATE_KEY,
  vincentApiKey: process.env.VINCENT_SECRET_API_KEY,
  network: 'calibration',
  maxSpendUSDFC: 10,
  renewThresholdDays: 14,
  safetyMarginPct: 20,
  attestOnChain: true,
  agentName: 'engram-agent',
  logPath: './agent_log.json',
  verbose: false
})

Baseline Guardrail Presets

Use these as policy-of-operation defaults:

ScenariomaxSpendUSDFCrenewThresholdDayssafetyMarginPctattestOnChain
Local/dev5-101420false
Staging10-5014-2120-25true
Productionenv-specific21-3025-35true

Treat these as starting points; tune with real usage and spend telemetry.

Full EngramConfig Field Reference

FieldTypeDefaultWhy it matters
storageProviderStorageProvidernoneRequired backend for store/retrieve/renew
operatorPrivateKeystringnoneRequired for on-chain identity/index workflows
vincentApiKeystringunsetEnables Vincent wallet flows
network'calibration' | 'mainnet''calibration'Selects chain and defaults
baseRpcUrlstringhttps://sepolia.base.orgBase RPC override
filecoinRpcUrlstringGLIF endpoint by networkFilecoin RPC override
vincentApiBaseUrlstringhttps://heyvincent.aiVincent API override
identityRegistryAddressstringdeployed defaultCustom identity registry
reputationRegistryAddressstringdeployed defaultCustom attestation registry
indexRegistryAddressstringdeployed defaultCustom index pointer registry
agentNamestringengram-memory-agentMetadata and operator clarity
agentMcpPortnumber3456MCP server port
verbosebooleanfalseAdditional diagnostics
walletWalletStubunsetCustom wallet behavior
maxSpendUSDFCnumber10Hard budget cap for spend guard
renewThresholdDaysnumber14Renewal trigger window
safetyMarginPctnumber20Cost estimate buffer
logPathstringunsetStructured operation log destination
autoFundbooleanunsetAllow automatic top-up flow when available
attestOnChainbooleanfalseEmit ERC-8004 operation attestations
identityPathstring.engram/identity.jsonIdentity file isolation per agent

Minimal Config Profiles

Local Unit Testing (No Network)

ts
const sdk = new EngramSDK({
  storageProvider: await createProvider('mock'),
  maxSpendUSDFC: 5
})

Integration Testing (Calibration)

ts
const sdk = new EngramSDK({
  storageProvider: await createProvider('synapse'),
  operatorPrivateKey: process.env.OPERATOR_PRIVATE_KEY,
  vincentApiKey: process.env.VINCENT_SECRET_API_KEY,
  network: 'calibration',
  maxSpendUSDFC: 10,
  attestOnChain: true
})

Production (Mainnet)

ts
const sdk = new EngramSDK({
  storageProvider: await createProvider('synapse'),
  operatorPrivateKey: process.env.OPERATOR_PRIVATE_KEY,
  vincentApiKey: process.env.VINCENT_SECRET_API_KEY,
  network: 'mainnet',
  maxSpendUSDFC: 250,
  renewThresholdDays: 21,
  safetyMarginPct: 25,
  attestOnChain: true,
  identityPath: '/var/lib/engram/agent-a.identity.json',
  logPath: '/var/log/engram/agent-a.jsonl'
})

Environment Variable Mapping (MCP/CLI Flows)

If you run @engram-sdk/mcp, these env vars map to config fields:

Environment VariableConfig field
OPERATOR_PRIVATE_KEYoperatorPrivateKey
VINCENT_SECRET_API_KEYvincentApiKey
ENGRAM_NETWORKnetwork
ENGRAM_MCP_PORTagentMcpPort
ENGRAM_ATTEST_ON_CHAINattestOnChain
ENGRAM_BUDGET_MAX_USDFCmaxSpendUSDFC
ENGRAM_RENEW_THRESHOLD_DAYSrenewThresholdDays
ENGRAM_BUDGET_SAFETY_MARGIN_PCTsafetyMarginPct
ENGRAM_LOG_PATHlogPath
BASE_RPC_URLbaseRpcUrl
FILECOIN_RPC_URLfilecoinRpcUrl
ERC8004_IDENTITY_REGISTRYidentityRegistryAddress
ERC8004_REPUTATION_REGISTRYreputationRegistryAddress

Network and Contract Overrides

Override RPC endpoints and contract addresses only when you intentionally control infrastructure or deploy custom contracts. Keep defaults unless you have a strict reason.

When overriding:

  • pin all related addresses together (identity/reputation/index)
  • record versioned config manifests per environment
  • validate with a canary agent before global rollout

Multi-Agent Hosts

If multiple agents run in one process or pod, each agent needs:

  • unique identityPath
  • unique agentName
  • isolated logs (logPath)
  • clear budget partition (maxSpendUSDFC)

Example:

ts
const agentA = new EngramSDK({
  storageProvider,
  identityPath: '.engram/agent-a.identity.json',
  agentName: 'agent-a',
  logPath: './agent-a.log.json',
  maxSpendUSDFC: 25
})

const agentB = new EngramSDK({
  storageProvider,
  identityPath: '.engram/agent-b.identity.json',
  agentName: 'agent-b',
  logPath: './agent-b.log.json',
  maxSpendUSDFC: 10
})

Dev vs Production

ModeProviderKeysAttestationGoal
Local devmocknoneofffast iteration
Integrationsynapse on calibrationtest keysoptionalend-to-end confidence
Productionsynapse on mainnetmanaged keysondurable operation

Configuration Anti-Patterns

  • sharing one identityPath across multiple autonomous agents
  • leaving maxSpendUSDFC unset in live workflows
  • running production with verbose: true and no log controls
  • enabling attestOnChain without monitoring for tx failures

Released under the MIT License.