Hexagonal architecture: the foundation that makes Lexiane future-proof
Why Lexiane is built on a hexagonal architecture (Ports & Adapters): modularity, technological independence, auditability, and resilience to changes in the AI ecosystem.
Last updated: March 11, 2026
AI is evolving at an unprecedented pace. A language model that sets the standard today may be obsolete in six months. A vector database considered state-of-the-art may be replaced by a more capable technology tomorrow. In this shifting environment, the question is not just “which model should we use?” — it is “how do we build a system that survives these changes?”
Lexiane answers this question with a strong architectural choice: hexagonal architecture.
What is hexagonal architecture?
Introduced by Alistair Cockburn in the 2000s, hexagonal architecture — also known as Ports & Adapters — is built on a simple but radical idea: separate what does not change from what can change.
At the center of the system sits the business domain: the core logic of the application, independent of any technology. In Lexiane’s case, this is the document search logic, relevance ranking, and response orchestration.
Around this core orbit ports — abstract interfaces that define what the system expects without dictating how it is provided — and adapters — the concrete implementations that connect the core to the outside world: an LLM API, a vector store, a document source connector, a user interface.
The domain does not know whether the response is generated by GPT-4, Mistral, or a local model. It does not know whether vectors are stored in Qdrant or Weaviate. It does not need to know — and that is precisely what makes it robust.
The decisive argument: AI changes fast, the core must not move
This is the most immediate and concrete advantage for a RAG system in production.
In a traditional monolithic or hardcoded architecture, the choice of a language model is often deeply embedded in the code. Switching LLM providers — or simply upgrading to a newer version — means modifying dozens of files, risking regressions, and mobilizing a team for weeks.
With a hexagonal architecture, switching models means plugging in a new adapter. The core system is untouched. Existing tests remain valid. The migration takes days, not months.
This is a reality that matters: organizations adopting RAG today cannot afford to be locked into a single provider or a frozen technology. Modularity is not an architectural luxury — it is a survival condition in an ecosystem as volatile as AI.
Hardcoding: short-term comfort, long-term trap
Hardcoding — writing technical dependencies, API keys, and calls to specific services directly into the code — is tempting. It is fast, simple, and works immediately.
Until the day it stops working.
A provider changes its API. A service is deprecated. Business needs evolve and a new document source must be integrated. In a hardcoded system, each change is a high-risk surgical intervention. In a hexagonal system, it is an adapter substitution.
The difference translates directly into maintenance cost, team velocity, and operational resilience. A well-structured system can be maintained, extended, and audited without fear of the domino effect — one component change breaking another, unexpected, elsewhere.
A serious asset for certification and audit
Hexagonal architecture is not only of interest to technical teams. It has direct implications for governance and compliance — two central concerns for any organization deploying an AI system on sensitive data.
A system clearly divided into domain and adapters is easier to audit. Each component has a defined and documentable scope. Data flows are traceable: you know exactly where a document travels, which layer has access to it, and how the response is constructed.
For ISO 27001 certification, GDPR compliance, or qualification with a security body, this architectural clarity is an accelerator. The auditor does not need to untangle monolithic code to understand how data is processed — the system structure explains it directly.
Lexiane was designed with this requirement in mind: a system whose behavior can be demonstrated, not merely promised.
In summary
| Challenge | Without hexagonal architecture | With hexagonal architecture |
|---|---|---|
| Switch LLM model | Partial code overhaul | Adapter substitution |
| Add a document source | Deep-level modifications | New connector plugged in |
| Compliance audit | Tedious monolith analysis | Documented, isolated scopes |
| Ongoing maintenance | Domino effect, regressions | Independent, testable components |
In a domain as rapidly evolving as document AI, building on modular foundations is not a precaution — it is the only serious way to build.
Lexiane is a sovereign RAG with hexagonal architecture, designed for organizations that handle sensitive documents and cannot afford to rebuild everything with every technological change.
Request access to the Auditable Core
Sign up to be notified when our Core audit programme opens. In accordance with our privacy policy, your professional email address will be used exclusively for this technical communication, with no subsequent marketing use. Access distributed via secure private registry.
Contact us