Back to landing

Documentation

@intelliforge/harness SDK

Eight TypeScript packages implementing the Code as Agent Harness taxonomy. MIT licensed. Install individually or compose a full harness stack.

Quick Start

TypeScript
npm install @intelliforge/harness-core @intelliforge/harness-memory @intelliforge/harness-tools

import { createHarness } from '@intelliforge/harness-core'

const harness = createHarness({
  model: 'gpt-4o',
  memory: { tiers: ['working', 'semantic'] },
})

await harness.run({ task: 'Summarize quarterly revenue from CSV' })

Install All Packages

npm install @intelliforge/harness-core @intelliforge/harness-memory @intelliforge/harness-tools @intelliforge/harness-planner @intelliforge/harness-control @intelliforge/harness-multi @intelliforge/harness-india @intelliforge/harness-eval

Package Reference

@intelliforge/harness-core

Harness interface layer — createHarness(), PlanExecuteVerify loop

npm install @intelliforge/harness-core
@intelliforge/harness-memory

5-tier memory system — working, semantic, experiential, long-term, multi-agent

npm install @intelliforge/harness-memory
@intelliforge/harness-tools

Tool use + registry — ToolRegistry, createTool(), VerificationTool

npm install @intelliforge/harness-tools
@intelliforge/harness-planner

Planning mechanisms — LinearPlanner, StructuredPlanner, SearchPlanner

npm install @intelliforge/harness-planner
@intelliforge/harness-control

PEV loop + sandbox — SandboxedExecutor, PermissionTier, FeedbackRouter

npm install @intelliforge/harness-control
@intelliforge/harness-multi

Multi-agent orchestration — AgentRoles, SharedHarnessState, CollaborationMode

npm install @intelliforge/harness-multi
@intelliforge/harness-india

India-first connectors — SarvamSTT, RazorpayTool, WhatsAppTool, ISTScheduler

npm install @intelliforge/harness-india
@intelliforge/harness-eval

Evaluation harness — HarnessEval, FinAgentEval, HarnessMetrics

npm install @intelliforge/harness-eval

Core Concepts

Plan → Execute → Verify

The PEV loop is the harness heartbeat. The planner decomposes a task into steps, the executor runs each step in a sandbox, and the verifier checks correctness against an oracle (tests, assertions, or a judge model). The loop repeats until the oracle passes or a budget is exhausted.

5-Tier Memory

Working (in-context scratchpad), semantic (vector retrieval), experiential (skill distillation), long-term (persistent facts), multi-agent (shared state across roles). Each tier has a distinct write pattern and eviction policy.

Permission Tiers

Tier 0 read-only → Tier 1 local writes → Tier 2 tool calls → Tier 3 production deploy. The harness enforces tier escalation before dangerous actions, logged for audit.

Usage Examples

PEV Loop
import { createHarness } from '@intelliforge/harness-core'
import { ToolRegistry, createTool } from '@intelliforge/harness-tools'

const registry = new ToolRegistry()
registry.register(createTool({
  name: 'read_file',
  fn: async ({ path }) => fs.readFileSync(path, 'utf8'),
}))

const harness = createHarness({ model: 'claude-sonnet-4-6', tools: registry })
const result = await harness.run({
  task: 'Fix the failing unit test in src/billing.ts',
  verifier: 'npm test -- --testPathPattern=billing',
})
Semantic Memory
import { SemanticMemory } from '@intelliforge/harness-memory'

const memory = new SemanticMemory({ provider: 'neon-pgvector' })
await memory.store({ key: 'razorpay-webhook', content: handlerCode, tags: ['payments'] })

const hits = await memory.retrieve({ query: 'payment webhook handler', k: 3 })
India Connectors
import { SarvamSTT, RazorpayTool, WhatsAppTool } from '@intelliforge/harness-india'

const stt = new SarvamSTT({ lang: 'hi-IN' })
const transcript = await stt.transcribe(audioStream)

const razorpay = new RazorpayTool({ keyId: process.env.RAZORPAY_KEY_ID })
const order = await razorpay.createOrder({ amount: 299900, currency: 'INR' })

const wa = new WhatsAppTool({ token: process.env.WA_TOKEN })
await wa.send({ to: '+919876543210', text: `Order ${order.id} created` })

Evaluation

HarnessEval

Measures oracle adequacy (does your test suite actually catch regressions?), plan efficiency (steps to completion), and memory hit rate. Run via npx @intelliforge/harness-eval.

FinAgentEval

Private benchmark for financial AI agents covering GST, TDS, Razorpay flows, and NDHM. Available on Pro and Enterprise plans.

TypeScript
import { HarnessEval } from '@intelliforge/harness-eval'

const report = await HarnessEval.run({
  harness,
  suite: './evals/billing.yaml',
  metrics: ['oracle_adequacy', 'plan_efficiency'],
})
console.log(report.summary)

Multi-Agent Roles

@intelliforge/harness-multi
Manager

Owns the top-level goal, allocates subtasks to roles, and resolves conflicts in shared harness state.

Planner

Decomposes tasks into steps using LinearPlanner, StructuredPlanner, or SearchPlanner strategies.

Coder

Executes code generation and patching steps inside a SandboxedExecutor at the assigned permission tier.

Reviewer

Runs static analysis, diff review, and oracle adequacy checks before signalling verify-pass to the manager.

Tester

Executes the verifier suite, collects HarnessMetrics, and feeds failure traces back to the Planner.

Source & Examples

SDK packages ship from the IntelliForge Turborepo. GitHub repo goes live with ForgeOS Cloud Alpha.

View on GitHub