<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Damodar Periwal on Medium]]></title>
        <description><![CDATA[Stories by Damodar Periwal on Medium]]></description>
        <link>https://medium.com/@dperiwal_80867?source=rss-817063d95cb9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jZCA1A06gkSv_DVFJyhLgA.jpeg</url>
            <title>Stories by Damodar Periwal on Medium</title>
            <link>https://medium.com/@dperiwal_80867?source=rss-817063d95cb9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 00:24:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dperiwal_80867/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exposing Governed Business Objects to AI Agents with MCP]]></title>
            <link>https://medium.com/@dperiwal_80867/exposing-governed-business-objects-to-ai-agents-with-mcp-a280d9096d07?source=rss-817063d95cb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a280d9096d07</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[data-architecture]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Damodar Periwal]]></dc:creator>
            <pubDate>Mon, 09 Feb 2026 21:18:45 GMT</pubDate>
            <atom:updated>2026-02-09T23:22:23.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ut-ntLJkFuo0lMNnUDsYRw.png" /></figure><p><em>Formalizing </em><strong><em>structural semantic intent</em></strong><em> into a declarative object model for AI agents</em></p><h3>Abstract</h3><p>As AI agents increasingly answer analytical questions over enterprise data, a common challenge arises: they often spend their reasoning effort reconstructing relational structure and composing SQL, leading to large prompts, fragile joins, and inconsistent results. This article presents a pattern for reducing that cognitive and token load by exposing curated business objects via the Model Context Protocol (MCP).</p><p>Using ORMCP — an MCP-compliant server that exposes object-oriented views of relational data — and a declarative Object-Relational Mapping (ORM) specification, we show how existing relational data can be surfaced as governed, object-oriented JSON. This shifts complexity out of prompts and into a durable object layer, improving reasoning quality, reducing token usage, and strengthening operational control.</p><p>More precisely, <strong>structural semantic intent</strong> — the definition of entities, attributes, identifiers, and relationships — is captured and formalized in a declarative ORM specification. Business data remains persisted in relational tables, while object-shaped JSON is produced at runtime by applying that same specification through the ORM and MCP layers.</p><p>Looking ahead, this structural foundation also provides a natural extension point for richer semantic and ontological metadata — such as synonyms, canonical concept definitions, and intent annotations — enabling deeper data integration without disrupting existing systems.</p><h3>The Problem: Asking Agents to Think Like Databases</h3><p>Most enterprise data still lives in relational systems. When AI agents are connected directly to these systems, they are typically provided with:</p><p>· table and column descriptions,</p><p>· foreign key relationships,</p><p>· usage notes and human annotations,</p><p>· and instructions for composing SQL safely.</p><p>While this information is necessary, it forces agents to reason at the wrong abstraction level. Instead of thinking in terms of <em>customers</em>, <em>orders</em>, or <em>products</em>, agents must reconstruct these concepts mentally from schemas and joins. The result is:</p><p>· large prompt contexts,</p><p>· repeated query-correction loops,</p><p>· join and filter errors,</p><p>· and difficulty enforcing consistent governance boundaries.</p><h3>Observation: The Semantic Model Already Exists</h3><p>In practice, enterprises already curate rich semantic knowledge about their data:</p><p>· which tables are commonly used together,</p><p>· which columns represent business concepts,</p><p>· how metrics should be interpreted,</p><p>· and which data is appropriate for which audiences.</p><p>In modern data-agent architectures, this information often appears as layered context — usage statistics, annotations, enriched metadata, and institutional knowledge. However, this context is typically injected dynamically into prompts rather than persisted as a first-class artifact.</p><h3>The Core Idea: Move Structure Out of Prompts</h3><p>The key idea explored here is simple:</p><p>Formalize curated semantic context into a declarative object model, and expose the related business data to AI agents via MCP.</p><p>Instead of repeatedly injecting <strong>semantic hints</strong> into prompts, we capture <strong>structural business intent</strong> once — using a declarative ORM specification that defines object classes, attributes, identifiers, and relationships. That specification acts as a durable semantic contract, while the underlying relational data remains the system of record.</p><p>At runtime, AI agents interact with business objects governed by this specification. The semantic context is <em>defined</em> by the <strong>object model</strong> (as expressed in the ORM specification), the business data is <em>persisted</em> in the database, and the object layer materializes that <strong>structural intent</strong> on demand.</p><p>This separation yields:</p><p>· a stable semantic contract,</p><p>· versioned and reviewable configuration,</p><p>· auditable governance boundaries,</p><p>· and reusable semantics across agents and workflows.</p><h3>Architecture Overview</h3><h4>Terminology clarification: semantic context</h4><p><em>Semantic context</em> refers to <strong>structural business intent</strong> curated by humans — entities, identifiers, attributes, and relationships — rather than rich domain ontology or business rules. It is <strong>not persisted as data</strong>. Instead, it is <strong>formalized and captured</strong> in a declarative ORM specification. Business data is persisted in relational systems and <strong>exposed at runtime</strong> as objects governed by that specification.</p><p>At a high level, the architecture looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*HBmG66O3DEg4VkJZSB6Q_Q.png" /><figcaption><strong>Figure 1. MCP-based semantic object layer for AI agents</strong><br> <em>(AI agents interact with governed business objects instead of raw schemas and SQL.)</em></figcaption></figure><p>1. <strong>Declarative ORM Specification</strong> — A text-based mapping defines business object classes, attributes, and relationships, derived from curated context and optionally reverse-engineered from an existing relational schema.</p><p>2. <strong>ORM-backed Microservice (Gilhari)</strong> — Executes object-oriented queries defined by the mapping, translating object navigation and aggregation into efficient database access.</p><p>3. <strong>MCP Server (ORMCP)</strong> — Exposes the object model and data access operations as MCP tools (e.g., object discovery, querying, aggregation).</p><p>4. <strong>AI Agent Runtime</strong> — Issues MCP tool calls that operate on business objects rather than generating SQL.</p><p>The agent never needs to construct joins or reason about schemas — it navigates objects and relationships instead.</p><h3>Semantic context vs. runtime object data</h3><p>When we say <em>“formalizing semantic context into a declarative object model,”</em> we mean:</p><p>· <strong>Semantic context</strong> (structural business intent): entities, attributes, identifiers, relationships, and naming conventions — often scattered across annotations, docs, and tribal knowledge.</p><p>· <strong>Declarative ORM specification</strong> (the durable artifact): a versioned text mapping that encodes that semantic context as object classes, attributes, and relationships mapped to tables/columns.</p><p>· <strong>Business object data</strong> (the runtime payload): the actual records persisted in relational tables, retrieved and returned to the agent as object-shaped JSON.</p><p>In other words, we persist the <strong>specification</strong> (configuration) and the <strong>data</strong> (in the database). The <em>object layer</em> is the governed, runtime view produced when the specification is applied to the data.</p><h3>Declarative ORM Specification</h3><p>The declarative specification is a text-based mapping file that defines:</p><p>· object classes (e.g., Customer, Order, Product),</p><p>· attributes and identifiers,</p><p>· relationships (one-to-many, many-to-one),</p><p>· and constraints.</p><p>Crucially, this specification can be <strong>automatically reverse-engineered</strong> from an existing relational schema, providing a fast on-ramp for brownfield systems. Once generated, it can be refined using institutional knowledge and reviewed like any other configuration artifact.</p><h4>Curated Object Models via Mapping Units</h4><p>Beyond basic mapping, the ORM specification provides a powerful mechanism for <em>curating</em> how relational data is exposed. A specification conceptually defines a <strong>mapping unit</strong> that limits data exposure to a selected subset of the underlying schema, shaping a domain-appropriate object model for a particular use case.</p><p>In practice, this enables several important capabilities:</p><ul><li><strong>Selective table exposure</strong> — A database schema may contain dozens of tables, but only a subset may be relevant for a given domain or task. A mapping unit can expose only those objects, reducing cognitive load for both humans and AI agents.</li><li><strong>Domain-meaningful object names</strong> — Object classes can be named to reflect business concepts rather than physical table names (e.g., PO → PurchaseOrder, CUST → Customer).</li><li><strong>Curated attribute naming</strong> — Attributes can be named using domain language instead of raw column names (e.g., spend → alltime_total_spend, sid → supplier_id), improving interpretability without altering the underlying schema.</li><li><strong>Column-level filtering and protection</strong> — Only relevant, non-sensitive columns need to be exposed as attributes; unnecessary or sensitive fields remain hidden by construction.</li><li><strong>View-based modeling</strong> — Classes may be mapped not only to base tables but also to relational views defined in the database. This allows teams to leverage database-native capabilities — such as pre-joined views optimized for a specific access pattern or views that perform aggregations — while exposing the results cleanly as object attributes governed by the ORM specification.</li></ul><p>By defining different mapping units, the same underlying database schema can be repurposed into multiple, use-case-specific object models. Each ORM specification exposes a curated structural view of the data — neither more nor less than what is appropriate for a given domain or AI agent.</p><h3>Example: E-Commerce Object Model</h3><p>As a concrete illustration, consider a typical e-commerce domain consisting of:</p><p>· Customer<br>· Address<br>· CustomerOrder<br>· OrderItem<br>· Product<br>· Supplier</p><p>These objects and their relationships are inferred from a relational schema and captured in a declarative mapping file. An illustrative e-commerce ORM specification example is linked at the end of this article.</p><p>Through ORMCP, an AI agent can:</p><p>· list available business objects,</p><p>· retrieve a customer and follow related orders and items,</p><p>· compute aggregates such as total spend or order counts,</p><p>· all without writing or inspecting SQL.</p><p>The resulting responses are structured JSON documents aligned with the business domain.</p><h3>Why This Helps AI Agents</h3><h4>Improved Reasoning Quality</h4><p>Agents operate at the same abstraction level as users — business objects — rather than translating intent into SQL mechanics.</p><h4>Reduced Token Usage</h4><p>Compact object schemas replace verbose table dumps and join explanations, significantly reducing prompt size.</p><h4>Fewer Error Loops</h4><p>Join logic and relationship semantics are encoded once in the mapping, not reconstructed on every query.</p><h4>Stronger Governance</h4><p>Agents are restricted to explicitly modeled objects. Read-only modes and scoped object exposure provide natural guardrails.</p><h4>Centralized semantic knowledge (even without derived fields)</h4><p>Even if the current ORM runtime does not compute derived values or perform automatic synonym resolution, there is still significant value in centralizing semantic knowledge (e.g., domain vocabularies, canonical definitions, and controlled mappings) in a durable, structured form — either as an extension to the ORM specification or in an adjacent semantic store.</p><p>In this pattern, an agent can:</p><p>· <strong>Query and cache curated semantics via MCP</strong> (for example: canonical object/attribute names, definitions, allowed values, and relationship intent),</p><p>· <strong>Use that semantic context during inference</strong> to select the correct objects, paths, and filters, and to generate more precise MCP tool calls.</p><p>The result is more consistent agent behavior across questions and users, with less prompt bloat and fewer “guessing” loops.</p><h4>MCP as the Right Integration Point</h4><p>MCP provides a standardized way for AI agents to interact with external tools and data sources. By implementing this object layer as an MCP server, the approach:</p><p>· integrates cleanly with existing agent runtimes,</p><p>· requires no changes to core agent logic,</p><p>· allows incremental adoption alongside existing SQL-based tools.</p><p>The object layer becomes just another tool — albeit one operating at a higher semantic level.</p><h3>When This Pattern Makes Sense</h3><p>This approach is particularly well-suited for:</p><p>· internal analytics agents,</p><p>· enterprise data assistants,</p><p>· domains with stable business concepts but complex schemas,</p><p>· environments with strong governance and audit requirements.</p><p>It is not a replacement for SQL everywhere, but a complementary layer where semantic stability and reasoning quality matter.</p><h3>Toward Richer Semantics (Future Extensions)</h3><p>The approach described so far focuses on <strong>structural semantics</strong>: stabilizing entities, attributes, identifiers, and relationships so AI agents can reason over data without reconstructing joins or schemas. However, the same architecture naturally admits a path toward richer semantic integration.</p><p>One possible evolution is to extend the ORM grammar — or introduce a closely related companion specification — to capture <strong>ontological abstractions</strong> such as:</p><p>· synonyms and alternative domain vocabularies (e.g., <em>Client</em> vs. <em>Customer</em>),</p><p>· canonical definitions of business concepts,</p><p>· higher-level groupings and conceptual hierarchies,</p><p>· semantic annotations that guide intent resolution and interpretation.</p><p>Such semantic specifications could coexist with the traditional ORM mapping — either within the same artifact or as a separate, versioned companion — while remaining consumable through the same MCP interface. In this model, structural ORM continues to govern how data is accessed, while semantic extensions enrich how agents understand and reason about that data.</p><p>Importantly, this evolution does not require changes to the underlying relational systems. It builds incrementally on the same object-layer foundation, allowing teams to adopt richer semantics where needed while preserving the simplicity and determinism of structural ORM.</p><h3>Closing Thoughts</h3><p>As AI agents become long-lived participants in enterprise workflows, the way we expose data to them matters. Formalizing structural semantics as a declarative object model and exposing data through MCP at that level shifts complexity out of prompts and into governed infrastructure — without asking the agent to be a SQL expert.</p><p>The result is not only better agent behavior today, but a clear evolutionary path toward richer semantic integration tomorrow, with a clean separation between data structure, meaning, access control, and reasoning.</p><h3>Further Reading and Resources</h3><p>· <a href="https://github.com/softwaretree/ormcp-docs">ORMCP documentation and MCP tool reference</a></p><p>· <a href="https://github.com/SoftwareTree/gilhari_ecommerce_example/blob/main/sample_orm_specs/ecommerce_postgres_orm_example.jdx">Declarative ORM mapping example (e-commerce, mapping specification file)</a></p><p>· <a href="https://youtu.be/axFxuU4bgRg">Technical overview video: ORMCP, MCP &amp; Enterprise Data for AI Agents</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a280d9096d07" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>