A Modular, Protocol-Driven Architecture for Distributed LLM-Based Applications
CNPC R&D (DIFC) COMPANY LIMITED
*Corresponding author
Received: 2026-10-28Revised: 2026-10-30Accepted: 2026-11-06Published: 2026-12-15
AESIG 2026, 2(3), 23-65
Funding: This research was funded by the China National Petroleum Corporation (CNPC) under Grant No. 2025ZG60. The APC was funded by the authors’ institution.
Abstract
Large Language Models (LLMs) are evolving from simple chatbots into autonomous agents that use tools, maintain memory, and collaborate across distributed systems. However, current frameworks lack standardized interfaces, leading to tight coupling between components (LLMs, memory, tools) and poor replaceability. This paper proposes a modular reference architecture for distributed LLM-based applications built on the Model Context Protocol (MCP) as the universal communication backbone. The architecture defines six decoupled service categories—Bus, Compute, Fast Memory, External Memory, Storage, and Tools—each with a complete API specification. A two-tier memory hier-archy separates low-latency ephemeral storage from persistent retrievable storage, optimizing both cost and response time. Components are independently deployable and communicate exclusively through MCP, enabling hot-swapping and incremental upgrades. A real-world case study from the oil and gas domain—an autonomous production diagnostic and reservoir connectivity analysis agent—demonstrates the architecture’s feasibility. Quantitative evaluation shows 50% reduction in response time through fast memory, 53% reduction in token usage, and near-zero code changes for component replacement. The architecture provides a standardized, composable foundation for next-generation LLM systems.
Keywords: Model Context Protocol (MCP); LLM agents; Distributed AI architecture; Modular design; API decoupling; Composable systems
Full Text
Download the full text PDF for viewing and using it according to the license of this paper.
References
- Anthropic. Model Context Protocol. 2024. Available from: https://modelcontextprotocol.io
- Anthropic. Claude 3 Model Family. 2024. Available from: https://www.anthropic.com/claude
- Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, et al. Attention Is All You Need. Advances in Neural Information Processing Systems. 2017;30.
- Brown T, et al. Language Models are Few-Shot Learners. Advances in Neural Information Processing Systems. 2020;33.
- OpenAI. GPT-4 Technical Report. arXiv preprint arXiv:2303.08774. 2023.
- Touvron H, et al. Llama 2: Open Foundation and Fine-Tuned Chat Models. arXiv preprint arX - iv:2307.09288. 2023.
- Wei J, et al. Chain-of-Thought Prompting Elicits 65 ASEIG V ol. 2, Issue. 3 ( 2026 ) Reasoning in Large Language Models. Advances in Neural Information Processing Systems. 2022;35.
- Schick T, et al. Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv preprint arXiv:2302.04761. 2023.
- Chase H. LangChain. 2022. Available from: https:// github.com/langchain-ai/langchain
- Wu Q, et al. AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation. arXiv preprint arXiv:2308.08155. 2023.
- Microsoft. Semantic Kernel. 2023. Available from: https://github.com/microsoft/semantic-kernel
- OpenAI. Function Calling and Other API Updates. 2023. Available from: https://openai.com/blog/ function-calling-and-other-api-updates
- Anthropic. Tool Use with Claude. 2024. Available from: https://docs.anthropic.com/claude/docs/tool-use
- CrewAI. CrewAI: Multi-Agent Framework. 2024. Available from: https://github.com/joaomdmoura/ crewAI
- Packer C, Fang V, Patil SG, Lin K, Wooders S, Gon-zalez JE. MemGPT: Towards LLMs as Operating Systems. arXiv preprint arXiv:2310.08560. 2023.
- Zep. Zep: Long-term Memory for AI Assistants. 2024. Available from: https://github.com/getzep/zep
- Lewis P, Perez E, Piktus A, Petroni F, Karpukhin V, Goyal N, et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Advances in Neural Information Processing Systems. 2020;33:9459–9474.
- KServe. KServe: Standardized Serverless ML Inference Platform on Kubernetes. 2022. Available from: https://github.com/kserve/kserve
- BentoML. BentoML: Unified Model Serving Framework. 2021. Available from: https://github. com/bentoml/BentoML
- Moritz P, Nishihara R, Wang S, Tumanov A, Liaw R, Liang E, et al. Ray: A Distributed Framework for Emerging AI Applications. Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18). 2018:561–577.
- JSON-RPC Working Group. JSON-RPC 2.0 Specification. 2013. Available from: https://www.jsonrpc.org/specification
- JSON Schema Working Group. JSON Schema Draft-07. 2020. Available from: https://json-schema.org/
- OpenTelemetry. OpenTelemetry Specification. 2024. Available from: https://opentelemetry.io/
- Docker Inc. Docker Container Platform. 2024. Available from: https://www.docker.com/
- Cloud Native Computing Foundation. Kubernetes Production-Grade Container Orchestration. 2024. Available from: https://kubernetes.io/
- Locust. Locust: Open Source Load Testing Tool. 2024. Available from: https://locust.io/


