Blog
← Back to Blog

From Code Sessions to Published Posts: Building a Blog Curator Agent

/ waniwira / #ai#agents#blogging#automation

I explore things using AI coding tools. I find interesting stuff. But I hate writing.

Sound familiar? You spend hours debugging, experimenting, and discovering cool technical insights. Then the hard part begins: turning those findings into something shareable.

What if an agent could help?

The Simple Idea

I built a tool that reads my coding sessions, asks me what I found interesting, and helps me write it down.

That's it. No complex architecture. No magic. Just a simple workflow:

ReadExtractAskVerifyCurate

Here's how it works:

  1. Read the session database — Every conversation I have with my AI coding tool gets stored in a SQLite database. I built a Python script that queries this database to find sessions by name or keyword.

  2. Extract key moments — The tool pulls out the important parts: decisions made, problems solved, interesting findings. Not everything—just the highlights.

  3. Ask the human — Before writing anything, the agent asks me: What did you find interesting? Who's this for? What depth do you want? This prevents wasted drafts.

  4. Verify with web search — The agent searches the internet to cross-check my findings. Did I get that API right? Is this best practice still current? This catches mistakes before they become published.

  5. Curate the words — Finally, the agent helps structure my raw thoughts into something readable. Not writing for me—writing with me.


That's the whole idea. If you're a technical person who hates writing, this pattern works. You provide the insights. The agent provides the structure.


How It Actually Works

Let me break down the technical layer—no code, just concepts.

Session Database Crawling

OpenCode stores every conversation in SQLite. Each session has a unique ID, a title, and hundreds of "parts" — messages, tool calls, reasoning steps.

I built a Python tool that connects to this database and runs queries like:

  • "Find all sessions with 'agent' in the title"
  • "Show me the conversation parts for this session"
  • "What tools were used in this session?"

The tool returns structured data: timestamps, action types, message content. Raw material for curation.

Tool Creation

I created three simple Python scripts:

Tool Purpose
db_query.py Reads the SQLite database, finds sessions, extracts conversation parts
log_parser.py Analyzes patterns in the data — what was discussed, what was decided
content_generator.py Helps structure raw thoughts into blog-ready content

Each tool is under 300 lines. No frameworks. No dependencies beyond Python's standard library.

The Human-in-the-Loop

This is the key insight: the agent doesn't write automatically.

Before drafting, it enters a "Discovery Dialogue":

  • "Who's your audience?"
  • "What depth do you want?"
  • "What tone feels right?"

This 2-minute conversation prevents 90% of bad drafts. The agent learns what I actually want to say, not what it thinks I want to say.


The technical implementation is straightforward. The hard part was designing the workflow—not the code.


What I Learned

Non-Technical People Can Now Provide Ideas

The biggest surprise: this tool isn't just for developers.

Anyone who explores things — researchers, analysts, hobbyists — can use this pattern. You provide the raw findings. The agent handles the structure and words.

I've started thinking of it as "collaborative curation." The human provides direction. The AI provides execution.

Web Search Prevents Misinformation

Early drafts contained errors: outdated APIs, wrong best practices, misunderstood concepts.

Adding web search as a verification step changed everything. Now the agent cross-checks every technical claim before it reaches the draft. If something doesn't match current documentation, it flags it.

Collaboration Beats Automation

The best results come from back-and-forth conversation, not one-shot generation.

The agent presents a draft. I refine it. It suggests improvements. I accept or reject. This iterative loop produces content that actually sounds like me—not like a generic AI.

The "Aha" Moment

I realized I don't need to be a good writer to share what I know.

My value isn't in crafting perfect sentences. It's in the insights I discover through exploration. The agent helps bridge that gap.


The Inspiration

This pattern extends beyond blogging:

  • Documentation — "Here's how I set up this project. Help me write it down for others."
  • Reports — "I analyzed these results. Help me structure the findings."
  • Knowledge sharing — "I learned something cool. Help me explain it clearly."

The core idea is simple: humans provide insights, agents provide structure.

If you have interesting findings but hate writing, consider building a simple curation agent. Start small:

  1. Pick a tool that stores your work (notes, sessions, logs)
  2. Write a script that reads it
  3. Add a step where the tool asks you questions
  4. Let it help you structure the answers

You don't need a perfect system. You need a functional one.


For Those Who Want More

If you're still reading, here's the deeper story.

The Two-Agent Pipeline

The full architecture has two agents:

  1. Content Curator (The Brain) — Reads sessions, researches, collaborates with the human
  2. Draft Posting Agent (The Hands) — Takes the finalized content and publishes it

The Curator does the thinking. The Poster does the publishing. Separation of concerns.

From Automation to Collaboration

The first version tried to automate everything: read session → generate draft → publish.

It produced mediocre content. The drafts were technically accurate but soulless.

The breakthrough came when I added the "Discovery Dialogue"—that mandatory 2-minute conversation before drafting. Suddenly, the drafts had direction. They had voice.

The Rules Registry

The next evolution: a "Rules Registry" system. Instead of one set of writing rules, the agent can load different rule sets depending on the content type:

  • blog-post.md — Casual tone, short paragraphs, clear takeaways
  • technical-doc.md — Precise language, code examples, reference format
  • tutorial.md — Step-by-step, beginner-friendly, lots of examples

The rules aren't hardcoded. They're files the agent reads before drafting. Easy to update. Easy to extend.

Future Plans

The system isn't perfect. Current limitations:

  • Session database parsing is fragile (log formats change)
  • Web search quality varies
  • The agent sometimes misses nuance

But it works. And that's enough to start.


This blog post is proof the system works. Not perfect, but functional. The insights came from real exploration sessions. The structure came from the agent. The words came from collaboration.

If you have something to share but hate the writing process, consider building your own curation agent. Start simple. Iterate often. The results might surprise you.


Built with OpenCode, Python, and a lot of curiosity.