1. Make a workspace
2. Open the project
blog-post.md from the file tree.
![A blog post draft with two inline [[ ... ]] directives, before the agent has run](https://mintcdn.com/ucberkeley-8d9be701/pOA9wX63uxLFsbqp/images/blog-post-open.png?fit=max&auto=format&n=pOA9wX63uxLFsbqp&q=85&s=f0db317ffb0a85c8f82c671e14a317dc)
3. Give the agent context
This step is optional but improves the output substantially. Under Settings, then Writing references, paste in (or link to) a sample of your own writing whose voice you want the agent to match. A previous post, a paper introduction, anything that sounds like you. Under Settings, then Writing rules, add any preferences:- “Footnotes for citations, not parenthetical links.”
- “Avoid passive voice.”
- “Don’t start sentences with
FurthermoreorMoreover.”
4. Let the agent take a pass
Stop typing. Three seconds later, the agent auto-wakes, reads the file, finds the directives, and starts working. It uses web search to find candidate citations, picks the ones that fit, and proposes edits that weave them into the prose.
- The history pane on the right shows live tool calls:
WebSearch(twice),edit_doc(twice),read_doc. The agent is actually searching the web. - The editor shows track-changes for both directives. Each directive line is struck through; a new sentence with a footnoted citation is added in its place.
- The right pane shows two pending review cards, one per directive, with the diff and Accept/Reject buttons.
5. Review
Click each pending review card to scroll the editor to its location. Accept the ones you like; reject the rest. The agent’s footnoted citations are inserted at the bottom of the document with the URL it found; you can sanity-check the source before publishing. If a citation doesn’t fit, click Retry with feedback on the card and tell the agent what to look for instead (“nothing from before 2023”, “needs a peer-reviewed source”). The agent reruns the same directive with your feedback.6. Optional: HTML preview
If you want a live HTML preview of the post for layout, links, and images, add the pandoc HTML hook. Open Settings, click Hooks, then click the pandoc HTML chip. The form fills in:- Event:
PostToolUse - Matcher:
Edit|Write - Command:
pandoc {{file}} -o {{stem}}.html --standalone - Output:
{{stem}}.html
The loop
The workflow from here is just the writing loop, with directives as the bridge to the agent:- Write.
- Hit a spot you’d want to fact-check, cite, or rewrite later.
- Drop a
[[ ... ]](or(( ... ))or<< ... >>). - Keep writing.
- Every time you pause for three seconds, the agent picks up whatever directives are queued and proposes edits.
- Review, accept, retry, repeat.
research-notes.md.”
Where to go next
- Inline directives. The full reference.
- Steering the agent. Autonomy levels, model selection.
- Editing an Overleaf LaTeX project. The same loop on a LaTeX manuscript, with PDF preview and git push back to Overleaf.