weaveIntel Documentation
Protocol-first, capability-driven AI runtime for TypeScript. 42 packages. 20 runnable examples. 13 deployment targets. Zero vendor lock-in.
Overview
weaveIntel is a modular monorepo that provides composable building blocks for building production-grade AI applications - from simple chat completions to multi-agent orchestration with tool calling, RAG, memory, observability, and inter-agent communication.
Why weaveIntel?
Protocol-first - Core defines contracts (interfaces), not implementations. Swap providers without changing application code.
Capability-driven - Models, agents, and tools declare capabilities. The router selects the right model for the job.
Zero vendor lock-in - Core has zero vendor dependencies. Provider packages are thin adapters.
Composable middleware - Intercept any model call with typed middleware for logging, retries, redaction, caching, or custom logic.
Production patterns built in - Fallback chains, budget enforcement, PII redaction, structured output, evaluation suites, and observability from day one.
Quick Start
Prerequisites
Node.js >= 20, npm >= 10
Install
git clone https://github.com/gibyvarghese/weaveintel.git
cd weaveintel
npm install
npm run build
Environment Variables
export OPENAI_API_KEY="sk-..." # For OpenAI provider
export ANTHROPIC_API_KEY="sk-ant-..." # For Anthropic provider
Run your first example
# No API key needed - uses fake models
npx tsx examples/02-tool-calling-agent.ts
# With OpenAI
OPENAI_API_KEY=sk-... npx tsx examples/01-simple-chat.ts
# With Anthropic
ANTHROPIC_API_KEY=sk-ant-... npx tsx examples/11-anthropic-provider.ts
Architecture
weaveIntel is structured in six layers. Each layer depends only on the layers below it. Core has zero vendor dependencies.
Core Design Principles
Interfaces in core, implementations in leaf packages - core never imports from providers or runtime packages.
Middleware is generic - Middleware<T, R> works for any request/response pair. Compose with weaveComposeMiddleware().
Everything is capability-gated - HasCapabilities interface + weaveCapabilitySet() let the router and consumers check model abilities at runtime.
Context flows everywhere - ExecutionContext carries userId, traceId, budget, deadline, and cancellation signal through every call.
Core & Models
| Package | Description |
|---|---|
| @weaveintel/core | Contracts, types, context, events, middleware, plugin registry - zero vendor deps |
| @weaveintel/models | Unified model router with fallback chains, streaming, middleware, capability selection |
| @weaveintel/provider-openai | OpenAI adapter - chat, streaming, embeddings, image, audio, structured output, vision |
| @weaveintel/provider-anthropic | Anthropic adapter - chat, streaming, tool use, extended thinking, vision, token counting, batches, computer use, prompt caching |
| @weaveintel/testing | Fake models, embeddings, vector stores, and MCP transports for deterministic tests |
Agent Orchestration
| Package | Description |
|---|---|
| @weaveintel/agents | Agent runtime - ReAct tool-calling loop, supervisor-worker hierarchies |
| @weaveintel/workflows | Multi-step workflow engine with conditional branching, checkpointing, and compensation |
| @weaveintel/human-tasks | Human-in-the-loop - approval tasks, review queues, escalation, decision logging, policy evaluation |
| @weaveintel/contracts | Completion contracts with evidence bundles and completion reports |
| @weaveintel/prompts | Versioned prompt templates, A/B experiments, instruction bundles, scoped resolution |
| @weaveintel/routing | Smart model routing - health tracking, capability matching, weighted scoring, explainable decisions |
Knowledge & Retrieval
| Package | Description |
|---|---|
| @weaveintel/retrieval | Document chunking (6 strategies), embedding pipeline, vector retrieval with reranking |
| @weaveintel/memory | Conversation, semantic, and entity memory implementations |
| @weaveintel/graph | Knowledge graph - entity nodes, relationship edges, entity linking, timeline, graph retrieval |
| @weaveintel/extraction | Document extraction pipeline - entity, metadata, timeline, table, code, and task stages |
| @weaveintel/cache | Semantic caching with TTL, LRU eviction, and embedding-based lookup |
| @weaveintel/artifacts | Artifact storage - versioned blobs with metadata, tagging, and lifecycle management |
Tools & Connectivity
| Package | Description |
|---|---|
| @weaveintel/tools | Extended tool registry - versioning, risk tagging, health tracking, test harness |
| @weaveintel/tools-search | Web search tools - DuckDuckGo, Brave, with structured result parsing |
| @weaveintel/tools-browser | Browser tools - URL fetching, content extraction, page rendering |
| @weaveintel/tools-http | HTTP endpoint tools - REST client with auth, rate limiting, schema validation |
| @weaveintel/tools-enterprise | Enterprise connectors - Jira, Slack, GitHub, database query tools |
| @weaveintel/tools-social | Social media tools - Twitter/X, LinkedIn, with content formatting |
| @weaveintel/mcp-client | MCP protocol client - discover and invoke remote tools, resources, prompts |
| @weaveintel/mcp-server | MCP protocol server - expose tools, resources, and prompts |
| @weaveintel/a2a | Agent-to-agent protocol - remote HTTP + in-process bus for multi-agent systems |
| @weaveintel/plugins | Plugin lifecycle - register, enable/disable, validate, dependency resolution |
Safety & Governance
| Package | Description |
|---|---|
| @weaveintel/guardrails | Guardrail pipeline - risk classification, cost guards, governance context, runtime policies, cognitive evaluation, sycophancy detection, confidence-rated decision making |
| @weaveintel/redaction | PII detection (email, phone, SSN, CC, etc.), policy engine, reversible tokenization |
| @weaveintel/compliance | Data retention engine, GDPR/CCPA deletion, legal holds, consent management, audit export |
| @weaveintel/sandbox | Sandboxed execution - policy enforcement, resource limits, allowed/blocked module lists |
| @weaveintel/identity | Identity management - delegation chains, ACL enforcement, scoped access |
| @weaveintel/tenancy | Multi-tenancy - tenant isolation, budget management, scoped configuration |
| @weaveintel/reliability | Reliability patterns - idempotency, retry budgets, dead-letter queues, health checking, backpressure |
Observability & Evaluation
| Package | Description |
|---|---|
| @weaveintel/observability | Tracing, spans, event bus, cost/token usage tracking |
| @weaveintel/evals | Evaluation runner with 6 assertion types (exact, contains, regex, schema, latency, cost) |
| @weaveintel/replay | Trace replay - record and replay agent interactions for debugging and regression testing |
Application Layer
| Package | Description |
|---|---|
| @weaveintel/recipes | Pre-built agent factories - governed assistant, approval-driven, workflow, eval-routed, safe execution |
| @weaveintel/devtools | Developer tools - scaffolding, inspection, validation, mock runtimes, migration planning |
| @weaveintel/ui-primitives | UI streaming events, widgets (table, chart, form, code, timeline), artifacts, citations, progress |
| @weaveintel/triggers | Trigger system - cron schedules, webhooks, queue-based triggers with filtering |
| @weaveintel/collaboration | Session management - multi-user handoff, shared context, agent collaboration |
| @weaveintel/geneweave | Full-stack demo app - chat UI, admin dashboard, tools, auth, SQLite backend |
Examples (20)
All examples live in the examples/ directory and can be run directly with npx tsx. Most require no API key (they use fake models and in-memory stores).
01 - Simple Chat
Basic completion, streaming, structured output
OpenAI key required02 - Tool-Calling Agent
ReAct loop, tool registry, fake model
No key needed03 - RAG Pipeline
Chunking, embedding, vector search
No key needed04 - Hierarchical Agents
Supervisor-worker delegation
No key needed05 - MCP Integration
MCP server + client, tool bridge
No key needed06 - A2A Communication
Agent-to-agent bus, discovery, task delegation
No key needed07 - Memory-Augmented Agent
Conversation, semantic, entity memory
No key needed08 - PII Redaction
Detection, replacement, restoration, policy engine
No key needed09 - Eval Suite
Assertions, scoring, aggregate results
No key needed10 - Observability
Tracing, spans, event bus, usage tracking
No key needed11 - Anthropic Provider
Chat, streaming, tools, thinking, vision, caching, batches, computer use (77 tests)
Anthropic key required12 - geneWeave App
Full-stack chat app with admin, recipes, devtools
OpenAI key required13 - Workflow Engine
Multi-step workflows, conditional branching, checkpoints, compensation, guardrails
No key needed14 - Smart Routing
Model routing, health tracking, weighted scoring, explainable decisions
No key needed15 - Tool Ecosystem
Extended tool registry, web search, browser, HTTP tools, multi-tool research
No key needed16 - Human-in-the-Loop
Approval tasks, review queues, escalation, decision logging, contracts, evidence bundles
No key needed17 - Prompt Management
Versioned templates, A/B experiments, instruction bundles, scoped resolution
No key needed18 - Knowledge Graph
Entity nodes, relationships, entity linking, timeline, graph retrieval
No key needed19 - Compliance & Sandbox
Data retention, legal holds, consent, audit export, sandboxed execution, reliability patterns
No key needed20 - Recipes & DevTools
Pre-built agents, scaffolding, inspection, validation, streaming events, widgets, artifacts
No key neededgeneWeave - Example Chatbot App
geneWeave is a full-stack chatbot application included in the weaveIntel repository at apps/geneweave. It demonstrates how to use weaveIntel's packages together in a production-style application with a chat UI, admin dashboard, tool integration, authentication, and SQLite backend.
geneWeave visually displays guardrail results, cognitive evaluation outputs, confidence ratings, and decision-making transparency directly in the chat interface - so users can see not just what the AI decided, but how it reasoned, what guardrails were applied, and how confident it is in the response.
# Run the geneWeave demo
npx tsx examples/12-geneweave.ts
# Or with full environment
cp .env.example .env # Add your API keys
npm run dev # Starts at http://localhost:3500
Deployment (13 Platforms)
geneWeave can be deployed to any platform that runs Node.js 20+ or Docker containers. All deployment configs live in the repo.
CI/CD workflows are included for Docker image builds (GHCR), plus manual/automatic deploy workflows for Azure, Fly.io, Google Cloud Run, and AWS.
Environment Variables
| Variable | Required | Description |
|---|---|---|
| JWT_SECRET | Yes | Secret for signing auth tokens |
| ANTHROPIC_API_KEY | One of these | Anthropic API key |
| OPENAI_API_KEY | One of these | OpenAI API key |
| PORT | No | HTTP port (default: 3500) |
| DATABASE_PATH | No | SQLite path (default: ./data/geneweave.db) |
| DEFAULT_PROVIDER | No | anthropic or openai (auto-detected) |
| DEFAULT_MODEL | No | Model ID (auto-detected) |
| CORS_ORIGIN | No | Allowed CORS origin |
Versioning - Fabric Releases
weaveIntel uses Fabric Versioning: each major release is named after a fabric, assigned alphabetically A to Z. Current release: v1.0.0 - Aertex.
Minor releases (e.g., 1.1.0) add features under the same fabric. Patch releases (e.g., 1.1.1) fix bugs. See VERSIONING.md for details.
Tech Stack
TypeScript 5.7+ - strict mode, ESM-first. npm workspaces - monorepo dependency management. Turborepo - parallel builds with dependency-aware caching. Vitest - test runner. Prettier - code formatting.
Contact
For questions, support, or partnership enquiries: hello@servonomics.co.nz
Found a bug? Open an issue on GitHub. Security concerns? Email hello@servonomics.co.nz.