Self-hosted service
aws/context-ontology-accelerator avatar
aws/context-ontology-accelerator

aws/context-ontology-accelerator: what the Scan, Model, Serve pipeline actually gives an agent

An open-source, ontology-based semantic context accelerator that enables AI agents to make more accurate, consistent, and explainable decisions.

746 stars84 forksPythonApache-2.0

At a glance

What is it?
An AWS-published, Apache-2.0 semantic context layer that wires ontology induction, SPARQL federation and MCP tooling into one Python monorepo. It is a build-it-yourself foundation for teams already committed to AWS CDK, not a drop-in context store.
Who is it for?
Adopt it if you are building on AWS, already run CDK, and need an agent's answers traceable to an ontology plus rules rather than to embedding similarity. Skip it if you want a hosted context service or cannot take on Java, Node and pnpm in the build.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 4 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem is context that cannot be checked after the fact

Retrieval-augmented agents return passages. A passage can be relevant and still be wrong for the decision at hand, and nothing in a vector store tells you which business rule the answer violated. This project takes the other route: it puts a formal ontology and a rule layer between the data and the agent, so a retrieved fact can be validated against declared business logic before an action is chosen. The README describes the goal as enabling agents to "retrieve context, validate it against business logic, and determine correct actions." The audience is narrow. It is for platform teams inside AWS shops who have heterogeneous sources (databases plus unstructured documents), a compliance or consistency requirement, and the appetite to run a knowledge graph. It is not for a single-team prototype that needs a context window filled by Friday.

Scan, Model, Serve is three workloads wearing one repository

The README states the workflow as Scan, then Model, then Serve. Scan covers connecting data sources, discovering schemas, enriching metadata and ingesting unstructured documents. Model covers inducing and managing ontologies, defining metrics, and building a unified semantic graph. Serve covers querying through SPARQL federation in the Virtual Knowledge Graph, traversing the graph, and handing context to agents over MCP. The repository layout shows these are separate Python packages rather than one service: packages/sources for ingestion, packages/ontology-engine for induction and reasoning, packages/metric-service for metric authoring, packages/vkg for the Ontop-backed virtual graph, packages/context-manager for query orchestration and upstream clients, and packages/mcp-server for the agent-facing tools. Reasoning is delegated to HermiT and ELK, which the README lists under ontology-engine. That matters for sizing: ELK is the lighter profile, HermiT the heavier one, and you will be choosing between them per ontology rather than once globally. The API surface is not hand-written. models/ holds Smithy definitions as the source of truth, and smithy-generated/ is produced from them into OpenAPI, Python interfaces and a TypeScript client.

Getting it running means a full toolchain, not a pip install

The prerequisites list is the honest signal of scope: Python 3.12, Node.js 22 or later, Docker, pnpm, Java 17 with Gradle for Smithy codegen, and uv for Python packages. The README's setup block is four commands after cloning. Clone at a release tag rather than main, because the README says main tracks ongoing development and recommends starting from a tagged release. Then make setup, make format, make lint, make test. The full developer guide lives at external-docs/content/getting-started.md, which is the file to read before anything else. Deployment is not in the quick start at all. It sits in infra/, an AWS CDK project in TypeScript with foundation and per-service stacks, and in scripts/, described as CI-agnostic build, test and deploy scripts. So the realistic first day is: install Java and Gradle, run the Smithy codegen, confirm the generated OpenAPI matches what you expect, then read the CDK stacks to see which AWS resources get created on your account before you run a deploy.

Authorization is namespace-scoped, and that shapes your team topology

Access is governed by namespace isolation plus role-based access control. There are namespace-scoped roles (owner, maintainer, data-steward, data-analyst) and platform-level roles (platform-admin, platform-viewer) that apply across all namespaces. The control-plane README is cited for the grants and authorization model, and that is where the real detail lives. The design choice worth noting is that platform roles cut across namespaces while the rest do not. In practice that means the person who can see everything is a distinct, small set, and day-to-day ontology edits happen inside a namespace boundary. If your organisation has one central data team and several consuming teams, the mapping is not automatic: you have to decide whether the central team holds platform-admin or whether each consuming team owns a namespace with its own maintainer. The README does not resolve that for you.

The repository is a read-only mirror, which caps your options

This is the constraint that should decide the evaluation. The README states plainly that the repository is published as a read-only mirror and that pull requests are not being accepted at this time. Bugs and feedback go through GitHub Issues. There is a note pointing Amazon employees to CONTRIBUTING.md for direction. For everyone else, the practical consequence is that a fix you need is a fork you maintain yourself, against a codebase with Smithy codegen, CDK stacks and nine packages. The release cadence visible in the supplied material is roughly weekly across v0.2.1, v0.2.2 and v0.3.0, all within about three weeks. Frequent releases are good for picking up fixes and bad for fork maintenance, because rebasing your patch onto each tag is recurring work. Budget for that before you build a critical path on top of it.

Where it is the wrong tool, and what to use instead

If your problem is document question answering over a corpus that changes daily, this is heavy machinery. You would be running ontology induction, a reasoning engine and a virtual knowledge graph to answer questions a chunk-and-embed pipeline handles adequately. The alternative that fits that case is a plain retrieval stack: chunk documents, embed them, store vectors, retrieve top-k. The difference in approach is the direction of validation. A vector store ranks by similarity and offers no mechanism to reject a retrieved chunk for violating a business rule. This project's Serve layer is built so that retrieved context is checked against the ontology and rules before it reaches the agent. That check is exactly what you are paying for in Java, Docker, CDK and reasoning time, and if you do not need the check, you are paying for nothing. A second case: if you cannot deploy into an AWS account with CDK, the infra/ directory is the only deployment path shown, and there is no documented local-only mode in the material provided.

Licence, dependencies and the maintenance bill

The project is Apache-2.0. The README includes an external dependencies section that names owlready2 under LGPL-3.0 as the listed dependency, with the usual Amazon disclaimer that the list is provided for convenience and is not guaranteed complete or current. That is a real consideration rather than boilerplate: LGPL-3.0 and Apache-2.0 are not the same terms, and the README itself says to consult your company's open source approval policy before proceeding. This is not legal advice; treat it as a prompt to route the dependency list through whoever handles that at your organisation. On maintenance: the moving parts are Python, TypeScript, Java and Gradle, plus pnpm and uv as package managers and Nx for monorepo orchestration. Each of those has its own upgrade treadmill, and mypy is configured strict, so a dependency bump that changes a type signature surfaces as a build failure rather than a runtime surprise. That is a good property, and it is also work.

Who should adopt it, and the two checks to run first

Adopt it if you are on AWS, you already run CDK, and your requirement is that an agent's answer be traceable to a declared ontology and a rule, not to a similarity score. The MCP server package is the piece that makes the graph reachable from an agent, and the Smithy models mean the API contracts are versioned in the repository rather than in prose. Do not adopt it if you need a hosted service, if you cannot accept a read-only mirror with issue-only feedback, or if the team that would own it does not have Java and Gradle in its build environment. Two checks before you commit. First, clone the release tag and diff the Smithy models under models/ against the generated artefacts in smithy-generated/ to confirm the tag is internally consistent. Second, read packages/control-plane/README.md and map its namespace-scoped and platform-level roles onto real people, because the authorization model is the part that determines whether the thing is usable by more than one team.

Editorial conclusion

Adopt it if you are building on AWS, already run CDK, and need an agent's answers traceable to an ontology plus rules rather than to embedding similarity. Skip it if you want a hosted context service or cannot take on Java, Node and pnpm in the build. Before committing, verify two things from the repository itself: that the release tag you clone matches the Smithy models under models/, and that the namespace-scoped roles in packages/control-plane/README.md line up with who on your team will actually author ontology changes.

Official sources

  1. aws/context-ontology-accelerator on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes