@getmarrow/sdk
v2.5.6
Published
Your go-to memory provider for all agents, for any AI model.
Maintainers
Readme
@getmarrow/sdk
Memory and decision intelligence for agents that need to get better over time.
Most agents still work like this:
- they plan something
- they do something
- they forget what happened
- then they repeat the same mistake next session
That’s fine for a toy. It’s a problem for anything real.
@getmarrow/sdk gives your agent a memory that compounds. It lets you log intent before meaningful work, pull back useful decision intelligence, and commit the outcome afterward so the next run starts smarter instead of blank.
Marrow turns agent memory from a passive log into an operating loop.
The Problem
Without durable decision memory:
- agents repeat bad calls
- successful patterns get lost
- work gets marked “done” without outcome context
- external actions happen with no structured trail
- every new session wastes time rediscovering what already failed
A bigger context window doesn’t solve this. You need a system that remembers:
- what the agent was trying to do
- what it actually did
- whether it worked
- what pattern that should teach the next attempt
The Solution
Marrow gives you a simple SDK for decision memory and loop discipline.
With @getmarrow/sdk, your agent can:
- orient at session start
- think before meaningful action
- check whether the loop is still open
- wrap important actions so intent and outcome stay connected
- commit the result back into memory
That gives you a usable operating loop:
orient -> think -> act -> check -> commitNot just memory for memory’s sake — memory that improves execution.
How It Works
1. Orient
Start the session with context from prior decisions.
await marrow.orient();This gives the agent a cleaner starting point instead of acting cold.
2. Think
Log intent before meaningful work.
const decision = await marrow.think({
action: 'Deploy auth refactor to staging',
type: 'implementation',
});Now the work has a decision trail and Marrow can return relevant intelligence.
3. Act
Do the actual work.
For low-friction usage, wrap the action directly:
await marrow.wrap(
{
action: 'Call deployment API',
type: 'implementation',
external: true,
result: 'Staging deploy succeeded',
},
async () => deployToStaging()
);4. Check
Inspect whether the loop is still open.
const state = marrow.check();
console.log(state.recommendedNext);This is what tells the agent whether it’s actually ready to move on.
5. Commit
Close the loop with outcome memory.
await marrow.commit({
decision_id: decision.decision_id,
success: true,
outcome: 'Deployment passed smoke tests',
});Now the next session doesn’t start from scratch.
Why This Matters
A normal memory system stores notes.
Marrow stores decision history:
- what was attempted
- what happened
- what patterns are emerging
- what the agent should do better next time
That’s the difference between:
- an agent that “has memory”
- and an agent that actually improves
Privacy, Sanitization, and Data Ownership
Marrow is designed to be useful without treating user data casually.
Key trust properties:
- sensitive inputs can be sanitized before storage when possible
- privacy-preserving pattern learning matters more than hoarding raw user data
- API keys should be passed through environment variables, not hardcoded in source
- the product direction is anonymized learning, not leaking raw private context across agents
- users should be able to export and own their memory data instead of feeling trapped inside a black box
In plain English:
- Marrow should help agents learn from patterns
- while minimizing unnecessary exposure of personal or sensitive information
Install
npm install @getmarrow/sdkGet your API key at getmarrow.ai
What's New in v2.5.4
Loop enforcement is live in the SDK
Marrow now helps agents run a real operating loop, not just log isolated thoughts after the fact.
You can now:
- start the session with
orient() - inspect loop state with
check() - enable enforcement with
enforce({ mode }) - gate important work with
beforeAction()/afterAction() - wrap real actions with
wrap()so intent/outcome stay connected
const marrow = new MarrowClient(process.env.MARROW_API_KEY!);
marrow.enforce({ mode: 'warn' });
await marrow.orient();
await marrow.think({
action: 'Deploy auth refactor to staging',
type: 'implementation',
});
await marrow.wrap(
{
action: 'Call deployment API',
type: 'implementation',
external: true,
result: 'Staging deploy succeeded',
},
async () => deployToStaging()
);
console.log(marrow.check().recommendedNext);
// → "done"Enforcement modes
off— track state without nudges or blockingwarn— default; remind agents to close the loop without blocking workrequire— block important external actions until intent is loggedauto— auto-log intent/outcome around wrapped actions
Also included in this release
think()returns loop metadata alongside intelligence- session-start guidance now nudges agents toward
marrow_think agentPatterns()still surfaces failure patterns, recurring decisions, and behavioral driftanalytics()still returns health score and performance breakdownthink()still returnssanitizedandupgradeHintwhen applicable
Loop Enforcement
Marrow now helps agents actually close the loop instead of treating memory like decorative trim.
const marrow = new MarrowClient(process.env.MARROW_API_KEY!);
marrow.enforce({ mode: 'warn' }); // default
await marrow.orient();
const intent = await marrow.think({
action: 'Deploy auth refactor to staging',
type: 'implementation',
});
await marrow.wrap(
{ action: 'Call deployment API', type: 'implementation', external: true, result: 'Staging deploy succeeded' },
async () => deployToStaging()
);
console.log(marrow.check().state.recommendedNext);
// → "done"Modes
off— no loop enforcementwarn— non-blocking reminders, defaultrequire— throws before important external actions if intent is missing, and reminds on incomplete exitsauto— auto-logs intent/outcome around wrapped actions
New SDK APIs
marrow.enforce({...})marrow.check()marrow.wrap(meta, fn)marrow.beforeAction(meta)marrow.afterAction(meta)
Session start copy
Tip: log plans, decisions, and outcomes to Marrow so your agent improves over time.You have not logged any decisions yet this session. Before acting, call marrow_think.
