A multi-agent mesh architecture system that decomposes general AI into a service-mesh of specialized reasoning engines, orchestrated by a model-driven orchestrator with secure context exchange via MCP (Model Context Protocol).
Composable AI Advisors uses a multi-agent mesh pattern where:
- An orchestrator (general-purpose LLM constrained by models) decomposes tasks and coordinates specialists
- Domain models are static, machine-readable model descriptions (Turtle/JSON/Markdown) that LLMs use to assume stakeholder positions
- MCP Context & Trace layer provides secure context exchange, provenance, and audit
- Client applications consume orchestrated outputs
The system implements three bow-tie patterns:
- Architectural Bow-Tie: Many domain models → Constrained orchestrator → Many client applications
- Orchestrator Internal Bow-Tie: General-purpose LLM → Constrained by models (Turtle/Markdown) → Model-driven behavior
- Domain Model Internal Bow-Tie: General-purpose/for-purpose LLM → Constrained by models → Domain-specific behavior
From Monolithic LLMs to Modular AI - A Modern Framework for Composable AI Systems
flowchart TD
O["Orchestration\n(General-Purpose LLM)\nConstrained by Turtle/Markdown\n(Bow-Tie Pattern)"]
D1["Domain Model A\n(Tools + Rules)"]
D2["Domain Model B\n(Investments + Rules)"]
D3["Domain Model C\n(Cognition + Rules)"]
MCP["MCP Context & Trace Layer\n(Secure Context Exchange)"]
C["Clients:\nMapper, Legal DocBot, OSINT, Guidance, Audit, etc."]
O --> D1
O --> D2
O --> D3
D1 --> MCP
D2 --> MCP
D3 --> MCP
MCP --> C
- Not a monolithic LLM: System uses multiple specialized reasoning services
- Orchestration: General-purpose LLM constrained by models (bow-tie pattern) decomposes tasks and routes to specialists
- Service Mesh: Services use domain models to provide independent domain-specific capabilities (MaaS pattern)
- Domain Models: Static, machine-readable model descriptions of a domain (Turtle, JSON, or Markdown format)
- Used by LLMs to assume the position of a stakeholder for that domain
- Must be machine-readable since an LLM needs to read it
- Format preference: Turtle > JSON > Markdown (Markdown is least preferred)
- Current State: Multi-genetic LLM advisory capabilities are working
- Purpose: Secure protocol for context exchange between agents
- Components: Context, tools, metadata, traceability
- Implementation: Configuration in
.mcp/directory (to be added) - Benefits: Provenance tracking, audit trails, secure context sharing
- ContextSpore: Portable context bundles for agent continuity
- PromptSpore: Reusable prompt logic packets
- Purpose: Maintain context across agent sessions and multi-agent workflows
- Storage: Tracked in
spore_registry.ttl(RDF/Turtle)
- Format: Semantic web standards (RDF/Turtle)
- Purpose: Structured, machine-readable, interoperable data
- Files:
caa-glossary.ttl- Core CAA ontologyguidance.ttl- Guidance registryspore_registry.ttl- Spore trackingdocs/pod/- Plans of Day examples
- Structure: PDCA workflow (Plan-Do-Check-Act)
- Format: RDF/Turtle files
- Purpose: Structured daily planning with semantic relationships
- AI Generation: Uses Google Gemini AI for intelligent PoD creation
- Language: Python 3.11
- Framework: FastAPI
- RDF Processing: RDFLib
- AI Integration: Google Gemini (Generative AI)
- Deployment: Google Cloud Run
- Framework: React 18.2
- HTTP Client: Axios
- Web Server: Nginx
- Deployment: Google Cloud Run
- Ontologies: RDF/Turtle (.ttl files)
- Context Protocol: MCP (Model Context Protocol)
- API Format: JSON (RESTful)
- Laboratory: Public external endpoint at
observatory.niklon.com(served through Cloudflare) - Multi-LLM Development: Lab fully wired for multi-LLM development
- Component Repositories: Niklon organization repositories contain concrete, publicly available components
- Package Management: Several components available via PyPI
- CI/CD: SonarCloud-enabled CI/CD pipelines for component repositories
flowchart TD
R["composable-ai-advisors/"]
R --> backend["backend/ - FastAPI backend service"]
R --> frontend["frontend/ - React frontend service"]
R --> docs["docs/ - Documentation"]
docs --> pod["pod/ - Plans of Day examples"]
docs --> arch["architecture/ - Architecture diagrams"]
docs --> arcv["archive/ - Historical/hackathon docs"]
R --> scripts["scripts/ - Build and deployment scripts"]
R --> ttl["*.ttl - RDF/Turtle ontology files (root)"]
R --> agents["agents.md - AI agent guidance"]
R --> archmd["ARCHITECTURE.md - Architecture documentation"]
R --> deploymd["DEPLOYMENT.md - Deployment guide"]
R --> readme["README.md - This file"]
Configuration files (hidden from view):
.cursor/- Cursor IDE configuration and rules.mcp/- MCP configuration (to be added).cursorrules- Main Cursor rules
- Python 3.11+
- Node.js 18+
- Docker (for containerized deployment)
- Google Cloud Platform account (for Cloud Run deployment)
- Gemini API key (for AI features)
cd backend
pip install -r requirements.txt
export GEMINI_API_KEY=your-api-key-here
export PORT=8080
python main.pyThe backend will be available at http://localhost:8080
cd frontend
npm install
export REACT_APP_API_URL=http://localhost:8080
npm startThe frontend will be available at http://localhost:3000
See DEPLOYMENT.md for detailed deployment instructions.
- Multi-Agent Mesh: Decompose general AI into a service-mesh of specialized reasoning engines
- MaaS (Models as a Service): Each specialist reasoner runs as its own service/API
- Orchestration: General LLM coordinates domain-specific services
- Context Exchange: Use MCP for secure context, tools, and traceability
- Ontology-Driven: Use RDF/Turtle for structured, interoperable data
- Domain Accuracy: Dedicated expert models reduce hallucinations and enforce domain logic
- Personalization: The context layer personalizes outputs per user and data source without retraining the general model
- Governance: Clear service boundaries make decisions auditable and explainable
- Maintainability: Independent upgrades per domain reduce time-to-change
- Cost & Performance: Right-size models and infrastructure by workload rather than one giant footprint
The orchestrator uses three bow-tie patterns (all are present):
-
Architectural Bow-Tie: Many domain models → Constrained orchestrator → Many client applications
- This is the overall system architecture pattern
-
Orchestrator Internal Bow-Tie: General-purpose LLM → Constrained by models → Model-driven behavior
- This is how the orchestrator itself works internally
-
Domain Model/LLM Internal Bow-Tie: Each participant LLM (general-purpose or for-purpose) → Constrained by models → Domain-specific behavior
- Each domain model's LLM starts as a general-purpose or for-purpose LLM (e.g., coding-specific LLM for coding tasks)
- Models constrain each LLM to conform to domain requirements
- This is how each domain model's reasoning engine works internally
Key Points:
- General-Purpose LLM: The orchestrator is a general-purpose LLM
- Model Constraint: Models (RDF/Turtle or Markdown) constrain/whittle down the LLM's behavior
- Model Sources: Model can be RDF/Turtle files or Markdown documents
- Perspective Evaluation: Build model for orchestrator to properly evaluate different perspectives
- Confidence Threshold: Orchestrator must meet a confidence threshold (typically 90%)
- "Heat": The confidence measure is based on how the orchestrator is constructed
- Escalation: If confidence < threshold, escalate to human agent
- API Endpoints: Follow FastAPI patterns, use type hints
- RDF Processing: Use RDFLib, respect namespace conventions
- AI Integration: Google Gemini API for PoD generation
- Service Boundaries: Design as independent, orchestrated service
- MCP Awareness: Consider context exchange implications
- React Patterns: Component-based, modern hooks
- API Integration: Use Axios, handle async properly
- Data Visualization: Display PoDs, Spores, relationships
- UI/UX: Modern, responsive design
- State Management: Consider context/state patterns
- Namespace Usage: Follow conventions in
caa-glossary.ttl - SHACL Shapes: Use for validation when appropriate
- Relationships: Maintain semantic links (prov:wasGeneratedBy, etc.)
- Provenance: Track creation, modification, sources
- Consistency: Keep ontology files aligned with code
- agents.md - Comprehensive AI agent guidance and development workflow
- ARCHITECTURE.md - Detailed architecture diagrams and technology stack
- DEPLOYMENT.md - Deployment instructions and configuration
- internal-lingo-cheatsheet.md - Terminology glossary
- docs/BOOTSTRAP.md - Project bootstrap guide
- .cursorrules - Cursor IDE rules and guidelines
- .cursor/rules/ - Modular rule sets (architecture, ontology, MCP, coding standards)
See internal-lingo-cheatsheet.md for complete glossary. Quick reference:
- LIM42: Design-scaffolding workflow toolset
- BFG9K: Agent-orchestration framework (separate product/repo, not part of this architecture)
- Spore/ContextSpore/PromptSpore: Modular context/prompt packet
- MCP: Model Context Protocol
- MaaS: Models as a Service
- Mesh: Multi-agent service network
- PoD: Plan of Day (PDCA workflow)
- PDCA: Plan-Do-Check-Act cycle
When making changes:
- Check Architecture: Ensure changes align with multi-agent mesh pattern
- Update Ontologies: If adding new concepts, update relevant
.ttlfiles - Maintain MCP Compatibility: Consider context exchange implications
- Preserve Spore Patterns: Maintain context continuity mechanisms
- Document Changes: Update relevant
.mdfiles
- Current State: Multi-genetic LLM advisory capabilities are working
- Infrastructure: Laboratory at
observatory.niklon.comfully wired for multi-LLM development - MCP Integration: Configuration pending (see
.mcp/README.md) - Tool Adapters: Requirements for product delivery being determined
See LICENSE file for details.
- Niklon Organization Repositories: Concrete, publicly available components (some on PyPI, SonarCloud CI/CD)
- Graph RAG Chat Application: Related work on Graph RAG patterns with GraphDB and SPARQL
Built with ❤️ by BeastMost Systems / nkllon observatory