Architecture
How GramSpec works
The model of what your data means is built with the people who run the business, kept as one open document, and every app and agent works from it. Your database stays where it is. The details are in the specification and the API reference; this page is the map.
01 · The foundation
Built with the people who know what the data means
The model is the part of a foundation that fails, and everything else is built on top of it. Starmaker builds it with the business, and checks it against your data before anyone relies on it.
- They say what they measure. The people who make the decisions describe the business in their own words. Each thing they name becomes a sentence they can read back and correct.
- Each word is traced to your data. The person who knows the database shows where each one comes from, whether it is stored in a column or worked out from other values.
- Built and checked. The star schema is loaded and tested against your rows, and it is ready for reports and AI the same day. The same model is kept in Grammar as a graph.
02 · The product
One model between AI and your data
The language model reads the graph, never your DDL, and never holds your credentials. Every query it writes is checked before it runs, and your database stays where it is.
- Make the model. In Starmaker from a conversation, or in Grammar from sentences, a database or a Power BI template. Either way it becomes one graph.
- Ask. A question in Vision, an investigation in Reason, or your own agent through the API and MCP.
- The model reads the graph. It is given the graph, not your DDL, and never your connection details.
- SQL is written, then checked. Every query must pass a read-only check before it runs. Reason and agents over MCP also check every table and column it names against the graph (SQL Server today).
- Your database answers. Credentials are encrypted at rest and never enter a prompt. The model sees only the rows a query returns, capped, when it writes the answer.
- Answers show their SQL. A Vision answer and a Reason finding both show the query behind them.
03 · The graph
Four ways in, one document out
However a model starts, it becomes the same open document, and everything downstream works from that one file.
- Start from any of them. Say what the business measures in Starmaker, or describe it in sentences in Grammar. Read the tables, keys and links of a live database. Import a Power BI template and take the fields its report uses, or every column of those tables. Or open a graph file you already have.
- Read it and correct it. Every relationship is a sentence a business person can check, and every rule is visible on the canvas. The document follows the open GRAM specification.
- The same document feeds everything. Connect it to your database and it is ready for Vision and Reason; serve it to your own apps and agents through the API and MCP; on the Enterprise plan, export it as a file.
04 · The API and MCP
Your own software, on the same model
The GRAM API gives your own software the same model the apps use. On the bring-your-own-model lane, GramSpec sends the prompt and the graph and nothing else, so your questions, your rows and your model traffic stay with you.
- Fetch the contract. One request returns the complete system prompt for your project, or the AnalystKit: the agent prompt, the graph and the seven tool schemas.
- Cache it by hash. The response carries a content hash. Send it back and you get 304 until the graph, the rules or the dialect change.
- Call your own model. Any provider, your account, your data residency.
- Run it on your own database, under your own read-only rules. On this lane GramSpec never sees a question, a row or your model traffic.
- Or take the managed lane. Send a question against a connected graph and GramSpec calls the model and returns the SQL and a chart setting. Your app runs the SQL.
Add questions to your product
SystemPrompt
Fetch the prompt, pair it with your customer's question, and call the model you already run.
Build an investigator
AnalystKit
The agent prompt, the graph and the tool schemas. You own the loop, the compute and the data.
No model of your own
Query
Send a question against a connected graph and get back the SQL and a chart setting, ready to use.
Connect an agent
MCP
Point Claude Code, Cursor or any MCP client at gramspec.com/mcp. It signs in with OAuth or an API key and gets eight read-only tools over your graphs.
Request and response shapes, caching and errors are in the API reference.
05 · Why the model comes first
The model is the part of a foundation that fails.
Storing and moving data is solved engineering, and it does its job well. What it cannot do is decide what the data means: what one row is, which customer is the customer, which date counts. Those are decisions. When nobody writes them down, every report and every AI answer makes its own guess.
Your database has probably run the business for years, keyed and constrained, and it is sound. The meaning the business attaches to it lives with the people who run the business and the person who knows the database, so that is where the model is built.
GRAM is a language for writing that meaning down, grounded in Object-Role Modeling and four decades of fact-based modeling research.
The method
Facts you can read out loud.
Every relationship in a GRAM graph is written as a sentence the business can read and check, like “Each product belongs to exactly one subcategory.” Behind each sentence are the rules that decide how a query joins and counts.
We tested what a machine actually uses. With every verb replaced by a generic label, the generated SQL came out the same, as long as the rules and the role names were intact. The sentence is for the people who check the model, and the rules are what make the query right.
We also built a graph in invented vocabulary, words no model had seen, with the rules intact, and the queries came back correct. Where a run failed, the cause was always something the graph had not yet written down, and each one became a fix.