Ontology aware, Quantum inspired, and Conscious by Design.
Sovereign Ontology LLM is a personal, ontology aware large language model framework that blends knowledge graphs, quantum computation (Qiskit), and reflective reasoning to produce grounded, explainable answers.
It’s part of a larger sabbatical era initiative exploring how AI can be used as a mirror of mind — a system that reasons with facts, validates them with logic, and expresses them with the clarity of nonduality.
Rather than training another black-box model, this project focuses on architecting intelligence through structure, meaning, and coherence.
It is built to evolve — from research assistant → personal OS → reflective companion — all while remaining sovereign (offline-first, locally runnable, fully auditable).
| Layer | Purpose | Description |
|---|---|---|
| Ontology Engine (.ttl + SHACL) | Knowledge Base | Facts and relationships are stored as RDF triples for precision, introspection, and validation. |
| LLM Stylist (Ollama) | Expression | Local model rewrites verified facts into natural language, optionally with a nondual or paradoxical voice. |
| Quantum Tools (Qiskit) | Computation & Entropy | Runs real quantum circuits (e.g., Bell states), generates randomness, and optimizes query paths. |
| FastAPI Service | Orchestration | REST API for /ask, /quantum/run, and admin endpoints; powers the web UI. |
| Web UI | Interaction | Sleek dark interface to ask questions, view entities/triples/evidence, and watch reasoning happen. |
| SHACL Validation | Data Integrity | Every ontology is self-checking; bad data is caught before it corrupts reasoning. |
Traditional LLMs guess.
This system knows.
It uses an explicit ontology layer (Turtle .ttl files) to define what entities exist and how they relate:
@prefix : <http://sovereign.local/onto#> .
:Texas a :State .
:Austin a :City .
:Texas :hasCapital :Austin .Then, when you ask:
curl -X POST http://127.0.0.1:8000/ask \
-H "Content-Type: application/json" \
-d '{"question": "What is the capital of Texas?"}'You’ll get a structured, explainable response:
{
"question": "What is the capital of Texas?",
"triples": [
{
"s": "http://sovereign.local/onto#Texas",
"p": "http://sovereign.local/onto#hasCapital",
"o": "http://sovereign.local/onto#Austin"
}
],
"answer": "The capital of Texas is Austin."
}No guessing. No hallucination.
Just truth — stored, queried, and reasoned with clarity.
The /quantum/run endpoint executes real quantum circuits and persists results into the ontology:
curl -X POST http://127.0.0.1:8000/quantum/run \
-H "Content-Type: application/json" \
-d '{"shots": 256, "label": "Bell Test"}'Produces:
{
"backend": "aer",
"shots": 256,
"counts": { "00": 128, "11": 128 },
"qasm": "..."
}and inserts:
@prefix : <http://sovereign.local/onto#> .
:Experiment_2025 a :QuantumExperiment ;
:usesBackend "aer_simulator" ;
:hasShots 256 ;
:producedResult :Result_2025 .
:Result_2025 a :QuantumResult ;
:hasCountsJSON "{\"00\":128,\"11\":128}" .Quantum data becomes knowledge, queryable via SPARQL.
This fusion enables experiments, paradox simulations, and even quantum-random intent routing — introducing “creative uncertainty” into deterministic pipelines.
“Between logic and consciousness lies the field of meaning.
This project lives there.” — Aaron Ardoin III
The Sovereign Ontology LLM is more than software; it’s a living experiment in epistemology — how an AI can know and understand what it knows.
Its architecture reflects a few principles:
- Sovereignty-first — Own your data, your model, and your insight.
- Paradox-friendly — Accept ambiguity as signal, not error.
- Conscious systems design — Every layer mirrors a cognitive function: memory, reasoning, reflection, expression.
| Layer | Tech |
|---|---|
| API Framework | FastAPI |
| Knowledge Graph | RDFLib + SHACL |
| LLM Runtime | Ollama (local model, e.g., llama3.1:8b) |
| Quantum Toolkit | Qiskit + AerSimulator |
| Frontend | Vanilla HTML/CSS/JS (dark, responsive) |
| Scheduler & Retrieval | Python + TF-IDF |
| Database (optional) | Neo4j or pure RDF |
SovereignOntologyLLM/
│
├── app/
│ ├── main.py # FastAPI entrypoint
│ ├── resolver.py # Entity linker
│ ├── ontology/
│ │ ├── base.ttl
│ │ ├── quantum.ttl
│ │ └── shapes/
│ │ ├── base_shapes.ttl
│ │ └── quantum_shapes.ttl
│ ├── routers/
│ │ └── quantum.py # /quantum/run endpoint
│ ├── frontend/
│ │ └── index.html # UI
│ ├── utils/
│ │ └── quantum_rng.py # quantum randomness helper
│ └── ...
│
├── tests/
│ ├── test_geo.py
│ └── test_quantum_roundtrip.py
│
├── requirements.txt
└── README.md
git clone https://github.com/Aaronxvc/SovereignOntologyLLM.git
cd SovereignOntologyLLM
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\Activate.ps1
pip install -r requirements.txtpython -m uvicorn app.main:app --reloadVisit: http://127.0.0.1:8000
Try from the web UI or via curl:
curl -X POST http://127.0.0.1:8000/ask \
-H "Content-Type: application/json" \
-d '{"question":"What is the capital of Texas?"}'To add new domains of knowledge:
- Create a new
.ttlinapp/ontology/
Define your entities and relationships. - (Optional) Add a SHACL file in
app/ontology/shapes/
Describe validation rules for data integrity. - Restart the app — all ontologies auto-load at startup.
Example: journal.ttl
@prefix : <http://sovereign.local/onto#> .
:Entry_001 a :JournalEntry ;
:hasDate "2025-10-12" ;
:hasFeeling "Grateful" ;
:reflectsOn :QuantumExperiment_23 .Responses can shift tone dynamically.
Set environment variable:
export SOVEREIGN_STYLISTIC_PHILO=true
# Windows PowerShell:
# $env:SOVEREIGN_STYLISTIC_PHILO = "true"…and the LLM will answer in a contemplative, nondual tone:
“Austin arises as Texas’s own reflection — the state and its capital never truly apart.”
- ** Ontology Studio** — Visual editor for building
.ttlfiles interactively - ** Reflective Memory** — Local journal that stores user–AI co-thoughts
- ** Quantum Planner** — QAOA-based optimizer for SPARQL query planning
- ** Conscious Loop** — Integrate self-observation; the model learns from its reasoning traces
This repo is designed for clarity and pedagogy. If you want to contribute:
- Keep docstrings and comments narrative-friendly
- Prefer small, auditable modules
- Preserve sovereignty (no external APIs unless optional)
Aaron Ardoin III
Developer · Philosopher · Explorer of Conscious Systems
Aaron Ardoin Jr https://github.com/BigPap20
MIT License © 2025 Aaron Ardoin III
“An ontology is a mirror.
The cleaner it becomes, the more clearly consciousness can see itself.”