OntoForge is a Neo4j-native ontology studio for designing graph schemas and using them through generic, schema-driven APIs. The schema (entity types, relation types, properties) is global and independent. Ontologies are named lenses over this schema — either unscoped (full schema access) or scoped to a filtered subset of types and properties. The system provides dedicated REST and MCP interfaces for modeling and runtime, stores schema and data together in Neo4j for portability, and supports JSON-based export and import.
Monorepo with two main parts:
- Frontend — React (npm)
- Backend — Python
This project uses uv for all Python dependency and environment management.
- Do NOT use
pip install,pip freeze, orpipcommands directly. - Use
uv runto execute scripts and commands within the project environment. - Use
uv add/uv removeto manage dependencies. - Use
uv syncto install dependencies from the lockfile. - The virtual environment lives in
.venv/and is managed by uv automatically.
- Use
npm install,npm run, etc. for frontend tasks.
- KISS — Keep it simple. Prefer the simplest solution that meets the requirement.
- YAGNI — You ain't gonna need it. Don't build for hypothetical future requirements.
- Every architectural decision requires user approval. Never settle a design or architectural choice silently — always ask the user first.
- Consistency first. All docs, code, and architecture must be consistent with each other. If an inconsistency is detected, STOP and ask the user — never silently resolve or ignore it.
- Single source of truth. Each piece of information belongs in exactly one place. Avoid redundancy by default. When a fact is needed elsewhere, reference the source — don't copy it.
- Progressive disclosure. Layer documents from overview to detail. High-level docs link to deeper docs, not duplicate their content.
- When redundancy exists, maintain consistency. Brief summaries referencing detail docs are acceptable. But if two places state the same fact, both must stay in sync. When they diverge, flag it.
- Don't document what the code makes obvious. Reference code by semantic anchors (module names, class names, section names) — never by file:line numbers. Feature docs should weave code references into prose, not be bare reference lists. Avoid code blocks in docs unless needed to illustrate a major pattern.
- Respect document lifecycle. Documents form a directed chain: PRD → Architecture → Code. Later documents may reference earlier ones, never the reverse. Place information where it belongs in this lifecycle.
- Do NOT add
Co-Authored-Bylines mentioning Claude or any AI model. - Do NOT reference the AI model in commit messages.
- Write commit messages as if authored solely by the developer.
When running multi-agent test-and-bugfix cycles, follow the strategy in docs/testing-strategy.md. It defines agent roles (tester, dev, team lead), sequential execution flow, fresh-state protocol, handover formats, and test plans for backend and frontend.
Before tagging a release, read docs/releasing.md.
# 1. Start Neo4j
docker compose up -d
# 2. Start the backend (serves both modeling and runtime APIs)
cd backend && uv run uvicorn ontoforge_server.main:app --host 0.0.0.0 --port 8000
# 3. Start the frontend (in a separate terminal)
cd frontend && npm run devThe backend runs on http://localhost:8000, the frontend on http://localhost:5173.
- Schema — the global set of entity types, relation types, and property definitions. The ground truth, independent of any ontology.
- Ontology — a named lens over the schema. Unscoped ontologies expose everything; scoped ontologies filter to specific types and properties via
INCLUDES_TYPEedges. - Modeling mode — designing and managing the global schema and ontology scopes
- Runtime mode — querying and mutating knowledge data through an ontology lens
- REST API — HTTP interface for both modeling and runtime operations
- MCP interface — Model Context Protocol server for AI-driven interactions
- Neo4j — all schema and data stored in Neo4j for portability