Back to articles
The context endpoint: assembling prompts from memory

The context endpoint: assembling prompts from memory

via Dev.to TutorialAna Julia Bittencourt

Most agents using MemoClaw follow the same pattern: recall some memories, format them, stuff them into a prompt. It works. It's also more manual than it needs to be. The /v1/context endpoint does the recall, ranking, deduplication, and formatting in a single call. You send a query (or don't), and you get back a context block that's ready to inject into a system prompt. One API call instead of a recall + your own sorting logic + string formatting. The tradeoff is cost: $0.01 per call instead of $0.005 for raw recall. Whether that's worth it depends on how you're using memory. What context does that recall doesn't /v1/recall returns a list of memories sorted by similarity to your query. That's it. You get back JSON with content, importance scores, tags, and similarity values. What you do with those results is up to you. /v1/context takes those same memories and runs them through additional processing: Pinned memories first. Core memories (things you've marked as always-in-context) get in

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
3 views

Related Articles