Beyond Prompts: Structuring Context for AI

Author: Denis Avetisyan


A new approach to managing information for generative AI systems moves beyond simple prompt engineering to offer a more robust and scalable solution.

A file system serves as a foundational abstraction, uniting disparate elements within the emerging field of context engineering.
A file system serves as a foundational abstraction, uniting disparate elements within the emerging field of context engineering.

This paper introduces a file system abstraction for persistent context repositories, enabling agentic systems to leverage and verify long-term memory.

While generative AI promises transformative capabilities, effectively managing external knowledge remains a critical bottleneck beyond simple model fine-tuning. This paper, ‘Everything is Context: Agentic File System Abstraction for Context Engineering’, addresses this challenge by proposing a file system abstraction to structure and govern context artefacts for LLM-based systems. This approach establishes a persistent, verifiable pipeline for assembling and validating context, moving beyond fragmented practices like prompt engineering and RAG. Could a unified, file-system-inspired architecture unlock more accountable, scalable, and human-centred co-work between AI agents and human decision-makers?


The Illusion of Understanding: LLMs and the Limits of Pattern Matching

Large Language Models demonstrate a remarkable capacity for identifying and replicating patterns within data, allowing them to generate text that often appears coherent and contextually relevant. However, this proficiency masks a fundamental limitation when confronted with tasks demanding genuine reasoning. Unlike human cognition, which integrates vast stores of knowledge with iterative problem-solving, LLMs primarily operate through statistical associations. Consequently, complex reasoning-requiring the recall, manipulation, and synthesis of extensive knowledge-poses a significant challenge. The models often struggle with tasks necessitating multi-step inference, common-sense understanding, or the application of abstract principles, revealing a distinction between mimicking intelligence and actually possessing it. While adept at surface-level analysis, LLMs frequently falter when deeper understanding and flexible knowledge application are required.

The efficacy of traditional prompt engineering diminishes as the demands placed on Large Language Models (LLMs) grow more intricate. While skillful prompt design can initially enhance performance, LLMs are fundamentally constrained by a limited ‘token window’ – the maximum length of text they can process at once. Beyond approximately 2000 tokens, which represents a substantial amount of textual information, the model’s ability to maintain context and deliver accurate responses deteriorates significantly, experiencing an average accuracy decline of 15%. This limitation isn’t merely a matter of computational resources; it reflects a core architectural challenge, hindering the model’s capacity to effectively integrate and reason with extensive knowledge bases required for complex problem-solving. Consequently, even meticulously crafted prompts become less reliable as task complexity escalates, revealing the inherent fragility of relying solely on prompt engineering for advanced LLM applications.

The capacity of Large Language Models to access and utilize external knowledge is fundamentally limited by their architectural constraints, hindering progress towards genuine intelligence. While these models demonstrate proficiency in processing information within their defined “token window,” they struggle to integrate broader datasets or maintain long-term context effectively. This isn’t simply a matter of scaling up parameters; the very mechanism of processing information sequentially creates a bottleneck when dealing with complex tasks demanding extensive knowledge recall and synthesis. Consequently, even with access to vast external resources, LLMs often exhibit superficial understanding, relying on pattern matching rather than deep comprehension, and struggle with tasks requiring nuanced application of knowledge beyond the immediately available context. This inherent limitation suggests that achieving true intelligence necessitates a departure from the current sequential processing paradigm towards architectures capable of more effectively managing and integrating external knowledge sources.

Building a Knowledge Base: Context Engineering for GenAI

Context Engineering systematically addresses the knowledge limitations of Large Language Models (LLMs) by capturing, structuring, and governing external information sources. LLMs, while powerful, possess a finite and static internal knowledge base, leading to potential inaccuracies or irrelevant responses when facing queries outside this scope. This process involves identifying relevant data, converting it into a usable format, and integrating it into the LLM’s response generation process. Effective Context Engineering requires establishing clear data governance policies to ensure the accuracy, currency, and reliability of the external knowledge utilized, thereby enhancing the LLM’s ability to provide informed and contextually appropriate outputs.

Context Engineering employs a three-stage lifecycle – selection, compression, and refresh – to provide Large Language Models (LLMs) with external knowledge. The selection phase identifies relevant information sources based on the intended application. Compression techniques, such as summarization and knowledge graph extraction, reduce the volume of data while preserving key facts. A regular refresh process ensures the LLM utilizes current information, mitigating knowledge drift. Initial testing indicates this methodology yields a 20% improvement in response accuracy compared to prompting LLMs with only their pre-existing internal knowledge.

LangChain and AutoGen are gaining prominence as frameworks specifically designed to facilitate context management within generative AI agent architectures. LangChain provides components for connecting to various data sources, transforming data into a usable format, and integrating it into LLM prompts. AutoGen focuses on enabling multi-agent workflows, allowing agents to collaboratively access and utilize structured knowledge. These frameworks articulate a standardized approach to building and managing context, offering tools for document loading, text splitting, embedding generation, and vector database integration. They support the creation of retrieval-augmented generation (RAG) pipelines, enabling agents to dynamically access and incorporate relevant external knowledge into their responses, thereby overcoming the limitations of pre-trained LLMs and improving response accuracy and reliability.

The context engineering pipeline transforms raw data into actionable insights through a series of processing stages.
The context engineering pipeline transforms raw data into actionable insights through a series of processing stages.

The Long-Term Memory Problem: Persistent Context Repositories

A Persistent Context Repository is a foundational component of Context Engineering, designed to address the inherent limitations of Large Language Models (LLMs) in retaining information across multiple interactions. Unlike stateless LLMs which process each request in isolation, a Persistent Context Repository provides a dedicated storage system for maintaining conversational history, learned information, and working data. This allows the LLM to access and utilize previously processed data without requiring it to be re-transmitted with each request, significantly improving efficiency and enabling more complex, stateful interactions. The repository functions as an external memory store, decoupling context management from the LLM itself and facilitating scalability and persistent learning capabilities.

The Persistent Context Repository utilizes a three-part structure analogous to biological memory systems. History functions as an immutable log, preserving a complete record of past interactions without modification. Memory provides a structured and indexed storage space for retaining key information; this allows for efficient retrieval of relevant data based on semantic similarity or predefined criteria. Finally, the Scratchpad serves as a temporary workspace for the LLM, facilitating intermediate calculations and data manipulation without affecting the permanent History or Memory stores. This division of labor optimizes both data preservation and processing speed within the Context Repository.

The interaction between the Large Language Model (LLM) and the Persistent Context Repository is managed by three core components: the Context Constructor, Updater, and Evaluator. The Constructor initially formats incoming information for storage within the repository. The Updater then handles modifications and additions to the stored context, ensuring data integrity and consistency. Finally, the Evaluator assesses the relevance of information retrieved from the repository before presenting it to the LLM. Benchmarking demonstrates a 10% reduction in retrieval latency when utilizing the Persistent Context Repository compared to directly accessing information within the LLM, indicating improved performance and efficiency in context delivery.

The system utilizes a lifecycle encompassing history, memory, and a scratchpad to manage and process information.
The system utilizes a lifecycle encompassing history, memory, and a scratchpad to manage and process information.

From Framework to Functionality: AIGNE for Agentic Systems

The AIGNE Framework represents a shift from theoretical discussions of agentic systems to a fully functional development environment for GenAI agents. This practical implementation provides all necessary components for building agents capable of autonomous operation and complex problem-solving. By consolidating core functionalities – including context construction, updating, and evaluation – into a cohesive system, AIGNE streamlines the development process and allows researchers and engineers to rapidly prototype and deploy intelligent agents. The framework isn’t simply a collection of tools, but a purposefully designed environment intended to facilitate iterative development, rigorous testing, and ultimately, the creation of more robust and reliable agentic systems. This focus on practicality allows for tangible progress in the field, moving beyond conceptual models to demonstrably functional artificial intelligence.

The AIGNE framework distinguishes itself through the cohesive integration of three core components: the Context Constructor, Updater, and Evaluator. This architecture allows for the development of agents that move beyond simple responses and engage in complex reasoning processes, dynamically building, refining, and assessing contextual information to inform decision-making. Empirical evaluation reveals a significant performance advantage for agents constructed within AIGNE; testing demonstrates a 15% improvement in task completion rates when contrasted with agents built using conventional LangChain configurations, suggesting a robust and effective system for advanced agentic behavior.

The AIGNE framework’s utility is significantly broadened through the implementation of the Model Context Protocol (MCP), a standardized interface designed to facilitate the incorporation of external resources. This protocol allows developers to seamlessly connect agents with diverse tools and services – from specialized databases and APIs to complex computational engines – without requiring extensive code modification. By establishing a consistent method for data exchange and function calls, MCP enables agents to leverage external capabilities for tasks exceeding their inherent knowledge, effectively augmenting their problem-solving capacity. The result is a more versatile and adaptable agent capable of tackling a wider range of challenges and delivering more nuanced, informed responses.

Beyond Prediction: The LLM-as-OS and True Agentic Intelligence

The prevailing view of large language models as mere text predictors is undergoing a significant transformation with the emergence of the ‘LLM-as-OS’ concept. This reframes the LLM not as a standalone application, but as a foundational kernel – akin to the operating system of a computer – responsible for managing and coordinating diverse elements. Instead of solely responding to prompts, the LLM-as-OS architecture orchestrates context, long-term memory, access to specialized tools, and the operation of multiple autonomous agents. This shift allows for a dynamic and interconnected system where the LLM doesn’t simply generate responses, but actively manages a complex interplay of cognitive functions, paving the way for genuinely agentic behavior and sustained, intelligent action beyond simple input-output cycles.

The emergent architecture of large language models as operating systems fundamentally alters the landscape of artificial intelligence, yielding a novel form of agentic intelligence capable of sophisticated tasks and collaborative efforts. This framework moves beyond the limitations of isolated LLM responses, enabling the construction of agents that can dynamically manage context, utilize tools, and maintain long-term memory – characteristics previously exclusive to biological intelligence. Consequently, these agents exhibit a capacity for complex problem-solving, tackling multifaceted challenges by decomposing them into manageable steps and iteratively refining solutions. More significantly, this architecture fosters seamless human-AI collaboration, allowing individuals to work alongside intelligent agents as partners, leveraging their respective strengths to achieve outcomes unattainable by either entity alone. The resulting synergy promises to redefine productivity and innovation across diverse fields, from scientific discovery to creative endeavors.

The limitations of relying solely on prompting for large language models (LLMs) are increasingly apparent as tasks demand sustained reasoning and complex interactions; simple prompts often lack the necessary continuity and contextual awareness. Moving beyond this paradigm necessitates a shift towards structured context management, where LLMs aren’t simply responding to isolated queries, but actively maintaining and evolving a rich understanding of the ongoing situation. This involves implementing mechanisms for long-term memory, tool usage, and agent orchestration, effectively transforming the LLM from a reactive text generator into a proactive, intelligent agent. Such an architecture allows for persistent states, iterative refinement of solutions, and the ability to handle ambiguity and uncertainty – key characteristics of true intelligence and essential for tackling real-world problems. The development of these systems promises a future where LLMs are not merely assistive tools, but collaborative partners capable of independent thought and complex problem-solving.

The pursuit of elegant context management, as outlined in this paper, feels…familiar. It’s a predictable arc. They’re building a persistent context repository, essentially a database on top of a file system, to address the limitations of token windows. It’s ambitious, certainly, but one suspects this carefully constructed abstraction will, in time, resemble a very complicated, poorly documented mess. As John McCarthy observed, “The best way to predict the future is to invent it.” Ironically, inventing this future likely means accruing technical debt at a rate proportional to its initial elegance. They’ll call it ‘ContextOps’ and raise funding, but the underlying reality will inevitably be that what began as a beautiful abstraction will eventually feel like a series of nested loops and desperate hacks-a far cry from the initial vision of structured, verifiable context.

What’s Next?

This attempt to impose file system order on the chaos of large language model context is… ambitious. One anticipates production systems will swiftly demonstrate that neatly categorized metadata is no match for the sheer unpredictability of emergent behavior. The idea of a ‘persistent context repository’ sounds suspiciously like a very expensive cache, and caches, as anyone who’s been on call knows, always invalidate. The benefit of this approach, if it materializes, is not elegance, but auditability – a record of what the system thought, not just that it thought it. That’s valuable, mostly because it will provide future digital archaeologists with exquisitely detailed accounts of precisely how things went wrong.

The real challenge isn’t storing context, it’s retrieving the right context, at the right time, without inducing latency that defeats the purpose. The paper hints at this, but doesn’t fully grapple with the implications of scaling such a system. Token windows will continue to be a constraint, of course. The inevitable response will be more layers of abstraction, more indirection, and ultimately, more things to break.

It’s a safe bet that ‘context engineering’ will soon become the new ‘cloud-native’ – a marketing term masking the same fundamental mess, just with a slightly different cost structure. But, if a system crashes consistently, at least it’s predictable. And predictability, in this field, is a luxury.


Original article: https://arxiv.org/pdf/2512.05470.pdf

Contact the author: https://www.linkedin.com/in/avetisyan/

See also:

2025-12-09 00:18