Platform Architecture

ContextWeaver β€” Platform Flows

The end-to-end journey from login to agentic AI action. Explore how authentication, plugin building, knowledge ingestion, policy cascades, and real-time tool execution come together in one unified platform.

Back to Home
Section 1

Authentication Flow

Secure identity resolution from first click to active session

πŸ‘€User
🌐brainzbytes.com
πŸ”Entra ID OIDC
🎫Session + JWT
πŸ–₯️Dashboard / Chat
πŸ‘€ User Entry β€” Clean AI Assistant

End users land on a streamlined chat interface with engine selection. No admin clutter β€” just natural language interaction with policy-aware AI.

Route: /chat β†’ engine dropdown β†’ SSE stream
πŸ›‘οΈ Admin Entry β€” Full Dashboard

Admins access the complete Cerebro dashboard: plugin builder, visual designer, engine management, monitoring, and user administration.

Route: /dash β†’ role: admin β†’ full nav
Branded Login Page

Custom-branded Entra ID login with organization logo, SSO options, and conditional access policies pre-evaluated.

Endpoint: /auth/login β†’ 302 redirect
Entra ID Authorization

Full OAuth 2.0 + OIDC flow with MFA enforcement, conditional access evaluation, and token issuance with custom claims.

Protocol: OIDC β€’ Grant: auth_code + PKCE
Session Establishment

HttpOnly secure cookie set with encrypted session. X-User-Email header propagated to all downstream services for identity context.

Token: HttpOnly cookie β€’ Header: X-User-Email
Section 2

Admin Flow β€” Building Plugins & Agents

From natural language description to production-deployed AI engine

1
Plugin Builder β€” AI-Powered

Describe your plugin in natural language. The AI generates a complete plugin structure: plugin.yaml (metadata & config), tools.py (MCP tool handlers), resources.py (MCP resources), and prompts.py (prompt templates). Edit inline, test immediately.

Output: plugin.yaml, tools.py, resources.py, prompts.py
2
Visual Designer β€” Drag & Drop Canvas

Compose engines visually: attach plugins from the library, wire connectors (GitHub, Jira, Email), add knowledge sources, and set security policies. The canvas auto-validates dependencies and generates the engine manifest.

Canvas β†’ engine.yaml manifest generation
3
Knowledge Ingestion

Attach knowledge sources at any scope β€” URLs, documents, wikis, raw text. Azure AI Search indexes with vector + hybrid search. Five-level scope hierarchy: Engine β†’ Plugin β†’ Org β†’ Group β†’ Personal. Each index tagged with scope for policy cascade resolution.

Azure AI Search β€’ Vector + Hybrid β€’ 5-level scope
4
Deploy All β€” One Click

Helm chart generation from engine manifest. Kubernetes deployment with namespace isolation, Workload Identity binding, secret injection. Plugin distribution from Hub library. Connector registration with health verification. Full rollback on failure.

Helm β†’ K8s deploy β†’ health check β†’ rollback
5
Git Export

All plugins version-controlled in a GitHub repository. Changes tracked, diffs reviewed, rollbacks simple. The plugin library stays in sync with the Git source of truth.

Repo: ajaypunreddy/contextweaver-plugins
Section 3

Architecture Diagram

Three-pillar architecture powering the ContextWeaver platform

ContextWeaver Platform 🧠 Cerebro (Hub) ⚡ MCP Engines 🌐 Loom (Infra) Visual Designer Plugin Builder Plugin Library Auth & Session ai-dev-agent travel-agency email-service AKS Cosmos DB AI Search Key Vault Cerebro orchestrates engines → Engines run on AKS → All infra managed by Loom
Section 4

Agentic Flow β€” When a User Prompts

The most important flow: from natural language prompt to agentic AI action

1
πŸ” Discovery

The agent reads MCP resources β€” cerebro://indexes to inventory all available knowledge sources and cerebro://status to verify backend health. This builds an awareness map of what knowledge and tools are available before any action is taken.

MCP resources: cerebro://indexes, cerebro://status
2
πŸ“š Hierarchical Multi-Index Search

Calls search_index across every relevant index. Results are scored via the 5-level scope cascade: USER_PREFERENCE > GROUP_POLICY > ORG_POLICY > PLUGIN_KNOWLEDGE > ENGINE_KNOWLEDGE. Policy-tagged results are treated as hard limits β€” the agent cannot override them.

Tool: search_index β€’ Scoring: 5-level cascade
3
βš™οΈ Parameter Resolution

Merges defaults from base indexes with user-level and team-level overrides. Secrets are identified and masked β€” never shown to the user or included in LLM context. A merged values table is constructed for tool execution.

Merge: base defaults β†’ team overrides β†’ user overrides
4
πŸ› οΈ Plugin Tool Execution

Loaded plugins expose MCP tools β€” jira-search-issues, github-create-pr, email-send. Before executing, the agent searches knowledge for applicable policies. [ORG_POLICY] and [GROUP_POLICY] results are hard limits that constrain execution. User preferences are additive guidance.

Policy check β†’ credential inject β†’ tool execute
5
πŸš€ Async Deployment (Action Requests)

For action requests, the agent generates resolved CLI commands from templates + merged parameters. Commands execute via background jobs with real-time step-by-step progress streaming back to the user interface.

Background job β†’ SSE progress stream β†’ completion
6
🧠 RAG Synthesis

All search contexts, resolved parameters, and tool results feed into the LLM for streaming RAG synthesis. Tokens stream in real-time to the user interface. The model is constrained by policy-tagged context β€” hard limits shape the response.

LLM: Azure OpenAI β€’ Streaming: SSE tokens
7
πŸ“Ž Citations

Structured citations link every claim back to its source document, URL, and originating index. Users see exactly where information came from and can verify against the original source material.

Format: [source_title](url) β€” index: scope_tag
Section 5

Policy Cascade

Five-level priority system governing every AI decision

P1
User Preference
Highest priority β€” personal customizations and overrides
Additive
P2
Group Policy
Team-level constraints β€” cannot be overridden by users
Hard Limit
P3
Org Policy
Organization-wide rules β€” enforced across all teams
Hard Limit
P4
Plugin Knowledge
Plugin-scoped context and documentation
Context
P5
Engine Knowledge
Base engine context β€” lowest priority, broadest scope
Context
Section 6

Security Architecture

Defense in depth across every layer of the platform

πŸ”‘
User-Scoped Credentials

Per-user API tokens stored in Azure Key Vault. Each user’s credentials isolated, encrypted at rest with HSM-backed keys. No shared secrets.

🏰
Engine Isolation

Each engine runs in its own Kubernetes namespace with a dedicated service account. Workload Identity for zero-secret pod authentication to Azure services.

πŸ“‹
Audit Logging

Every tool invocation logged with identity, timestamp, parameters, result, and MCP trace events. Full audit trail for compliance and debugging.

πŸšͺ
Approval Gates

Per-tool security controls: read_only, approval_required, min_role. Dangerous operations require explicit human approval before execution.

πŸ”
Secret Masking

Secrets are never displayed in UI, logs, or LLM context. Key Vault references render as πŸ” *** in all interfaces. Zero secret leakage.

🌐
Cloud-Neutral

Terraform modules for Azure, AWS, and GCP. Swap cloud providers via configuration. No vendor lock-in at the infrastructure layer.

Section 7

MCP Protocol

Engines expose tools, resources, and prompts over standard MCP transports

Compatible Clients

Any MCP-compatible client can connect: GitHub Copilot, Claude Desktop, ContextWeaver Chat, and Custom Apps. Standard protocol means zero integration code.

SSE /sse HTTP /mcp Dash /dash
Built-in Tools
  • list_indexes List all available knowledge indexes
  • search_index Search a specific index with query
  • search_all Search across all accessible indexes
  • ask_cerebro Full RAG query with citations
Built-in Resources
  • cerebro://indexes Index inventory and metadata
  • cerebro://status Backend health and readiness
  • cerebro://plugins Installed plugin manifest
Built-in Prompts
  • rag_query Structured RAG query with policy awareness
  • compare_indexes Compare content across indexes
  • summarize_index Summarize an entire index
Section 8

User Experience Journey

From first login to verified AI-powered action

1
Login & Engine Selection

Entra SSO authenticates the user seamlessly. A clean chat interface opens with an engine dropdown β€” select your team’s AI agent and start prompting immediately.

2
Configure Credentials

The settings panel shows which connectors need credentials (GitHub PAT, Jira API key, etc.). Each credential is stored in Key Vault per user identity β€” never shared, never exposed.

3
Ask & Act

Type in natural language. The agent performs: policy search β†’ credential resolution β†’ tool execution β†’ streaming result with full pipeline trace. Actions happen in real-time with progress indicators.

4
Review & Verify

Every response includes citations linking to source documents. A pipeline trace panel shows which tools were called, which indexes were searched, and timing for each step. Full transparency.