Saving References - My First OpenClaw UseCase

In the last days, Paul Solt (https://x.com/PaulSolt) got into OpenClaw and tried to find out: What the heck do all these people do with OpenClaw ?! I couldn’t resist the urge to jump in and answer some of his questions:

But this was still too broad for him. So I’ll got nerd-sniped to quickly write this little blogpost for him, despite needing to pack my stuff for moving! 😅 Simply can’t resist and love the energy when I’m getting excited with someone over a topic I love. 😋

What is the UseCase?

I constantly see exciting projects when scrolling through bluesky and x, especially now in the AI age. For over 50% of them I think: “I might need this in project x”, or “I could go deeper into this for research” or “this could be a business idea i want to try!. But the issue is: where to store those “References” to not get lost?

Things I tried:

This got me thinking: Why do I even feel the urge to store these links, when I never come back to them? Because they would allow me to stand on the shoulders of giants instead of reinventing the wheel for every side project. So, the organization of my “References” should not be about “where they come from”, but “why did I save it in the first place?”.

The Solution: OpenClaw!

Agents are insanely good to sift through structured (or even unstructured) data and only surface the relevant bits needed for a task at hand. We only need to teach them WHEN they should read the data, so they don’t read all your References you ever created in every chat, but are able to progressively discover them. So the dream idea would be: I’m randomly talking to my agent about a topic and since he knows all my references, he might go in there and search for things adjacent to the topic and simply surfacing these References to me! No more digging throguh a pile of bookmarks in Raindrop or searching for hours in obsidian!

Example nb references notes list

Example nb references notes list

My Data Format

My main unit of operation is a “Reference”. It stores:

type Reference = {
  // A descriptive title for the reference, should be short, mostly double-use as filename
  name: string, 
  // A short, 1 to 3 sentences description of the content
  description: string, 
  // When this reference was saved
  date: string;
  // A summary of the content (I also tried to bake in some archival characteristics)
  summary?: string
  // MOST IMPORTANT: an Anchor to know when to surface the Reference!
  anchor: string;
}

I deliberately called it “Reference” since I want to store anything inside there:

What is an “Anchor”?

An Anchor is my concept to tell the agent when a certain Reference should be surfaced. It’s something like “anchor: if I ever get around doing my balcony renovation”, or “anchor: if I have a house with garden and want to plant trees”. This couples the original context for the information with “why exactly is that information relevant to me and my life?”.

How did I implement it?

  1. Install nb cli (probably also works with obsidian cli now)

  2. Let the agent add rules to it’s AGENTS.md

  1. Simplest form: simply also add instructions to the agent for how to deal with the “reference” notebook in nb-cli in it’s AGENTS.md
If the user starts a message with "reference", store it into the "nb references" notebook as markdown file and add a yaml frontmatter block with the following metadata:

---
name: A descriptive title for the reference, should be short and dual-purpose as filename
description: A short, 1 to 3 sentences description of the content
anchor: MOST IMPORTANT: an Anchor to know when to surface the Reference!
date: When this reference is saved 
url?: If the reference has an url, store it here!
--- 
  1. Below the rules for the frontmatter block you can add more rules for different types of content (these are only examples, extend as you see fit!)
 If the reference is 
 - a youtube video, use the summarize cli to get a max. 500 char summary of the content and store it in the body of this note. 
 - a simple user text: store it ad-verbatim 
 - a link to a blogpost: download a complete copy of the blogpost with the markit cli and store it in this note
  1. As you see, the rules for such a workflow could get long and clutter the context openclaw has to load on each new session. To solve this you can wrap these instructions into a custom skill. I would call mine jb-reference workflow. Then you only need the “hook” for openclaw, when to use the skill in AGENTS.md: user message starts with "reference:" use the jb-reference-workflow skill

  2. Recalling might happen automatically (the smarter the model gets, the more it realizes that it might need/want to search through nb notebooks if asked questions). If not, simply add another “retrieval hook” into the AGENTS.md: If the user asks for information, guidance, instructions or similar, always use the nb skill to search through our "nb references" notebook for existing references for the topic at hand.

These prompts are only a starting point, I myself refine them often, basically every time the agent does something stupid.

The Result

Two days ago I had a pretty nice moment which exactly showcases this workflow (The recreation is translated from german and a little shortened, but the end result stays)!

I asked it:

What is the status for WASI (Web assembly system interface)?

It answered and asked

Do you have a specific project/use-case in mind?

I said:

No, i only thought about the fact, that some people already use wasm to isolate workloads instead of Docker. I think about running pi agent in a wasm sandbox. Sounds nice for ai isolation

And it answered:

Yes, exactly! That would be perfect - we even have a reference for this already: nb-references:350 - agentOS (rivet-dev/agent-os) < … more info about this note>

Agent successfully recalling a saved reference from nb