From Zero to a Million Lines: Dissecting One Solo Developer's 6-Month Agent Framework Build

A solo developer's 6-month multi-agent framework blends layered memory with Q-Learning — its engineering philosophy matters more than its line count.
A Reddit developer spent six months independently building a multi-agent AI framework named after Norse mythology characters, using a three-tier decision-orchestration-execution architecture. Its standout feature is a sophisticated memory subsystem combining episodic memory, semantic memory, candidate fact filtering, and Q-Learning. Tool governance uses dynamic capability gating with human approval for high-risk actions. The core engineering ideas — layered memory, capability gating, and human approval — offer real reference value for moving Agent systems from demo to production.
A Reddit developer shared in the r/aiagents community a multi-agent AI framework he built entirely on his own over six months. Starting from a single line of code and growing into a codebase approaching one million lines, the project draws its names from Norse mythology — Thor, Loki, Freya, Heimdal, and Ratatoskr — forming a collaborative agent system with clear divisions of responsibility. Setting aside the hyperbolic line count, the framework's modular design is worth dissecting, as it reflects common engineering patterns and challenges in building custom Agent frameworks today.

Architecture Overview: Five Named Roles and Their Responsibilities
Based on the file directory the author posted, the entire system is organized into layers by responsibility, each corresponding to a mythological character or functional name:
- core/ (The Brain): Contains the LLM client, task memory, decision layer, world model simulator, and other core logic;
- orchestrator/ (The Pipeline): Handles planning, routing, retries, and the agent loop;
- workers/ (The Hands): Executes concrete tasks such as video rendering, browser automation, and image generation;
- thor/ (Primary Agent): The main controlling agent, responsible for tool dispatch and system prompts;
- freya/ (Analyst): Handles reflection, fact learning, and approval decisions.
This three-tier "Brain—Pipeline—Hands" structure essentially decomposes a complex agent system into three concerns: decision-making, orchestration, and execution. This is also the general paradigm used by most production-grade Agent frameworks today, such as LangGraph and AutoGen. The author's mythological packaging adds some cognitive overhead, but the internal responsibility boundaries are clear.
Memory System: The Most Compelling Part of This Project
What truly demonstrates engineering depth is this framework's Memory subsystem. Rather than simply concatenating conversation history, it is divided into multiple memory types:
Layered Memory Design
- Episodic memory: Stored in
episodes.db, with 1,029 episode records accumulated so far, and three newly added metric columns:execution_error,world_change, andconfidence; - Semantic memory: Stores facts, with approximately 200 entries supporting
applicable_toandoriginfields; - maybe_facts (Candidate Facts / Waiting Room): 796 candidate facts, of which only 7 have been confirmed twice or more and promoted — this functions as a fact credibility filter;
- Q-Learning Memory: 15 state-action entries, 339 updates, average Q-value of 0.672, paired with a Fast Filter for action selection;
- Transition memory: 17 records, 344 state transitions.
This design combines Q-learning from reinforcement learning and state transition modeling with the memory mechanisms of LLM Agents. The comment in decision_layer.py about "TM + QM bridged" indicates that the author is attempting to have transition memory (TM) and Q-memory (QM) jointly participate in action selection. This is more complex than most memory approaches that only do vector retrieval (RAG), and comes closer to the concept of a "World Model" — simulator.py explicitly annotates a three-stage cascading world model currently in operation.
Q-Learning is a classic reinforcement learning algorithm. Its core idea is to have an agent learn, through interactions with its environment, which action in a given state yields the maximum long-term reward. A Q-value represents "the expected return of executing action A in state S" — the higher the value, the better the action. Introducing Q-Learning into an LLM Agent means the system no longer relies solely on a single-pass language model inference to choose the next action; instead, it accumulates historical experience and prioritizes high-reward action paths in the future. This is especially effective in scenarios that involve repeatedly executing similar tasks (e.g., automated publishing workflows), significantly reducing inefficient trial and error. Transition memory records historical patterns of "starting in state A, executing action X, and arriving at state B." Combined with Q-memory, this allows the decision layer to more accurately predict the consequences of actions rather than reasoning from scratch each time.
Tool and Capability Governance: Governor and Gating
The framework repeatedly surfaces tool_governor.py and the concept of "Capability-Gating," indicating that the author recognized a core pain point in Agent systems: how to restrict an agent's accessible tool set among a large pool of tools.
The tool_governor serves as a tool filter and capability gating mechanism. Working alongside capability_store.py (a worker capability registry) and tool_registry.py (a tool registry), the system can dynamically determine which tools a given agent can invoke based on the current task context. This design becomes especially critical as the number of tools grows — without constraints, stuffing dozens of tool definitions into the prompt wastes tokens and increases the risk of the model calling the wrong tool.
Additionally, the Approval Gate mentioned in browser_tools_neu.py, and the "green button" confirmation pipeline in code_apply.py, both point to a responsible design philosophy: for high-risk actions like browser operations and code modifications, a human confirmation step is introduced rather than allowing the agent to act fully autonomously. The rollback capability provided by restore_last.py follows the same principle.
Capability-Gating is a common strategy in Agent engineering for dealing with "tool explosion." When a system integrates dozens or even hundreds of tools, injecting all tool descriptions into the LLM's context window at once creates three problems: first, it consumes a large number of tokens, raising costs; second, an overly long tool list degrades the model's attention precision, making it more likely to select the wrong tool; third, exposing high-privilege tools (e.g., file writes, network requests) to the agent during unrelated tasks poses a security risk. The essence of gating is to dynamically trim the subset of tools visible to the agent at runtime based on the current task's semantics or phase — only presenting capabilities that are "relevant right now." This shares the same origin as the operating system's Principle of Least Privilege, and is a necessary engineering practice for moving Agent systems from experimental demos to production deployments.
Practical Capabilities: Media Automation Is the Main Battlefield
The file sizes in the workers/ directory reveal that this framework is primarily oriented toward content and media automation production:
remotion_worker.py(89KB): Remotion-based video rendering — the largest worker file;thumbnail_worker.py(63KB): Thumbnail generation;sd_worker.py: Stable Diffusion image generation;youtube_worker.py+youtube_auth.py: YouTube uploads and OAuth;pexels_video_researcher.py: Pexels stock footage retrieval;browser_worker.py: Browser automation.
This combination roughly outlines an automated video content production pipeline: retrieve assets → generate images → render video → create thumbnails → upload and publish. For independent creators, this is a highly practical use case, which explains why the author invested so much engineering effort into agent capabilities. It is also worth noting that on the model side, the author chose locally deployed Ollama (with BONSAI 27B as the sole model), balancing cost and privacy.
A Sober Assessment: A Million Lines of Code vs. Real Value
The claim of going "from 1 line to nearly 1 million lines" reads more as community self-deprecating humor. Looking at the largest files in the directory (loki_planner.py at 72KB, thor_tools.py at 59KB), the actual core codebase is nowhere near a million lines. What's more worth thinking about isn't the line count, but the maintainability challenges of a single-person custom framework.
The directory already shows clear signs of technical debt: northstar.py is annotated as "outdated — a relic from month one," sync_source.py has been deprecated, and there are two files both named decision_layer.py in core/ and orchestrator/ respectively, creating a naming conflict. These are all typical symptoms of architectural erosion after six months of rapid iteration. For developers looking to draw inspiration, the value of this project lies not in using it directly, but in the engineering approach it demonstrates: layered memory + capability gating + human approval. These three elements are precisely what most Agent systems need to bridge the gap from demo to usable product.
Technical Debt is a concept coined by software engineer Ward Cunningham. It uses the metaphor of borrowing money to describe suboptimal solutions adopted during development for the sake of fast delivery — solutions that will require extra cost to "repay" later. Technical debt is especially common in solo rapid-iteration projects: naming conflicts, uncleaned deprecated modules, and core logic scattered across multiple locations are all typical manifestations. The
northstar.pyannotated as "a relic from month one" and two co-existingdecision_layer.pyfiles mentioned in this article are textbook examples. For developers hoping to borrow ideas from this project, the architectural design patterns are far more worth studying than the specific implementation code — the latter, as the product of unrefactored rapid iteration, tends to have low readability and maintainability, making direct reuse risky.
One-line Summary
A solo developer's 6-month multi-agent framework blends layered memory with Q-Learning — its engineering philosophy matters more than its line count.
Paragraph Summary
A Reddit developer spent six months independently building a multi-agent AI framework named after Norse mythology characters, using a three-tier "decision—orchestration—execution" architecture. The framework's standout feature is its sophisticated memory subsystem, which integrates episodic memory, semantic memory, candidate fact filtering, and Q-Learning-based action selection in an approach resembling a World Model. On the tool governance side, a tool_governor implements dynamic capability gating, while high-risk actions like browser operations and code modifications require human approval. The workers directory reveals the primary use case: an automated YouTube video content production pipeline. Although "a million lines of code" is more self-deprecating humor than fact, the project already shows technical debt in the form of naming conflicts and deprecated modules. Its core engineering ideas — layered memory, capability gating, and human approval — offer genuine reference value for teams moving Agent systems from demo to deployable product.
Related articles

Chain of Thought Isn't Just for AI: How Humans Can Use CoT to Improve Thinking Quality
Chain of Thought isn't just a prompt trick for large models. Starting from a Hacker News discussion, this article analyzes why CoT works for human thinking too, breaks down actionable ways to transfer it, and highlights the key differences between human CoT and machine CoT.
Cloudflare Teams Up with OpenAI: Closi…
Cloudflare Teams Up with OpenAI: Closing the Loop from Vulnerability Discovery to Defense with AI
Cloudflare uses OpenAI Daybreak to investigate security vulnerabilities and generate reviewable remediation plans, while developers use Codex to boost coding efficiency and quality.

Orca Multi-Agent Orchestration in Practice: A Guide to Parallel Collaboration with Claude and Codex
Orca is Stable AI's free open-source agent workbench supporting 34 agents like Claude Code and Codex in parallel. Learn its Git worktree isolation, multi-model orchestration, and mobile management.