RISE Enhanced Architecture: Indigenous AI DSL Server#
Desired Outcome#
A dual-protocol semantic framework server (LSP + MCP) that makes the IAIP research framework a first-class participant in both IDE environments and multi-agent workflows, grounded in medicine-wheel ontology types and governed by Indigenous data sovereignty (OCAP).
Current Reality#
The original January 2026 scaffolding defined a Python LSP server with 5 components (Concept Registry, LSP Operations, Relational Graph, Indigenous Knowledge Mapper, Plugin Lifecycle). Since then, the ecosystem has evolved: medicine-wheel npm packages provide typed ontology primitives, agent orchestration patterns have been analyzed, MCP has become the agent integration standard, and ceremony protocol workflows have been formalized.
Structural Tension#
The gap between a standalone LSP concept server and a fully integrated ontology-aware, agent-participatory, ceremony-governed semantic framework that serves as the knowledge backbone for the entire IAIP ecosystem.
Enhanced Architecture#
``` βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β IAIP DSL Server β β β β βββββββββββββββ βββββββββββββββ ββββββββββββββββββ β β β LSP Layer β β MCP Layer β β Ceremony Gate β β β β (pygls) β β (mcp-sdk) β β (OCAP+4Dir) β β β ββββββββ¬ββββββββ ββββββββ¬ββββββββ βββββββββ¬βββββββββ β β β β β β β ββββββββΌββββββββββββββββββΌβββββββββββββββββββΌβββββββββ β β β Unified Query Engine β β β β ββββββββββββ ββββββββββββ ββββββββββββββββββββββ β β β β β Concept β βRelationalβ β Indigenous Knowledgeβ β β β β β Registry β β Graph β β Mapper β β β β β β β β Engine β β β β β β β ββββββ¬ββββββ ββββββ¬ββββββ βββββββββββ¬βββββββββββ β β β β β β β β β β β ββββββΌββββββββββββββΌβββββββββββββββββΌβββββββββββ β β β β β Ontology Bridge Layer β β β β β β (medicine-wheel-ontology-core alignment) β β β β β β RelationalNode Β· Relation Β· OcapFlags β β β β β β CeremonyLog Β· NarrativeBeat Β· Direction β β β β β ββββββββββββββββββββ¬ββββββββββββββββββββββββββββ β β β βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ β β β β β βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ β β β Storage & Persistence β β β β YAML Registry Β· JSON Index Β· Wisdom Ledger (SQLite) β β β β OCAP Audit Log Β· Ceremony Change Journal β β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β β IDE Clients AI Agents Orchestrators (Claude Code, (mia-code, (LangGraph, VS Code) miadi-code, A2A, NATS) Heyva, Anikwag) ```
Component Inventory#
Tier 1: Core (Original + Refined)#
| Component | Source Spec | What It Creates |
|---|---|---|
| Concept Registry | rispecs.md Β§1 | Indexed, queryable store of 40+ IAIP concepts with full relational and Indigenous knowledge context |
| LSP Operations Handler | rispecs.md Β§2 | IDE-native semantic navigation (hover, goToDefinition, findReferences, diagnostics) for framework concepts |
| Relational Graph Engine | rispecs.md Β§3 | Knowledge graph with typed relationships (foundational, complementary, enables, contextualizes, ceremonial) |
| Indigenous Knowledge Mapper | rispecs.md Β§4 | Four-lens enrichment (Two-Eyed Seeing, polycentric, relational, ceremonial) on every concept operation |
| Plugin Lifecycle | rispecs.md Β§5 | Auto-install, start, health-check, graceful shutdown |
Tier 2: Ontology Bridge (New)#
| Component | Source Spec | What It Creates |
|---|---|---|
| Ontology Type Alignment | rispecs-ontology-bridge.md | Concept entries that are structurally compatible with RelationalNode, Relation, OcapFlags from medicine-wheel-ontology-core |
| OCAP Governance Layer | rispecs-ceremony-protocol.md | Ownership/Control/Access/Possession enforcement on every concept access |
| Four Directions Enrichment | rispecs-ceremony-protocol.md | Every concept and operation carries directional alignment metadata |
| Export Pipeline | rispecs-ontology-bridge.md | Generate JSON Schema, OWL/SHACL, JSON-LD from the concept registry |
Tier 3: Agent Integration (New)#
| Component | Source Spec | What It Creates |
|---|---|---|
| MCP Tool Exposure | rispecs-mcp-tools.md | 8+ MCP tools for agent-driven concept resolution, relationship queries, coherence validation |
| Agent Orchestration Interface | rispecs-agent-orchestration.md | Server participates in multi-agent workflows as concept-resolution specialist |
| Wisdom Ledger | rispecs-wisdom-ledger.md | Temporal tracking of concept usage, evolution, and cross-session learning |
| Ceremony Change Protocol | rispecs-ceremony-protocol.md | Concept changes wrapped in ceremony-aware workflows with consent and reflection |
Technology Stack#
``` Language: Python 3.10+ LSP Library: pygls >= 1.0 MCP Library: mcp (official Python SDK) Graph Library: networkx (in-memory relational graph) Storage: YAML (source) + JSON (index) + SQLite (wisdom ledger) Validation: pydantic (type alignment with medicine-wheel types) Export: rdflib (OWL/SHACL generation, optional) Testing: pytest + pytest-asyncio Packaging: pyproject.toml with optional dependency groups ```
Data Flow#
Concept Query Flow (LSP)#
``` User hovers over "structural tension" in .md file β LSP Client sends textDocument/hover β Server tokenizes position, matches concept ID β Concept Registry returns full entry β Indigenous Knowledge Mapper enriches with 4 lenses β OCAP layer checks access flags β Formatted Markdown response returned to client β Response includes: definition, relationships, Indigenous context, directional alignment β Latency: <50ms ```
Concept Query Flow (MCP)#
``` Agent calls iaip_concept_lookup tool with {"concept": "creative-orientation"} β MCP handler receives tool call β Same Unified Query Engine processes request β Returns structured JSON with concept, relationships, Indigenous context β Agent integrates into its reasoning context β Latency: <100ms ```
Concept Change Flow (Ceremony Protocol)#
``` Human edits concept-registry.yaml β File watcher detects change β Ceremony Gate activates: 1. Diff analysis: what changed? 2. OCAP check: does editor have authority? 3. Directional check: which direction does this change serve? 4. If significant change β ceremony-required flag set 5. Change journaled in Ceremony Change Log β Registry reloaded β Wisdom Ledger updated with change event β Connected agents notified via MCP ```
File Structure (Generated)#
``` indigenous_ai_dsl_server/ βββ init.py βββ main.py # Entry point βββ server.py # Dual-protocol server setup (LSP + MCP) βββ config.py # Configuration and paths β βββ registry/ β βββ init.py β βββ loader.py # YAML β JSON β in-memory index β βββ concept.py # Concept data model (pydantic) β βββ index.py # Fast lookup index β βββ watcher.py # File change detection β βββ graph/ β βββ init.py β βββ engine.py # networkx-based relational graph β βββ relationships.py # Typed relationship definitions β βββ traversal.py # Path finding, context expansion β βββ knowledge/ β βββ init.py β βββ mapper.py # Indigenous Knowledge Mapper β βββ directions.py # Four Directions enrichment β βββ ocap.py # OCAP governance enforcement β βββ lsp/ β βββ init.py β βββ handler.py # LSP operation handlers β βββ diagnostics.py # Terminology validation β βββ formatters.py # Response formatting (Markdown) β βββ mcp/ β βββ init.py β βββ tools.py # MCP tool definitions β βββ resources.py # MCP resource exposure β βββ prompts.py # MCP prompt templates β βββ ontology/ β βββ init.py β βββ bridge.py # medicine-wheel type alignment β βββ export.py # OWL/SHACL/JSON-LD generation β βββ types.py # Pydantic models aligned to MW types β βββ wisdom/ β βββ init.py β βββ ledger.py # SQLite-based usage tracking β βββ ceremony.py # Change ceremony protocol β βββ data/ β βββ concept-registry.yaml # Source of truth β βββ concept-registry.json # Generated index β βββ wisdom.db # Wisdom Ledger SQLite β βββ tests/ β βββ test_registry.py β βββ test_graph.py β βββ test_lsp.py β βββ test_mcp.py β βββ test_ocap.py β βββ test_ceremony.py β βββ plugin.json # Claude Code plugin manifest βββ .lsp.json # LSP routing configuration βββ pyproject.toml # Package definition βββ README.md # Installation and usage ```
Advancing Patterns#
- Concept β Ontology β Agent Intelligence: Each concept lookup enriches the requesting agent's understanding, creating a flywheel where agents become more framework-literate with each interaction
- YAML edit β Ceremony β Community consensus: Concept evolution is never unilateral; the ceremony protocol ensures changes are witnessed and consented
- Usage tracking β Wisdom Ledger β Emergent patterns: Over time, the Wisdom Ledger reveals which concepts are most queried, which relationships are most traversed, and which directional alignments emerge naturally
- LSP + MCP β Universal access: Whether a human is writing in their IDE or an agent is reasoning in a multi-agent workflow, the same semantic knowledge is accessible through the appropriate protocol