PublishedDocs / Reference
defineAugment
Define a runtime capability that contributes tools, context, memory, transports, lifecycle, or policy to an agent.
Shape
import { defineAugment } from "auggy";
export default function customAugment() {
return defineAugment({
name: "custom",
type: "custom",
tools: [],
});
}Auggy infers the augment's runtime surfaces from concrete fields such as tools, httpRoutes, context, transport, memory, and lifecycle hooks. There is no separate capabilities declaration.
Options
| Option | Use |
|---|---|
| name | Unique augment identifier within the agent. |
| type | custom for project-specific augments; built-ins use their catalog type. |
| tools | defineTool entries this augment exposes to the model. |
| httpRoutes | Optional advanced preview defineRoute entries served beside /agent/run. |
| context | Async function returning ContextBlock entries for the turn. |
Ownership
- Use one augment per domain capability, not one augment per function.
- Keep related tools, schemas, skills, integration code, and policy close together.
- Add optional routes only when software needs a deterministic entry point into this capability.
- Use lifecycle hooks for boot validation and cleanup.
- Use config files for operator-owned settings and env references.
Related
Build an augmentBuild one project-specific typed tool inside a custom augment.defineRouteAdvanced preview: define focused HTTP routes with typed schemas, auth modes, and generated-client support.defineToolDefine a typed model-callable function with validation and optional authorization requirements.
