AgentREASON + ACTRAGCONNECTEDLLMLANGUAGE + LOGIC

HUMAN IDEAS. AI POSSIBILITIES.

Hi, I’m Sam 👋

Software engineer based in Shenzhen. Notes on putting AI into real business workflows — agents, document processing and knowledge bases, plus some architecture on AWS.

Latest posts

12 posts · 44 tags View all posts

AI Spec-Driven Development: Why We Chose OpenSpec

When you code with AI, requirements live only in chat history and vanish with the next session. Spec-driven development puts them in the repo, but Spec Kit, Kiro and Tessl take very different approaches, and critics call it waterfall coming back. This post compares the main tools against the industry critiques, explains why we chose OpenSpec, and shares the practices we built up over a dozen-plus repos and more than a hundred changes.

  • AI
  • AI Coding
  • Spec-Driven Development
  • OpenSpec
November 17, 2026 · 10 min · 2024 words · Sam Peng
A delta spec with added, modified and removed requirements, merged into the specs folder on archive

Character Consistency in AI Short Dramas: Asset Chains, Continuity Locks and Reference Images

When an AI animated series is made through APIs alone, characters, props and locations stay consistent across shots only through reference images and fixed text. Using real images from an original series, this post explains why source images are reviewed first, why model references are kept apart from human-facing sheets, why continuity locks are reused verbatim, why a location needs one plate per camera direction, and how to check shot by shot.

  • AI
  • AIGC
  • Image Generation
  • Video Generation
November 16, 2026 · 11 min · 2257 words · Sam Peng
A robot character's turnaround with continuity locks for the head, camera ball and tank called out beside it

Designing an AI Short-Drama Pipeline: Shared Stages and Assets, One Skill per Genre

Paid short dramas, animated series, narrated novels and product ads each need a different rhythm and different checks. In this design, every genre shares the same four stages (script, assets, shots, video) and the same asset library, and what differs between genres goes into one skill that is layered onto every sub-agent. It compares open-source short-drama tools and multi-agent papers, with an interactive demo.

  • AI
  • Agent
  • AIGC
  • Video Generation
November 16, 2026 · 13 min · 2568 words · Sam Peng
Script, assets, shots and video stages, with six video genres below, one skill per genre

94% of Fields Correct. Now What? A Two-Stage Architecture for Scanned Documents

Across 38 scans and 4,732 field assertions, the classic OCR pipeline passed 94.08% of fields, but only six documents passed every check. Page transcription, extraction and large-schema experiments show how to separate reading from interpretation, retain source evidence, and avoid treating model agreement as proof of correctness.

  • AI
  • OCR
  • VLM
  • Document Processing
November 16, 2026 · 20 min · 4231 words · Sam Peng
Scans become traceable text, then structured fields, followed by validation and review

Chunking for a Knowledge Base: One Markdown Convention, Chunked by Heading

What the knowledge base maintains is Markdown: PDFs, web pages, manual material and Q&A all follow one convention, and the chunker reads only the Markdown heading tree and block structure. This post covers the convention, PDF transcription and checks, the heading-level chunking rules, and the retrieval evaluation showing why one heading per chunk works best.

  • AI
  • RAG
  • Chunking
  • Markdown
November 15, 2026 · 16 min · 3316 words · Sam Peng
Different sources become Markdown with a heading hierarchy, then are cut into chunks by heading

Building an Enterprise Knowledge Base: Content Model, Git Publishing and Hybrid Search

A knowledge base works like a library: categories, books and editions, tables of contents, passages, narrowing the context level by level to give the chat model accurate knowledge. Drawing on a bilingual project with about 1,800 documents, this post covers defining the content model first, using Git for review and publishing, keeping exact document fetch separate from hybrid search, and choosing retrieval methods with an evaluation set instead of intuition.

  • AI
  • RAG
  • Knowledge Base
  • Search
November 15, 2026 · 11 min · 2285 words · Sam Peng
Originals are converted into a Git-managed Markdown knowledge base, which serves both exact document fetch and hybrid search

Infrastructure as Code for a Multi-Environment AWS System with Cross-Region DR

Managing several environments and cross-region disaster recovery for a containerized business system with Terraform. Seven choices (tool, environment layout, state, accounts, who applies, secrets, DR level), each compared against the common alternatives and where they break, plus a repository layout you can build from.

  • AWS
  • Terraform
  • IaC
  • DevOps
November 13, 2026 · 14 min · 2907 words · Sam Peng
A grid of five infrastructure layers by five environments, each cell a separate Terraform state

Designing an AI Agent for Filling Contracts

Built on official Chinese model contracts: AI pulls facts out of IDs, screenshots and chat with a source for each, code fills the fixed clauses, writes amounts in words and checks every rule, and people fill the gaps and settle conflicts before the contract is generated. With an interactive demo.

  • AI
  • Agent
  • LLM
  • Contracts
November 13, 2026 · 4 min · 1609 words · Sam Peng
Facts from an ID card, a title deed and a chat screenshot flow into a contract clause and then through checks

Designing a Template Reply Agent with Classification and Routing

Classify each incoming message, route it by priority to exactly one standard template, let the model only fill the blanks, check the draft in code, and have staff review and send. Shown with export sales inquiries, with an interactive demo.

  • AI
  • Agent
  • LLM
  • Templates
November 13, 2026 · 7 min · 1450 words · Sam Peng
A message is classified, routed to a single template, filled and checked, producing a draft for staff to send

UI Design for a Conversational Quoting Agent

Using an online EV quote as the example: the model understands and explains, pricing and finance services set the numbers, and cards carry every choice and confirmation. With an interactive demo.

  • AI
  • Agent
  • Generative UI
  • A2UI
November 13, 2026 · 9 min · 1902 words · Sam Peng
A one-sentence car request in a chat turns into trim cards priced by a pricing service
View all posts