MIT Licensed - v1.0.0 Aertex

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.

Application Layer recipes - devtools - geneweave - ui-primitives - triggers - collaboration Agent Layer agents - workflows - human-tasks - contracts - prompts - routing Capability Layer retrieval - memory - graph - extraction - cache - artifacts - evals Tool Layer tools - tools-search - tools-browser - tools-http - tools-enterprise tools-social - mcp-client - mcp-server - a2a - plugins Safety & Governance guardrails - redaction - compliance - sandbox - identity - tenancy reliability - replay - observability Model Layer models (router) - provider-openai - provider-anthropic Foundation core (contracts & types) - testing

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

PackageDescription
@weaveintel/coreContracts, types, context, events, middleware, plugin registry - zero vendor deps
@weaveintel/modelsUnified model router with fallback chains, streaming, middleware, capability selection
@weaveintel/provider-openaiOpenAI adapter - chat, streaming, embeddings, image, audio, structured output, vision
@weaveintel/provider-anthropicAnthropic adapter - chat, streaming, tool use, extended thinking, vision, token counting, batches, computer use, prompt caching
@weaveintel/testingFake models, embeddings, vector stores, and MCP transports for deterministic tests

Agent Orchestration

PackageDescription
@weaveintel/agentsAgent runtime - ReAct tool-calling loop, supervisor-worker hierarchies
@weaveintel/workflowsMulti-step workflow engine with conditional branching, checkpointing, and compensation
@weaveintel/human-tasksHuman-in-the-loop - approval tasks, review queues, escalation, decision logging, policy evaluation
@weaveintel/contractsCompletion contracts with evidence bundles and completion reports
@weaveintel/promptsVersioned prompt templates, A/B experiments, instruction bundles, scoped resolution
@weaveintel/routingSmart model routing - health tracking, capability matching, weighted scoring, explainable decisions

Knowledge & Retrieval

PackageDescription
@weaveintel/retrievalDocument chunking (6 strategies), embedding pipeline, vector retrieval with reranking
@weaveintel/memoryConversation, semantic, and entity memory implementations
@weaveintel/graphKnowledge graph - entity nodes, relationship edges, entity linking, timeline, graph retrieval
@weaveintel/extractionDocument extraction pipeline - entity, metadata, timeline, table, code, and task stages
@weaveintel/cacheSemantic caching with TTL, LRU eviction, and embedding-based lookup
@weaveintel/artifactsArtifact storage - versioned blobs with metadata, tagging, and lifecycle management

Tools & Connectivity

PackageDescription
@weaveintel/toolsExtended tool registry - versioning, risk tagging, health tracking, test harness
@weaveintel/tools-searchWeb search tools - DuckDuckGo, Brave, with structured result parsing
@weaveintel/tools-browserBrowser tools - URL fetching, content extraction, page rendering
@weaveintel/tools-httpHTTP endpoint tools - REST client with auth, rate limiting, schema validation
@weaveintel/tools-enterpriseEnterprise connectors - Jira, Slack, GitHub, database query tools
@weaveintel/tools-socialSocial media tools - Twitter/X, LinkedIn, with content formatting
@weaveintel/mcp-clientMCP protocol client - discover and invoke remote tools, resources, prompts
@weaveintel/mcp-serverMCP protocol server - expose tools, resources, and prompts
@weaveintel/a2aAgent-to-agent protocol - remote HTTP + in-process bus for multi-agent systems
@weaveintel/pluginsPlugin lifecycle - register, enable/disable, validate, dependency resolution

Safety & Governance

PackageDescription
@weaveintel/guardrailsGuardrail pipeline - risk classification, cost guards, governance context, runtime policies, cognitive evaluation, sycophancy detection, confidence-rated decision making
@weaveintel/redactionPII detection (email, phone, SSN, CC, etc.), policy engine, reversible tokenization
@weaveintel/complianceData retention engine, GDPR/CCPA deletion, legal holds, consent management, audit export
@weaveintel/sandboxSandboxed execution - policy enforcement, resource limits, allowed/blocked module lists
@weaveintel/identityIdentity management - delegation chains, ACL enforcement, scoped access
@weaveintel/tenancyMulti-tenancy - tenant isolation, budget management, scoped configuration
@weaveintel/reliabilityReliability patterns - idempotency, retry budgets, dead-letter queues, health checking, backpressure

Observability & Evaluation

PackageDescription
@weaveintel/observabilityTracing, spans, event bus, cost/token usage tracking
@weaveintel/evalsEvaluation runner with 6 assertion types (exact, contains, regex, schema, latency, cost)
@weaveintel/replayTrace replay - record and replay agent interactions for debugging and regression testing

Application Layer

PackageDescription
@weaveintel/recipesPre-built agent factories - governed assistant, approval-driven, workflow, eval-routed, safe execution
@weaveintel/devtoolsDeveloper tools - scaffolding, inspection, validation, mock runtimes, migration planning
@weaveintel/ui-primitivesUI streaming events, widgets (table, chart, form, code, timeline), artifacts, citations, progress
@weaveintel/triggersTrigger system - cron schedules, webhooks, queue-based triggers with filtering
@weaveintel/collaborationSession management - multi-user handoff, shared context, agent collaboration
@weaveintel/geneweaveFull-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 required

02 - Tool-Calling Agent

ReAct loop, tool registry, fake model

No key needed

03 - RAG Pipeline

Chunking, embedding, vector search

No key needed

04 - Hierarchical Agents

Supervisor-worker delegation

No key needed

05 - MCP Integration

MCP server + client, tool bridge

No key needed

06 - A2A Communication

Agent-to-agent bus, discovery, task delegation

No key needed

07 - Memory-Augmented Agent

Conversation, semantic, entity memory

No key needed

08 - PII Redaction

Detection, replacement, restoration, policy engine

No key needed

09 - Eval Suite

Assertions, scoring, aggregate results

No key needed

10 - Observability

Tracing, spans, event bus, usage tracking

No key needed

11 - Anthropic Provider

Chat, streaming, tools, thinking, vision, caching, batches, computer use (77 tests)

Anthropic key required

12 - geneWeave App

Full-stack chat app with admin, recipes, devtools

OpenAI key required

13 - Workflow Engine

Multi-step workflows, conditional branching, checkpoints, compensation, guardrails

No key needed

14 - Smart Routing

Model routing, health tracking, weighted scoring, explainable decisions

No key needed

15 - Tool Ecosystem

Extended tool registry, web search, browser, HTTP tools, multi-tool research

No key needed

16 - Human-in-the-Loop

Approval tasks, review queues, escalation, decision logging, contracts, evidence bundles

No key needed

17 - Prompt Management

Versioned templates, A/B experiments, instruction bundles, scoped resolution

No key needed

18 - Knowledge Graph

Entity nodes, relationships, entity linking, timeline, graph retrieval

No key needed

19 - Compliance & Sandbox

Data retention, legal holds, consent, audit export, sandboxed execution, reliability patterns

No key needed

20 - Recipes & DevTools

Pre-built agents, scaffolding, inspection, validation, streaming events, widgets, artifacts

No key needed

geneWeave - 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.

Docker
Docker Compose
Fly.io
Railway
Render
Heroku
Vercel
Azure Container Apps
Google Cloud Run
AWS ECS Fargate
AWS App Runner
DigitalOcean
Kubernetes

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

VariableRequiredDescription
JWT_SECRETYesSecret for signing auth tokens
ANTHROPIC_API_KEYOne of theseAnthropic API key
OPENAI_API_KEYOne of theseOpenAI API key
PORTNoHTTP port (default: 3500)
DATABASE_PATHNoSQLite path (default: ./data/geneweave.db)
DEFAULT_PROVIDERNoanthropic or openai (auto-detected)
DEFAULT_MODELNoModel ID (auto-detected)
CORS_ORIGINNoAllowed 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.