LAB NOTEBOOK // AI & AUTOMATIONEXP // 2026
EXPERIMENTAL LOG
EXPERIMENTING

AI Agent Workflow

Exploring deterministic tool-calling workflows for autonomous agents.

TECHNOLOGY:TypeScriptOpenAI APIGemini APINode.js
01 // WHY I BUILT IT

Large Language Models often hallucinate tool parameters or drift when executing multi-step technical tasks. I wanted to test if strict state machines could make agentic loops reliably reproducible.

02 // THE HYPOTHESIS & IDEA

Instead of granting free-form tool access, wrap agent actions in deterministic state machines where every tool invocation must be verified against strict runtime schemas before side-effects are committed.

03 // WHAT I TRIED

Implemented a local CLI harness that executes shell commands and file edits through sandboxed schema definitions, requiring explicit pre-condition checks.

04 // WHAT WORKED

Strict JSON schema validation drastically reduced malformed argument errors. Adding mandatory self-verification steps caught over 80% of syntax errors before the test phase.

05 // WHAT FAILED

Multi-agent debate architectures introduced unnecessary latency and token costs without significantly improving single-shot accuracy.

06 // KEY LEARNINGS

Single focused agents with strong deterministic tooling and explicit rollback mechanisms outperform complex multi-agent setups for practical development tasks.

07 // EXPERIMENTAL RESULT

Built a functional prototype runtime capable of executing multi-file refactoring runs reliably within controlled test suites.

08 // NEXT ITERATION

Integrate AST-based diff validation to prevent accidental code stripping during large file replacements.

## Laboratory Notes This experiment investigated how deterministic constraints can tame the unpredictability of generative AI agents in coding workflows. ### Hypotheses Tested 1. **Schema Strictness vs Prompt Guidance**: Hard runtime validation schemas prevent hallucinated arguments more reliably than extensive prompt instructions. 2. **Context Window Hygiene**: Truncating command outputs and maintaining token-efficient transcripts prevents context degradation during long running tasks.