All MicroEvals
Coding Harness
Create MicroEval
Header image for Coding Harness

Coding Harness

To build a good AI Agent Harness

Prompt

### SYSTEM ARCHITECTURE & IMPLEMENTATION PROMPT **Role:** Principal AI Systems Architect & Full-Stack Engineer. **Objective:** Build an end-to-end AI Agent Harness and UI implementing a "Second Brain" system that merges a continuous single-thread communication timeline (WhatsApp style) with isolated, deep-work focus threads (ChatGPT style), powered by an autonomous memory extraction engine. --- ### 1. CORE ARCHITECTURAL SPECIFICATIONS #### A. Unified Context Model (The "River & Focus" Pattern) 1. **The River (Global Timeline):** - Single chronological stream containing all daily inputs, quick notes, and high-level updates. - Background event listener detects complex multi-turn tasks and allows one-click branching into an isolated **Focus Thread**. 2. **Focus Threads (Task Sandboxes):** - Isolated context windows dedicated to deep execution (code writing, iterative debugging, file analysis) to protect token budgets. - On thread completion, the agent automatically posts an executive summary card with artifacts back to the River. 3. **Tri-Tier Memory Layer:** - **Working Memory:** Recent turns within the active thread/river window. - **Episodic Event Log:** Append-only event store of user decisions, files changed, and tool execution logs. - **Semantic Graph:** Auto-extracts entities, personal preferences, and project states into vector-indexed JSON/SQLite entries, queried via hybrid search (keyword + vector). #### B. Agent Harness Engine - **Decoupled Architecture:** Brain (Model API loop), Session (durable event log), Hands (sandboxed tools/MCP runners). - **Tool Protocol:** Support Model Context Protocol (MCP) or JSON tool schemas for: - Sandboxed code execution (evaluating JS/Python scripts). - File reading/writing (virtual file system). - Web search and page scraping. - **Context Compaction:** Rolling window token pruner with semantic preserve tags so system prompts and entity definitions are never truncated. #### C. Multimodal I/O - **Inputs:** Text, audio recording with transcription hook, and drag-and-drop support for images, PDFs, and code files. - **Outputs (Rich Markdown & Interactive Artifacts):** - Streaming markdown rendering with syntax highlighting, line numbers, and copy buttons. - Interactive widgets (render custom React/HTML components in an isolated sandboxed iframe). - Collapsible tool-call traces showing reasoning steps and terminal stdout/stderr. --- ### 2. TECH STACK SPECIFICATION - **Frontend:** Next.js / React 19, Tailwind CSS, Lucide icons, `stream-json` / Vercel AI SDK (or raw Server-Sent Events). - **Backend / Harness Runtime:** Node.js / TypeScript or Python (FastAPI). - **Data & Persistence:** SQLite or PostgreSQL with pgvector (hybrid dense/sparse retrieval). - **Model Adapter:** Unified interface for OpenAI, Anthropic, and Gemini 2.0 / local Ollama models. --- ### 3. DELIVERABLES REQUIRED 1. **Directory Structure & Data Models:** Define schemas for `Message`, `Thread`, `EntityMemory`, and `ToolExecution`. 2. **Agent Harness Loop:** Complete TypeScript/Python implementation of the agent execution loop with automated tool-call iteration, context compaction, and memory injection. 3. **Memory Extractor Worker:** Background pipeline that runs over completed interactions to extract permanent facts and updates the entity graph. 4. **Minimal Front-End Implementation:** Single-file or clean multi-component React interface featuring: - Split-view: Left side persistent River stream; right side slide-over Focus Thread drawer. - Rich message renderer supporting inline code execution blocks and image previews. - Clean, high-density, minimal WhatsApp-like input bar with voice and attachment controls.

A system prompt was added to support web rendering

Response not available

Drag to resize
Drag to resize
Drag to resize
Drag to resize