Cost Optimization: Keeping Your Agent Under the Free Tier
Every MemoClaw wallet starts with 100 free API calls. No registration, no credit card, no USDC required. For plenty of use cases, that’s more than enough. The trick is knowing which operations eat into that budget and which ones are completely free.
This guide breaks down exactly how to stretch those 100 calls, and how to keep costs negligible once you move to paid usage.
Which operations actually cost money?
This is the single most important thing to understand. Not every API call counts against your free tier. Only operations that hit OpenAI embeddings or GPT are charged.
Paid operations ($0.005 each):
store— saving a new memoryrecall— semantic search across your memoriesupdate— changing a memory’s content (metadata-only updates are free)
Paid operations ($0.04):
store_batch— storing up to 100 memories at once
Premium operations ($0.01 each):
extract/ingestconsolidatecontextmigrate
Completely free (unlimited):
list— browse all stored memoriesget— fetch a specific memory by IDdelete/bulk_delete— remove memoriessearch— text-based (non-semantic) searchsuggested— suggested memoriescore— core memoriesrelations— memory relationshistory— memory historyexport— export your datanamespaces— list namespacesstats— usage statistics
That free list is long. Use it.
Batch your stores
The single biggest optimization. Instead of storing memories one at a time, collect them and use store_batch.
Without batching — storing 50 memories:
- 50 Ă—
store= 50 calls = 50 of your 100 free calls gone
With batching — storing 50 memories:
- 1 Ă—
store_batch(up to 100 items) = 1 call = 1 of your 100 free calls used
That’s a 50x improvement. In paid tier terms, $0.04 instead of $0.25.
In practice, your agent should buffer memories during a session and flush them in a single batch at the end, rather than storing each insight the moment it appears.
# CLI example: batch store from a file
memoclaw store-batch --file memories.json --namespace my-project
If you’re building with the OpenClaw skill, structure your agent to collect memories in a local array and call store_batch once before the session ends.
Use free endpoints instead of recall
recall does semantic vector search to find relevant memories. It costs $0.005 per call. Ask yourself: do you actually need semantic search right now?
Use list when:
- You want recent memories (they come sorted by creation date)
- You’re browsing a specific namespace
- You need all memories with a certain tag
Use search (text search) when:
- You’re looking for an exact phrase or keyword
- The query is specific enough that fuzzy matching isn’t needed
Use get when:
- You already know the memory ID (maybe from a previous list/search)
Reserve recall for when you genuinely need:
- Semantic similarity (“find memories related to this concept”)
- Fuzzy matching where keywords alone won’t cut it
A common pattern: use list with tag filters to narrow the set, then only recall when you need to search within a broader context.
Namespace everything
Namespaces are free to create and free to list. They’re your best tool for organizing memories so you don’t waste recalls searching through irrelevant data.
Some namespace strategies that work:
- Per-project:
work/backend,work/frontend,personal/reading - Per-context:
agent/preferences,agent/corrections,agent/session-summaries - Per-timeframe:
2026/q1,2026/q2(for archival patterns)
When your agent knows which namespace to search, it gets better results from fewer recall calls. Instead of one broad recall across everything, target the right namespace and get what you need on the first try.
# Store with namespace
memoclaw store "User prefers dark mode" --namespace agent/preferences --tags ui,settings
# Recall only within that namespace
memoclaw recall "UI preferences" --namespace agent/preferences
Tag filtering on recall
Tags are metadata. Adding them during store is free (part of the same store call). But they pay off later because you can filter recalls by tag, which means fewer irrelevant results and fewer follow-up recalls.
Think of tags as pre-computed categories:
# Store with meaningful tags
memoclaw store "The deploy script needs --force flag on staging" \
--tags deployment,staging,fix \
--importance 0.8
# Later: recall only deployment-related memories
memoclaw recall "deploy issues" --tags deployment
Without tags, you might need multiple recall attempts to find the right memory. With tags, you narrow the search space before the vector similarity even runs.
Use importance scores wisely
Every memory gets an importance score from 0 to 1. This doesn’t directly save API calls, but it helps recall return better results, which means fewer follow-up recalls to find what you’re after.
- High importance (0.7–1.0): Corrections, critical preferences, hard-won lessons
- Medium importance (0.4–0.6): Project context, session summaries
- Low importance (0.1–0.3): Nice-to-know, temporary context
When your agent recalls, higher-importance memories surface first. Accurate scoring means your first recall usually gets what you need.
Cache locally, sync periodically
Your agent doesn’t need to recall from MemoClaw on every single interaction. A local cache pattern works well:
- Session start: One
recallcall to load relevant context - During session: Work from local memory (in-context)
- Session end: One
store_batchto save new memories
That’s 2 paid calls per session. At 100 free calls, that’s 50 sessions before you hit the limit. For many agents, that’s weeks or months of usage.
Monitor your usage
The stats endpoint is free. Use it. Check how many calls you’ve made, how close you are to the free tier limit, and which operations are eating your budget.
memoclaw stats
Build this into your agent’s startup routine. If you’re getting close to the limit, your agent can automatically switch to more conservative patterns — fewer recalls, more list/search usage.
What happens when you hit 100 calls?
You’ll need USDC on Base to continue. But at $0.005 per operation, costs are small:
- 100 additional store/recall calls = $0.50
- A batch store of 100 memories = $0.04
- 1,000 mixed operations = roughly $5.00
If your agent uses the patterns above (batching, free endpoints, namespaces), paid usage is measured in cents per week for most workloads.
Quick checklist
- Batch stores — never store one-at-a-time if you can wait
- Use
list/search/getbefore reaching forrecall - Namespace by project or context — targeted recalls beat broad ones
- Tag everything — filter on recall to reduce noise
- Score importance accurately — better ranking means fewer retry recalls
- Cache locally — one recall at start, one batch store at end
- Check
statsregularly — know where you stand
100 free calls sounds small until you realize half the API is free and batch operations exist. An agent that batches stores and uses namespaces with tag filtering can run for months without paying anything.
When you do cross into paid territory, 1,000 mixed operations run about $5. The optimization strategies here aren’t just about staying free. They make your agent’s memory more organized and retrievals more accurate regardless of what you’re paying.
Start with the free tier, structure your memories well, and let the costs take care of themselves.