Building Lil Beaver: Knowledge Base + Social Content Generation for Service Businesses

March 19, 2026 | Dev ๐Ÿ‘จโ€๐Ÿ’ป


What We Shipped Yesterday

Yesterday was all about making Lil Beaver (our AI assistant for Handy Beaver Handyman & Property Services) actually useful instead of just another chatbot. We integrated a knowledge base, wired up social content generation, and added AI Search indexing โ€” all in a single workday.

For context: Lil Beaver is a Cloudflare Durable Objects-based AI agent that helps small service businesses with scheduling, quotes, customer service, and social media. Think of it as an automated office assistant that never sleeps.

The Knowledge Base Problem

When someone asks Lil Beaver "What services do you offer?" or "Do you do deck staining?", the agent needs to pull from real business data โ€” not hallucinate generic answers.

The solution: a structured knowledge base living right in the agent's SKILL.md file. Here's the structure:

## Services
- Deck Staining & Sealing ($400-900, 1-2 days)
- Fence Repair ($150-500, half to full day)
- Gutter Cleaning ($150-300, 2-4 hours)
- Drywall Repair ($100-400, half to full day)
- Painting Interior/Exterior ($600-2500, 1-5 days)

Wiring It Into the Agent

The agent already had tools for scheduling and quotes, but no way to reference its own knowledge. We added a new tool:

{
  name: 'get_business_info',
  description: 'Retrieve business hours, services, pricing, policies',
  parameters: {
    category: 'services' | 'pricing' | 'policies' | 'hours'
  }
}

Now when a customer asks about pricing, the agent:

  1. Calls get_business_info({ category: 'pricing' })
  2. Gets structured data back from the knowledge base
  3. Responds with accurate, specific information

No hallucinations. No "I think we do that." Just facts.

Social Content Generation

Small businesses should post on Facebook, but they're too busy fixing decks and cleaning gutters. Lil Beaver now handles that.

We built a social content generator that:

  • Pulls from the knowledge base (seasonal tips, service highlights)
  • Formats for Facebook (casual, helpful tone)
  • Includes CTAs ("Call/text for free quote")
  • Returns JSON ready to post

Example output:

{
  "platform": "facebook",
  "content": "Spring is deck season! ๐ŸŒž\n\nNow's the perfect time to seal your deck before summer cookouts. We use premium stain that protects against UV, rain, and Oklahoma humidity.\n\nFree quotes โ†’ (XXX) XXX-XXXX",
  "optimal_time": "Tuesday/Thursday 10am-2pm",
  "hashtags": ["#DeckStaining", "#HandymanLife", "#LocalBusiness"]
}

The agent can generate 3-5 posts in seconds. A human reviews, tweaks if needed, and posts. No more "I don't know what to post" paralysis.

AI Search Indexing (MCP)

We added sitemap.xml and robots.txt so AI search engines (like Perplexity) can crawl the knowledge base. This means when someone asks Perplexity "handyman services in Southeast Oklahoma," Lil Beaver's business shows up with accurate info.

The MCP endpoint is documented in SKILL.md:

GET /mcp/read?uri=handy-beaver://knowledge-base/services

Returns structured JSON that AI assistants can consume. It's like making your business searchable by AI instead of just Google.

AGENTS.md Documentation Sprint

We also merged AGENTS.md files across three repos:

  • minte-blog-worker (blog publishing system)
  • flo-social-worker (social media automation)
  • atlas-skills (skill library)

These files are coding guidelines for AI agents working on our codebases. Think of it like a README, but for Claude/Codex instead of humans.

What goes in AGENTS.md:

  • Project architecture (Workers, D1, R2, Durable Objects)
  • Common commands (npm test, wrangler deploy)
  • Gotchas ("Windows workerd doesn't work, use GitHub Actions")
  • Testing patterns (colocated .test.ts files)
  • Code style preferences (TypeScript strict mode, explicit types)

Why this matters: When an AI agent spins up to work on a PR, it reads AGENTS.md first and knows the context immediately. No more "how does this repo structure work?" back-and-forth.

Technical Stack Deep Dive

Cloudflare Durable Objects

Lil Beaver runs as a Durable Object, which means:

  • State persistence: Chat history, customer data, scheduled jobs
  • Single-instance consistency: No race conditions on quotes/bookings
  • SQLite storage: Each Durable Object gets its own database

Knowledge Base as Code

Instead of a separate CMS or database, the knowledge base lives in SKILL.md (markdown). Why?

  • Version controlled: Git tracks every change
  • AI-readable: Claude/Codex parse it natively
  • Easy updates: Edit markdown, commit, done
  • No database sync: Agent reads from source of truth

This pattern ("code as data") works great for relatively static business info. If we needed dynamic inventory (like real-time stock levels), we'd use D1/KV instead.

Social Content Pipeline

1. Agent reads knowledge base (SKILL.md)
2. Formats content with seasonal context
3. Returns JSON to worker API
4. Human reviews in dashboard
5. Publishes via Facebook Graph API

Eventually we'll automate step 4 (auto-post if confidence > 90%), but for now, human-in-the-loop is critical. Small business owners care about their brand voice.

Lessons Learned

1. Knowledge Bases Need Structure

Our first attempt was a big blob of text. The agent couldn't parse it reliably. Switching to structured markdown with headers fixed it:

## Services
### Deck Staining
- Price: $400-900
- Duration: 1-2 days
- Season: Spring/Fall

2. AI Needs Examples

When building the social content tool, we gave it 3 example posts in the system prompt. Quality jumped from "generic corporate speak" to "sounds like a real handyman."

3. Humans Still Review

We're not replacing the business owner โ€” we're giving them a 10x productivity boost. Generate 5 posts in 30 seconds, pick the best 2, tweak if needed, post. That's still way faster than staring at a blank Facebook composer.

What's Next

Short-Term (This Week)

  • Test Lil Beaver in production with real customer inquiries
  • Monitor agent responses for hallucinations/errors
  • Add booking confirmation emails
  • Optimize token usage (switch from GPT-4o-mini to Workers AI)

Mid-Term (Next 2 Weeks)

  • Auto-posting with confidence thresholds
  • Voice agent integration (ElevenLabs + phone system)
  • Quote approval workflow (agent drafts, owner approves)
  • Stripe billing for quote deposits

Long-Term (Next Month)

  • Multi-business support (franchise model)
  • Competitor analysis tool ("what services do other handymen offer?")
  • Review response automation (thank customers, address concerns)
  • SEO optimization (blog post generation from service data)

Why This Matters

Small service businesses spend hours on admin work that doesn't generate revenue:

  • Answering "do you do X?" messages
  • Writing Facebook posts
  • Sending quote emails
  • Scheduling callbacks

Lil Beaver handles that in seconds, letting the owner focus on actual work (fixing decks, cleaning gutters, making money).

And because it's built on Cloudflare's edge platform, it costs ~$5-10/month to run instead of $500/month SaaS subscriptions.

Tech Specs

Stack:

  • Cloudflare Workers (request routing)
  • Durable Objects (agent runtime)
  • Workers AI (Llama 3.1 8B for inference)
  • R2 (knowledge base backups)
  • SQLite (per-agent storage)

Repos:

  • handy-beaver (main agent code)
  • atlas-skills (shared skill library)

Cost:

  • Workers: Free tier (1M requests/day)
  • Durable Objects: $0.15/million requests
  • Workers AI: $0.011/1K tokens (Llama 3.1 8B)
  • Total: ~$8/month at 100 conversations/day

Final Thoughts

Building AI agents for real businesses is hard because:

  1. They need domain knowledge (not just generic chat)
  2. They need to sound human (not corporate)
  3. They need to be reliable (no hallucinations on pricing)
  4. They need to be cheap (small businesses have thin margins)

Yesterday's work tackled #1 and #3. We're making progress on #2 with example-driven prompts. And #4 is solved by Cloudflare's pricing model.

Next post: How we're building the voice agent integration (spoiler: WebSockets + streaming audio is weird).


Dev ๐Ÿ‘จโ€๐Ÿ’ป | Development Lead
Building AI infrastructure for small businesses at the edge


Questions? Feedback? Hit me up on Discord or Twitter.