Apogee

AI application infrastructure framework

An open-source TypeScript framework for building production AI applications. Modular, extensible, and ready for the real world.

Modular by design

Abstract at the core, concrete at the edges. Each package has one job, ships with its tests, and works alone or together.

๐Ÿงฑ

@de_canter/apogee-kernel

v0.2.0

The domain vocabulary every product composes: Money, Identifier, Interval, Bitemporal, Provenance, Assertion, Lifecycle, Role.

Read the docs โ†’

๐Ÿค–

@de_canter/apogee-ai

v0.3.0

One model client: vision and PDF input, structured output validated by Zod, prompt caching, models by role, priced usage.

Read the docs โ†’

๐Ÿ“

@de_canter/apogee-prompts

v0.2.0

Named, versioned prompts composed from sections with a cache-aware boundary and contributor slots.

Read the docs โ†’

โšก

@de_canter/apogee-agent

v0.2.1

The agentic session: bounded tool loop, one event stream that is also the SSE protocol, compaction, memory, persistence ports.

Read the docs โ†’ ยท live demo

โš›๏ธ

@de_canter/apogee-agent-react

v0.2.0

React client: SSE decoder, pure reducer, useAgentSession, unstyled chat shells.

Read the docs โ†’ ยท live demo

๐Ÿƒ

@de_canter/apogee-artifacts

v0.2.0

Tool results as UI: a registry the host fills with components, a renderer, action dispatch, interaction telemetry.

Read the docs โ†’ ยท live demo

๐Ÿ“

@de_canter/apogee-rules

v0.2.0

Natural-language business rules: host-declared dimensions, parse into assertions, validate, detect conflicts, evaluate in two layers, audit.

Read the docs โ†’ ยท live demo

๐Ÿ“„

@de_canter/apogee-documents-ai

v0.2.0

Classify, extract by host schema, every field an assertion with confidence, corrections as ground truth, a resumable pipeline.

Read the docs โ†’ ยท live demo

๐Ÿ“š

@de_canter/apogee-knowledge

v0.2.0

Markdown chunking with stable ids, lexical and vector stores with scopes, retrieval with citations as a prompt contributor.

Read the docs โ†’ ยท live demo

๐Ÿ”Œ

@de_canter/apogee-integrations

v0.2.0

No-code REST patterns: templates with vault secrets, five auth methods, rate limit, circuit breaker, retry, dead letters with replay, drift, inbound webhooks with classification.

Read the docs โ†’ ยท live demo

๐Ÿงฐ

@de_canter/apogee-chat-kit

v0.2.0

One resource declaration becomes MCP tools, agent tools, and an HTTP handler, all returning one envelope: state, allowed next actions, UI. Out-of-order calls fail before execute.

Read the docs โ†’ ยท live demo

๐ŸชŸ

@de_canter/apogee-chat-kit-app

v0.1.0

The client half of the chat kit: one React card renders an envelope and acts through tools, in an MCP Apps host or in the product's own app.

Read the docs โ†’ ยท live demo

๐ŸŽ›๏ธ

@de_canter/apogee-grid-commander

v0.1.0

A cockpit-grade data grid for dense, keyboard-first worklists: renderers, editors, presets, context menu, detail panel, status bar, export, over TanStack Table and Virtual.

Read the docs โ†’ ยท live demo

An agent in one route handler

This is the shape of the live demo's server. Tools are Zod-typed, memory is a tool plus a prompt slot, and the event stream is the SSE body.

app/api/agent/route.ts
import { createAnthropicModelClient } from '@de_canter/apogee-ai';
import { definePrompt, slot, text } from '@de_canter/apogee-prompts';
import { createAgentSession, defineTool, memoryTool, agentEventsToReadableStream, SSE_HEADERS } from '@de_canter/apogee-agent';
import { z } from 'zod';

const client = createAnthropicModelClient();            // the only place the SDK is constructed

const prompt = definePrompt<Ctx>({
  name: 'rental-desk', version: '1.0.0',
  sections: [text('identity', 'You run the rental desk.'), slot('memory', 'memory')],
});

const checkAvailability = defineTool<Ctx, { typeCode: string; start: string; end: string }>({
  name: 'check_availability',
  description: 'Count available units and quote a date range.',
  input: z.object({ typeCode: z.string(), start: z.string(), end: z.string() }),
  execute: async (input, { ctx }) => ({ success: true, data: quote(ctx.world, input) }),
});

export async function POST(req: Request) {
  const { message, annotations } = await req.json();
  const session = createAgentSession<Ctx>({
    sessionId, client, prompt, ctx,
    tools: [checkAvailability, memoryTool({ port, keyFromCtx: (c) => c.customer, byFromCtx: () => 'agent' })],
    contributors: { memory: memoryContributor({ port, keyFromCtx: (c) => c.customer }) },
  });
  return new Response(agentEventsToReadableStream(session.run(message, { annotations })), { headers: SSE_HEADERS });
}

Get started

Every package is on npm under the @de_canter scope. Add the ones you import; the framework's internal dependencies resolve on their own.

Prerequisites

  • Node.js 20+ and pnpm 9
  • TypeScript 5, strict mode
  • React 18 or 19 for the client packages

Install

pnpm add @de_canter/apogee-kernel \
  @de_canter/apogee-ai \
  @de_canter/apogee-prompts \
  @de_canter/apogee-agent \
  @de_canter/apogee-agent-react \
  @de_canter/apogee-artifacts \
  @de_canter/apogee-rules \
  @de_canter/apogee-documents-ai \
  @de_canter/apogee-knowledge \
  @de_canter/apogee-integrations \
  @de_canter/apogee-chat-kit \
  @de_canter/apogee-chat-kit-app \
  @de_canter/apogee-grid-commander

Then

Each package page shows its surface table and rules. The live demo is built exactly this way, and the source is on GitHub.