Case study · 2026
Dikera Engineering: A Multi-Agent AI Software Company That Ships Real Pull Requests
Multi-agent system · LangGraph + deep agents · Human-in-the-loop · Agent chat · MCP
Personal AI product · Built solo, Oct 2026 · Phases L0–L3, M, C1 and C2 complete (backend loop, Swift loop, web console, editors, many projects, mobile toolchains, skills, teams, the Architect) · Now: C3 projects, chains and the Delivery lead, plus named agents you can chat with from the console or the Dikera app
A small AI software company that works on my Dikera assistant like real colleagues would. Orion plans whole products, Vera plans each task and reviews, Mason guards the architecture, Axel writes the code, Echo runs the checks and Sonic finds things for the others. I approve the plan, they do the work in a sandbox, and I approve the merge, from the console or with a signed tap on my iPhone. They remember what worked, follow the skills I give them, and look back at past tasks. I can also just ask any of them a question by name. Everything they do, think and spend shows up live in a web console.

- Solo builder · AI engineer · Architecture to web console
- 2026
- Multi-agent system
- 11 technologies
- LangGraph
- Deep agents (LangChain)
- Multi-agent orchestration
- Agent memory & skills
- Gemini · Claude · GPT · DeepSeek · Ollama
- MCP server
- FastAPI
- PostgreSQL
- Docker sandbox
- Clean architecture
- HTML/CSS/JS console
6
Named agents: Delivery lead, Lead, Architect, Engineer, Tester, Code searcher
5
Pull requests merged on 2 real apps (Swift and Flutter)
$0.39
Average model cost per task (927 calls, 25 tasks)
4
Memory types: working, facts, skills, history
3
Human gates: plan, merge, extra budget
536
Automated tests, incl. an architecture test
Web console (client UI)
Screens from the running console on the Mac mini, with the team's real tasks and spend · tap to enlarge
The problem
Coding agents are impressive in a demo and risky in a real repository. They wander, rewrite things nobody asked for, run up a bill, or claim tests pass when they don't. A business that wants an AI team needs the opposite: predictable steps, a human in charge of the decisions that matter, a hard ceiling on cost, a record of everything, and the freedom to swap models as prices and quality change. Dikera Engineering is my answer to that, built and used on real products: my Dikera voice assistant (Swift apps plus a FastAPI backend) and my Kiku Flutter app.
Overview
A task ("add a test for the Gmail helper") can come from the web console, the eng CLI, or an editor through MCP: VS Code, Xcode or Claude Code. Each task picks a project and a team (Engineering, Backend, Web or Mobile), and the task becomes a thread, like a team chat, where every agent message, tool call, approval card and cost appears live.
Easy to point at any project: add one from a local folder or pick it from my GitHub repositories, and the team inspects it, detects the stack (Flutter, Python, Node, Swift, Xcode, Android) and proposes the checks to run. A "Check and report" task tests, debugs and reports without changing any code, and a failed task can be continued with a note instead of starting again.
The agents are named colleagues you can talk to. Each role has a persona that opens its prompts and signs its messages ("Mason · Architect"). A chat with an agent never goes through the workflow: every question is answered read-only against the task's worktree or a read-only checkout of main, and "@Vera" in any task's thread asks that agent right there. Chats have their own daily budget on top of the task and monthly caps. Live, Mason reviewed Kiku's layering with file paths and line numbers for $0.04.
It grew from one team into a small company. Teams (Engineering, Backend, Web, Mobile) come as team packs with their own models, budgets, lessons and skills. An Architect checks plans and reviews changes against the project's architecture docs and ADRs, with a plain-code detector flagging structural changes. A Delivery lead turns a product into gated stages, and chains hand the work on from team to team. Every approval card has a tier (A–D), and the core refuses a decision from a channel that tier doesn't allow: a merge can never be approved from Slack or by voice.
The Dikera app is the team's front desk on my phone. eng-api pushes approval cards through Dikera's backend as a mailbox; the iPhone signs each decision with a Secure Enclave key (Face ID for the higher tiers), and eng-api accepts a tap only when a paired key signed it and the tier allows it. The same link carries chats: I can talk to Vera or Mason from Dikera, and the app's chat list holds Dikera's conversations and the agents' side by side, with Mac notifications for new cards and answers.
A worker on a Mac mini picks the task up and runs a fixed LangGraph workflow: prepare a git worktree → the Lead plans → I approve the plan → the Engineer implements → the checks run → simulator screenshots for UI changes → the Lead reviews the diff → a pull request opens → I approve the merge → it squash-merges after green CI. Failed checks, review changes or a rejected merge send it back for a fix round, up to three times.
The agents are LangChain deep agents (create_deep_agent), each with a narrow role, its own model, the project's own rules (its CLAUDE.md), lessons learned on earlier tasks, and the skills I approved for that role. They read and write files only inside the task's worktree, and run commands only through an allowlisted Docker sandbox with no network. Swift, Xcode, Flutter and Gradle commands go to a host runner that holds a lock so they run one at a time, and the Tester and Engineer can open the app on an iOS simulator or Android emulator and look at a screenshot.
The team has memory like a person's. Working memory is the task at hand (the plan, the run's messages, the worktree) and is cleared when the task ends. Semantic memory is facts: lessons for a project and role, saved only after I approve them. Procedural memory is skills: how-to instructions in Anthropic's SKILL.md format that an agent reads only when they apply. Episodic memory is history: a record of every finished task, written by code, that agents can look up.
The decisions that matter are made in code, never by the model: what runs next, whether a call fits the budget, which commands are allowed, and who approves. Approvals are one-time tokens created only by a human tap. The agents never push, merge or approve anything.
Any LLM per agent. Gemini, Claude, GPT, DeepSeek and local Ollama models plug in through one factory, so each role has a ladder (normal model → stronger top tier, which needs a tap) and a fallback. A model trial runs the same task with two models side by side and compares tests, review and diff size before you switch. API keys are encrypted in the browser for the Mac mini and stored only in its Keychain.
Every model call is checked before it runs (task budget, monthly cap, stop switch) and recorded after, including prompt-cache hits at their real price. When a task runs out of budget it pauses and asks for more instead of failing or overspending. In the first month the team made 927 model calls on 25 tasks for $9.87, about $0.39 per task.
Architecture
System architecture
Four ways in, one API that owns every decision, and a worker on the Mac mini that does the work. The worker never decides anything on its own: it asks eng-api before every step, every approval and every model call. Each layer links to its code.
- Channels
- Service
- AI agents
- Data & infra
- External API
- Web console code
Clients (the UIs)
Web console
Eight screens: Overview, Tasks and chat, Projects, Agents and models, Providers and keys, Team memory, Skills, Spend and budget. Plain HTML, CSS and JS with no build step.
eng CLI
Create and follow tasks, approve, change models, see spend, pull the stop switch.
MCP server
eng-mcp gives VS Code, Xcode and Claude Code seven tools, such as create_task, list_projects, read_thread and waiting_for_you. Editor tokens can't approve or spend.
Dikera app
Approval cards pushed to the iPhone and signed with a Secure Enclave key, and chats with the agents next to Dikera's own. Next: "ask the team to fix the weather card" by voice.
HTTPS JSON · session cookie + CSRF header · editor or worker tokens - API code
eng-api
Tasks & TeamBus
A2A-shaped task states and threads of typed messages, parts and artifacts
Approvals
One-time tap tokens (hash stored, 10-minute expiry) for plan, merge, budget and lessons
Model registry
Providers, models, prices and role ladders, saved as immutable versions with rollback
Budget policy
Before every call: allow, pause the task, or stop everything
Projects
Each project's folder, GitHub repo, main branch and checks, read by the worker per task
Memory & skills
Lessons, skills and episodes, scoped by project and role, with every read recorded
Postgres queue: claim with SKIP LOCKED · authorise every model call - Agent code
Worker and agents
Task slots
Two tasks run at once, each with its own API, model and checkpoint clients
LangGraph workflow
A fixed graph with interrupt() at each human gate and Postgres checkpoints, so it resumes after a restart
Deep agents
Lead, Engineer and Tester, plus a Code searcher subagent they delegate searches to
Host jobs
Model checks and key tests that need the Mac's Keychain, run on a second thread
commands as argument lists, never a shell - Sandbox code
Sandbox & tools
Docker sandbox
Allowlist (uv, pytest, ruff…), no network except installing from a lockfile, mounted on the worktree only
Host runner
swift test, xcodebuild, flutter test and analyze, ./gradlew, and simulator or emulator screenshots, behind a host lock
Git & PRs
A worktree per task, push and gh pr create in plain code; merge only after green checks
Models & data
LLMs
Gemini 3.5 Flash-Lite / 3.7 Flash / 3.1 Pro, Claude, GPT, DeepSeek, and local Gemma through Ollama
PostgreSQL
Tasks, projects, messages, approvals, settings versions, spend, lessons, skills, episodes and LangGraph checkpoints
Keychain
API keys and the worker's sealing key. The database only ever sees a key's last 4 characters.
Architecture diagrams
Five diagrams drawn from the code and the repository's ARCHITECTURE.md: the system, the workflow as a state machine, the agent team with its guard rails, its four kinds of memory, and the clean architecture. Tap any diagram to zoom.
System architecture
The key split is between deciding and doing. eng-api owns tasks, approvals, model settings and money. The worker does the work on the Mac mini, where the Keychain, Xcode and the sandbox live, and checks in with eng-api before every step.
- Every client is just a view on the same JSON API, so the console, the CLI, an editor and later a voice assistant all see the same thread
- The Postgres queue (SKIP LOCKED) hands each task to exactly one worker slot. No Redis needed.
- Secrets never leave the Mac mini; eng-api can move to Railway without ever holding an API key
The fixed workflow with human gates
The workflow is a graph in code, not a decision for the model. Agents do the creative work inside a step; the graph decides the order, the retries and when to stop. This is the same idea as a CrewAI Flow wrapped around crews.
- Asking for an approval and waiting for it are separate nodes, because LangGraph re-runs an interrupted node on resume and a card must be posted only once
- Three fix rounds at most, each carrying the exact failure or review comment
- Running out of budget pauses for a tap and continues from the same step with a handoff of what's already done
The agent team and its guard rails
Four narrow roles instead of one do-everything agent. Each has its own model from the registry, so the cheap Code searcher runs on Flash-Lite while the Lead and Engineer use Flash and can move up to Pro with a tap.
- Delegation: the Lead and Engineer hand wide searches to the Code searcher subagent instead of reading the whole repo
- Guard rails in code: budget callback, worktree-confined files, allowlisted commands, step limits
- Memory that can't be poisoned: only lessons and skills a human approved are ever read back, and every read is recorded
Four kinds of agent memory
The same split a person has: what I'm doing now, what I know, how to do things, and what happened before. Each kind has its own store, its own owner and its own rule for reaching the prompt, so the agents get smarter with use without anyone being able to slip instructions into them.
- Working memory: the plan, the run's messages and to-do list, and the task's worktree, checkpointed in Postgres and cleared when the task ends
- Semantic memory: lessons the Lead proposes after a problem (or I write), saved only with my approval; up to 8 matching ones per run
- Procedural memory: skills in Anthropic's SKILL.md format, loaded with progressive disclosure so each costs one line until it's needed
- Episodic memory: a record of every finished task built by code from what happened, never by a model, so nothing in it is made up
Clean architecture
The rules (task states, budgets, approvals, model settings) live in pure Python with no framework. LangGraph, deepagents, FastAPI and SQLAlchemy are adapters at the edge, so any of them can be replaced without touching the rules.
- tests/unit/test_architecture.py fails the build if a layer imports an outer one or a framework
- Use cases take ports in their constructor and are tested with in-memory fakes, with no LLM, database or Docker
- Typed errors carry a user-facing message; the API maps them to HTTP codes
CrewAI ↔ this build
The same building blocks as a CrewAI crew
I build multi-agent systems with CrewAI (my BrokeMe research runs a six-agent CrewAI pipeline) and with LangGraph. The concepts carry over one to one. For this project I chose LangGraph with deep agents because a task can wait two days for a human tap, and LangGraph's Postgres checkpoints and interrupt() make that wait durable.
- 01
Agent: role, goal, backstory
Each role has a profile (like an A2A agent card) and a prompt with its goal, its exact answer format and what it must never do.
- 02
Task with expected output
Every step asks for a strict format that code parses, the same idea as a CrewAI Task's expected_output or output_pydantic.
- 03
Crew process
A sequential process with a manager: the Lead plans and reviews, specialists execute, and code fixes the order.
- 04
Flow with routers
Like @router in a CrewAI Flow: verify ok → preview, failed → fix; review approve → PR, changes → fix.
- 05
human_input
Human review is a hard gate in the graph, not a polite request in a prompt.
- 06
Delegation
Like allow_delegation to a cheap specialist: wide searches go to a Flash-Lite subagent and come back as paths and line numbers.
- 07
Tools
Narrow tools with clear descriptions, run inside a sandbox the model can't escape.
- 08
LLM per agent
Each role picks its own provider and model, like setting llm= per CrewAI agent, but versioned and switchable from a console.
- 09
Memory (short-term, long-term, entity)
Short-term state in checkpoints, long-term lessons per project and role, skills as procedures and past tasks as episodes, all approved or written by code.
- 10
Knowledge sources
Like giving a crew knowledge, but loaded on demand: each agent sees the skills meant for its role and reads one only when it applies.
- 11
max_iter / max_rpm
Bounded runs and a money budget enforced before every call, with a stop switch for everything.
How a task runs
One task, from request to merged PR
A real run from the console: "Add a test for the Gmail helper". It cost $0.21 of a $0.50 budget and ended as a merged pull request on the Dikera repo.
- 01
Request
The task is saved with a size (small $0.50, normal $2, large $5) and becomes the first message of its thread.
- 02
Claim
A worker slot claims it and creates a git worktree on eng/task-<id> from origin/main.
- 03
Plan
Reads only what it needs (with the Code searcher) and posts a plan of about five steps.
- 04
Approve the plan
An approval card appears in the console. Rejecting sends the reason back to the Lead.
- 05
Implement
Edits files and runs focused tests in the sandbox, then the full suite once.
- 06
Verify & review
The checks that cover the changed paths run; the Lead reviews the diff against the plan.
- 07
Pull request
The branch is pushed and a PR opened. The merge card lists every changed file.
- 08
Approve the merge
Squash-merged only after the checks are green; the branch and worktree are cleaned up.
Tools & tech
AI & agents
Each agent has one job, and its model is a setting, not code.
- LangGraph
- The fixed workflow as a StateGraph, with conditional edges, interrupt() at the human gates and Postgres checkpoints keyed by task.
- deepagents (LangChain)
- create_deep_agent for each role, a FilesystemBackend confined to the worktree, and a Code searcher subagent.
- LangChain chat models
- init_chat_model for Gemini, Claude (Anthropic), GPT (OpenAI), DeepSeek and Ollama, with per-provider settings and cache-aware cost tracking.
- Agent memory
- Working memory in LangGraph checkpoints, semantic lessons, procedural skills and episodic task history, each scoped by project and role.
- Skills (SKILL.md)
- Written or imported, approved with a tap, mounted read-only through deepagents' CompositeBackend and loaded with progressive disclosure.
- Prompt engineering
- Role prompts with strict answer formats, the project's own rules, approved lessons and skills, a tool-call allowance and a handoff for continued runs.
- Model trials
- The same task run with two models for one role; a report compares tests, review and diff size before you switch.
- MCP
- An MCP server (stdio) so editors and coding assistants can hand work to the team and follow it.
Backend & infrastructure
- Python 3.12 · FastAPI · Pydantic v2
- 78 API routes, typed errors mapped to HTTP codes, Pydantic only at the interface edge.
- PostgreSQL · SQLAlchemy 2 · Alembic
- Queue, projects, threads, approvals, versioned settings, spend, lessons, skills and episodes, with 21 migrations.
- Docker (OrbStack)
- Postgres, eng-api and the command sandbox. The worker runs on the macOS host for Xcode and the Keychain.
- cryptography · macOS Keychain
- Keys sealed in the browser with RSA-OAEP for the worker; stored in the Keychain only after a real test call works.
- GitHub · gh CLI · Actions
- Worktrees, PRs, waiting for checks and squash-merging. The team built the Dikera repo's own CI workflow.
- Mobile toolchains
- Flutter, Dart, Xcode and Gradle on the Mac mini through an allowlist, plus iOS simulators and Android emulators the agents can screenshot.
- uv · ruff · pytest
- 536 tests, including one that enforces the clean-architecture dependency rule.
Client UIs
- Web console
- Plain HTML, CSS and JavaScript served by eng-api, no build step. Live threads by polling, sign-in by a one-time link, an HttpOnly session cookie and a CSRF header.
- eng CLI
- Everything the console does, from the terminal.
- Editors
- VS Code, Xcode and Claude Code through the MCP server, with "Work on it yourself" to open a task's worktree in VS Code or Claude Code.
Modules & repos
interfaces/console/static
The eight console screens: overview, tasks and chat, projects, agents and models, providers and keys, team memory, skills, spend and budget.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/interfaces/console/staticinterfaces/api
Routers for tasks, projects, approvals, models, trials, lessons, skills, spend, workers and host jobs, plus the console sign-in.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/interfaces/apiinterfaces/worker
Task slots, the host-jobs thread and back-off when eng-api is briefly unreachable.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/interfaces/workerinterfaces/mcp_server
Seven tools for VS Code, Xcode and Claude Code, with editor tokens limited to safe routes.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/interfaces/mcp_serverinterfaces/cli
Tasks, approvals, models, spend, the stop switch, console login and MCP tokens.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/interfaces/cliinfrastructure/workflow
The workflow graph, its runner and Postgres checkpoints.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/infrastructure/workflowinfrastructure/agents
The Lead, Engineer, Tester and Code searcher, their prompts, the skills mount and the budget callback.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/infrastructure/agentsinfrastructure/sandbox
The command allowlist, the Docker sandbox, the Swift, Flutter and Gradle host runner, and simulator and emulator screenshots.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/infrastructure/sandboxdomain/
Tasks, projects, messages, agents, model settings, budget policy, approvals, lessons, skills, episodes and the ports everything else implements.
lahirumanulanka/dikera-engineering/tree/main/src/dikera_eng/domaindikera-assistant
The Dikera voice assistant (Swift apps for Mac, iPhone and CarPlay, and a FastAPI backend) where the team opens its pull requests.
lahirumanulanka/dikera-assistantkiku-ai-bot
My Kiku children's app (Flutter and a Python backend), where the team ran Flutter tests, took simulator screenshots and merged its first PR.
lahirumanulanka/kiku-ai-bot
Results
Spend by agent (first month)
$9.87 in total, 927 model calls on 25 tasks. Runs on the local Gemma model cost nothing.
- Engineer · 663 calls$7.98
- Lead · 250 calls$1.88
- Code searcher · 5 calls$0.01
- Tester · 9 calls$0.00
Codebase
Lines of code, counted from the repository.
- Python (domain → interfaces)24.2K
- Python tests11.8K
- Web console (HTML/CSS/JS)7.0K
Key features
- Create a task from the console, the CLI, VS Code, Xcode or Claude Code, and follow it live as a team chat
- Chat with any agent by name (Orion, Vera, Mason, Axel, Echo, Sonic), or @mention one in a task's thread; turn a chat into a task
- Four teams (Engineering, Backend, Web, Mobile), each with its own models, budget, lessons and skills
- Approve plans and merges from the iPhone: cards arrive through the Dikera app and each tap is signed on the device
- Add any project from a local folder or your GitHub repositories; the team detects its stack and proposes the checks
- "Check and report" tasks: test, debug and report on an app without changing its code
- Continue a failed task with a note, keeping its worktree and approved plan
- Approve or reject the plan and the merge with one tap; a rejection's reason goes straight back to the agent
- Pick any model for any agent (Gemini, Claude, GPT or a free local model), switch everyone with one preset, and roll back any change
- Try a new model safely: a model trial runs the same task twice and compares the results
- See every dollar: spend per day, agent, model and task, budgets per task size, a monthly cap and a stop switch
- Team memory: lessons the team proposes after a problem (or you write), saved only with your approval, and visible wherever they were used
- Skills: write or import a SKILL.md, approve it, and give it to the whole team, one role or one project
- Simulator and emulator screenshots in the thread for UI changes to Swift and Flutter apps
- "Work on it yourself": open any task's worktree in VS Code or Claude Code and take over
What this means for a client project
- I can design and build a multi-agent system around your process, in CrewAI or LangGraph: agents with narrow roles, tools they can safely use, and a workflow your team can trust
- Humans stay in charge: approvals are hard gates in code, and agents never take an irreversible step on their own
- Cost is controlled before it is spent: per-task budgets, a monthly cap, cache-aware cost tracking and a stop switch
- No lock-in to one AI vendor: each agent's model is a setting, with side-by-side trials before switching
- Agents that get better with use: they remember facts, follow your team's written procedures as skills, and learn from past tasks, all under your approval
- Production habits from day one: clean architecture, typed errors, 536 tests, Docker, migrations and an audit trail of every step
- A UI your team will actually use: a console for approvals, live progress, models and spend, plus CLI and MCP access for developers
Safety & security
- Text agents read (code, issues, tool output) is treated as data, never instructions
- Commands run as argument lists in a no-network Docker sandbox, from an allowlist, on the task's worktree only
- No secrets in code, config or the database: keys live in the Keychain and are only ever shown as their last 4 characters
- Console sign-in by a one-time link, an HttpOnly SameSite=Strict session and a CSRF header; editor tokens can't approve, cancel or spend
- Agents never push, merge or approve; merges wait for green checks and never happen on a failing PR
Engineering highlights
- 01Designed and built a working multi-agent software team alone, from the domain model to the web console, and used it to ship real pull requests on a real product
- 02A durable LangGraph workflow with human-in-the-loop gates, fix rounds and budget pauses that survives restarts and multi-day waits
- 03Agent memory modelled on human memory: working, semantic, procedural (skills) and episodic, each scoped and auditable
- 04Provider-agnostic agents: Gemini, Claude, GPT, DeepSeek and local models per role, with versioned settings, rollback and model trials
- 05Cost engineering: every call authorised and metered, cache hits charged at their real price (the first version over-counted long runs about 5×), smaller plans and focused tests to cut spend
- 06Security by design: sandboxed commands, worktree-confined files, browser-sealed API keys and one-time approval tokens
- 07Named, chat-able agents with read-only answers and their own daily budget, and tiered approvals (A–D) enforced in the domain by channel
- 08Phone approvals signed with Secure Enclave keys and carried through the Dikera backend as a mailbox, so eng-api never needs to be reachable from the internet
- 09Clean architecture enforced by a test, and 536 automated tests
Status & next steps
- L0–L3 complete: setup, the backend loop with approvals and PRs, the Swift loop with simulator screenshots, the web console and the MCP server
- M complete: many projects (local or GitHub), Flutter and Android toolchains, simulators and emulators as agent tools, skills and check-only tasks
- C1–C2 complete: teams and team packs, the command interface (dikera.yaml and make targets), the Architect with plan checks, conformance reviews and ADR cards
- Done (28 Oct): named agents you can chat with in the console, by @mention or from the Dikera app; phone approvals signed on the iPhone
- Now (C3): products, chains and jobs as gated stages, the Delivery lead, approval tiers, and GitHub Projects and Slack connectors
- Next: Research and Product teams, a pilot product end to end, and Dikera as the front desk by voice (C4–C7)
- Later: a Flutter admin app, UI design, QA and DevOps teams, and Dikera's memory upgrades (C8–C11)