The Monolithic Memory Problem in Enterprise AI Enterprise AI has hit a wall. Despite the explosion of LLM capabilities, from prompt engineering to deep agents like Replit, Jira tickets aren't moving faster. Raj Navakoti, a staff software engineer at IKEA, identifies a core structural issue: institutional knowledge is a monolith. He compares the current state of AI agents to the protagonist of the film Memento, who possesses high skill but cannot hold memory for more than 15 minutes. This creates a perpetual state of disorientation where agents excel at general tasks but fail at specific, domain-heavy requirements. The industry currently pushes a retrieval-heavy strategy involving RAG and MCP servers. However, plugging an MCP server into a broken, monolithic knowledge base is like connecting a high-speed pipe to a dry well. Navakoti argues that roughly 40% of critical organizational knowledge is "tribal"—it lives in people's heads and never hits Confluence or Slack. Another 20% is outdated, and 20% is unreliable. When agents fail, they aren't just failing to process data; they are exposing the structural gaps in how a company documents its existence. Switching from Knowledge Push to Demand-Driven Pull Traditional knowledge management relies on a "push" strategy: engineers attempt to document everything upfront and push it toward the agent. This is inherently inefficient. Navakoti proposes a "pull" strategy inspired by how we onboard new human employees. We don't ask a junior dev to memorize the entire company wiki before their first commit; we give them a task, and they pull the necessary information as they hit roadblocks. This demand-driven context approach turns the agent from a passive consumer into an active knowledge manager. In this framework, the agent is intentionally given a problem it will likely fail to solve. This failure is the catalyst. Instead of giving up, the agent generates a checklist of exactly what it doesn't understand. It identifies missing API definitions, unclear business logic, and undocumented system behaviors. This "demand extraction" surfaces the tribal knowledge that documentation efforts usually miss because they don't know what they don't know. The Agent Lifecycle and the Curation Loop The methodology operates in a cycle similar to Test-Driven Development (TDD). In TDD, we write a failing test first to define the requirement. In demand-driven context, we provide a "failed problem." The cycle moves through four distinct phases: 1. **Problem Assignment**: An agent is tasked with a real-world issue, such as a root cause analysis for a production incident. 2. **Discovery of Gaps**: The agent attempts retrieval via RAG but identifies specific missing entities or outdated information, assigning confidence scores to its current context. 3. **Human Interjection**: A domain expert fills the specific gaps identified by the agent's checklist. This is surgical documentation rather than a broad, exhaustive effort. 4. **Curation and Storage**: The agent takes the new information, curates it into a structured format (like Markdown), and saves it to a persistent repository. By running this cycle across multiple incidents, the agent's confidence score improves measurably. Navakoti demonstrated that over 14 incident cycles, an agent's confidence in handling tasks jumped from 1.5 to 4.4 out of 5. The agent builds its own "cache" of curated context blocks that are significantly more useful than the raw monolith of Confluence pages. Why GitHub is the Ultimate Knowledge Repository A controversial but practical element of Navakoti's framework is the storage layer. While many look to expensive SaaS solutions for knowledge management, he advocates for storing curated context in GitHub repositories. The reasoning is purely engineering-driven: GitHub provides built-in version control, Pull Request reviews, and conflict resolution. When multiple agents and human experts contribute to a shared knowledge base, data conflicts are inevitable. Treating knowledge as code allows teams to use the same rigorous CI/CD pipelines for their documentation as they do for their software. If an agent proposes a documentation update based on a resolved incident, a human expert can review that PR to ensure the logic is sound. Once merged, that knowledge is permanently indexed and available for all other agents in the ecosystem. Navigating the Domain with Meta Models Beyond raw text, the framework benefits from a Meta Model—a map of how different domain entities relate to one another. An agent needs to understand that a notification service failure affects specific business processes and relies on certain APIs. Without this map, the agent is just guessing which files to retrieve. The Meta Model acts as a navigation layer. It allows the agent to reason about the "blast radius" of a change or the dependencies of a specific system. When the file structure of the knowledge base reflects this Meta Model, retrieval becomes deterministic rather than probabilistic. Instead of hoping the vector database finds the right chunk, the agent knows exactly which branch of the knowledge tree to explore. Scalability and the Future of Agentic Operations Critics of this approach often point to the human cost of answering agent questions. Navakoti acknowledges this but argues the cost is front-loaded. You are effectively performing a one-time "denial of service" on your engineers to fix a decade of documentation debt. Once the 20% of most-used knowledge is curated into context blocks, the agent becomes semi-autonomous. The goal is to move the agent from being a pure consumer of information to a guardian of it. As context windows expand—with Claude now supporting 1 million tokens—the technical limitation is no longer memory size, but memory quality. By using failure as a scanner, enterprises can finally map their "unknown unknowns" and build a knowledge base that actually helps the AI move the Jira board.
Test-Driven Development
Concepts
May 2022 • 1 videos
High activity month for Test-Driven Development. ArjanCodes among the most active voices, with 1 videos across 1 sources.
Jun 2022 • 1 videos
High activity month for Test-Driven Development. ArjanCodes among the most active voices, with 1 videos across 1 sources.
Oct 2022 • 1 videos
High activity month for Test-Driven Development. ArjanCodes among the most active voices, with 1 videos across 1 sources.
Jul 2024 • 1 videos
High activity month for Test-Driven Development. Laravel among the most active voices, with 1 videos across 1 sources.
Apr 2026 • 1 videos
High activity month for Test-Driven Development. AI Engineer among the most active voices, with 1 videos across 1 sources.
May 2026 • 1 videos
High activity month for Test-Driven Development. AI Engineer among the most active voices, with 1 videos across 1 sources.
- May 5, 2026
- Apr 23, 2026
- Jul 31, 2024
- Oct 4, 2022
- Jun 24, 2022
Overview Writing unit tests for existing codebases is a common challenge for developers. Ideally, Test Driven Development (TDD) ensures code is born with tests, but real-world projects often contain legacy logic lacking proper validation. This tutorial demonstrates how to add robust testing to an existing Python system without altering the original source code immediately. By using pytest, we can secure business logic, verify data structures, and prepare the ground for future refactoring. Adding tests to a point-of-sale system helps identify brittle dependencies and ensures that core features like price calculation and payment validation remain stable during updates. Prerequisites To follow this guide, you should have a baseline understanding of Python syntax, including classes, methods, and decorators. Familiarity with the terminal and basic testing concepts like assertions is necessary. You will need a Python environment with pytest and pytest-cov installed to run the tests and generate coverage reports. Key Libraries & Tools * pytest: The primary testing framework used for writing and running test cases with simple assert statements. * pytest-cov: An extension that generates coverage reports to show which lines of code the tests actually exercise. * **Monkeypatch**: A built-in pytest fixture that allows you to safely mock or override functions, attributes, and environment variables during testing. Code Walkthrough Testing Data Structures We start with the simplest components: `LineItem` and `Order`. These are data-heavy and logic-light, making them ideal starting points. ```python from pay.order import LineItem def test_line_item_total(): item = LineItem(name="Test", price=100, quantity=5) assert item.total == 500 ``` In this snippet, we initialize a `LineItem` and use a standard `assert` to check if the property `total` calculates correctly. Handling Exceptions When testing a PaymentProcessor, we must verify that invalid inputs trigger the correct errors. We use `pytest.raises` as a context manager to catch expected exceptions. ```python import pytest from pay.processor import PaymentProcessor def test_invalid_api_key(): processor = PaymentProcessor(api_key="") with pytest.raises(ValueError): processor.charge("4242...", 12, 2024, 100) ``` This ensures the code fails gracefully when security requirements aren't met. Mocking Global Inputs The most difficult part of testing legacy code is dealing with `input()` calls and external dependencies. We use `monkeypatch` to simulate user keyboard input without stopping the test execution. ```python def test_pay_order(monkeypatch): inputs = ["1234123412341234", "12", "2024"] monkeypatch.setattr("builtins.input", lambda _: inputs.pop(0)) # ... call pay_order logic here ... ``` This replaces the standard input system with a lambda function that yields our predefined values one by one. Syntax Notes * **Test Discovery**: pytest automatically finds files starting with `test_` and functions starting with `test_`. * **Fixture Injection**: By including `monkeypatch` as an argument in your test function, pytest automatically provides the tool for that specific test case. * **Assertions**: Unlike the standard library's `unittest`, pytest relies on plain Python `assert` statements, making the code cleaner and more readable. Practical Examples Beyond point-of-sale systems, these techniques apply to any application where external API calls or user interactions are hard-coded into functions. For instance, if you have a script that fetches weather data, you can use `monkeypatch` to override the network request, returning a static JSON response instead of hitting a live server. This allows for fast, deterministic testing without an internet connection. Tips & Gotchas * **API Keys**: Never hard-code real API keys in your test files. Use environment variables or mock the validation check entirely to avoid security leaks. * **State Leakage**: Be careful when patching global objects. pytest's `monkeypatch` fixture automatically reverts changes after the test finishes, which is safer than manual patching. * **Coverage Trap**: 100% code coverage doesn't mean your code is bug-free; it just means every line was executed. Focus on testing edge cases like empty orders or dates in the past.
May 20, 2022