Documentation
¶
Overview ¶
Package jess is an easy agent harness over github.com/voocel/agentcore. It adds durable memory, registerable skills, subagents, and two baked-in safety controls: an append-only audit log and a fail-closed tool gate.
jess.New is an option-assembler: pass functional options (WithModel, WithMemory, WithSkills, WithTools, WithApprover, ...) and it returns a real *agentcore.Agent. Drive it with agentcore's own API, or with jess.Stream, which exposes the event channel and a Wait for the run summary and aborts the run when its context is cancelled (the kill switch):
agent := jess.New(
jess.WithModel(m), // any agentcore.ChatModel, or jess.Once for a local one
jess.WithMemory(store, recaller), // durable recall, injected each turn
jess.WithSkills(set), // capability bundles
)
ch, wait := jess.Stream(ctx, agent, "hello")
for ev := range ch { /* observe */ }
summary := wait()
agentcore types are exposed directly (ADR 0002); jess does not wrap the harness. Portability insurance is keeping jess/memory and jess/skill agentcore-free, so those stores and skills travel to any harness.
Pre-1.0 — API may change before v1. See CHANGELOG.md and the examples/ directory for runnable wiring.
Index ¶
- func New(opts ...Option) *ac.Agent
- func NewMemoryManager(store memory.Store, recaller memory.Recaller) ac.ContextManager
- func Once(supportsTools bool, fn GenerateFunc) ac.ChatModel
- func Stream(ctx context.Context, agent *ac.Agent, input string) (<-chan ac.Event, func() *ac.RunSummary)
- type Approver
- type GenerateFunc
- type Option
- func AllowAll() Option
- func WithAgentID(id string) Option
- func WithAgentcoreOptions(o ...ac.AgentOption) Option
- func WithApprover(a gate.Approver) Option
- func WithLedger(sink ledger.Sink) Option
- func WithMaxTurns(n int) Option
- func WithMemory(store memory.Store, recaller memory.Recaller) Option
- func WithModel(m ac.ChatModel) Option
- func WithSkills(set *skill.Set) Option
- func WithSubagents(specs ...subagent.Spec) Option
- func WithSystemPrompt(s string) Option
- func WithToolGate(g ac.ToolGate) Option
- func WithTools(t ...ac.Tool) Option
- type Request
- type SafeTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New assembles a ready *agentcore.Agent: model, memory, skills, tools, gate, audit, subagents. It returns the real agentcore type; drive it with agentcore's API or jess.Stream.
The gate is fail-closed by default: without an approver (or AllowAll), any tool not marked Safe is denied. Audit is on by default (a durable SQLite sink under the user cache dir); pass WithLedger(ledger.DiscardSink{}) to turn it off explicitly. With audit off, non-safe actions cannot run: "no durable record, no action".
func NewMemoryManager ¶
NewMemoryManager builds the agentcore.ContextManager that injects recalled memory each turn. Use it when driving a raw agentcore.NewAgent directly.
Types ¶
type Approver ¶
Approver is the human decision for a non-safe call (the daemon's confirm plugs in here).
type GenerateFunc ¶
type GenerateFunc = core.GenerateFunc
GenerateFunc is a one-shot generation function (see Once).
type Option ¶
Option configures the agent jess.New builds.
func AllowAll ¶
func AllowAll() Option
AllowAll is the explicit, greppable opt-out from the fail-closed default.
func WithAgentID ¶
WithAgentID scopes memory and tags audit. Empty is the global scope.
func WithAgentcoreOptions ¶
func WithAgentcoreOptions(o ...ac.AgentOption) Option
WithAgentcoreOptions passes raw agentcore options through (the long tail: stop guard, extra middlewares, concurrency).
WARNING: passing ac.WithMiddlewares here does NOT install custom tool middleware alongside jess's audit enforcement — it will be overridden. jess appends the audit-enforcement middleware last (after all Extra options) so that "no durable record, no action" cannot be bypassed. Custom tool middleware is not supported through this escape hatch.
func WithApprover ¶
WithApprover installs the human approver for dangerous calls. Without it the gate is fail-closed (non-safe tools are denied).
func WithLedger ¶
WithLedger redirects the audit sink. Pass ledger.DiscardSink{} to turn audit off explicitly; it is never off silently.
func WithMaxTurns ¶
WithMaxTurns caps the agent loop turns. 0 leaves the agentcore default.
func WithMemory ¶
WithMemory wires durable memory (recall injected each turn). Both required.
func WithSkills ¶
WithSkills attaches a skill set (system blocks + tools).
func WithSubagents ¶
WithSubagents registers subagents. Empty Spec fields inherit from the parent (model, gate, audit, agentID). jess.New builds and owns the pool and wires the delegating "subagent" tool into the agent's tool set.
func WithSystemPrompt ¶
WithSystemPrompt sets the base system prompt.
func WithToolGate ¶
WithToolGate installs a fully custom gate, bypassing the default policy.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
gated
command
Command gated shows jess's fail-closed tool gate plus the provenance ledger.
|
Command gated shows jess's fail-closed tool gate plus the provenance ledger. |
|
quickstart
command
Command quickstart shows jess end to end with no network access: an in-memory store seeds a core memory, a local echo model reveals what the agent received (including the injected memory), and the run is driven through jess.New -> jess.Stream with its live event channel.
|
Command quickstart shows jess end to end with no network access: an in-memory store seeds a core memory, a local echo model reveals what the agent received (including the injected memory), and the run is driven through jess.New -> jess.Stream with its live event channel. |
|
Package gate is jess's preventive control: a fail-closed tool gate.
|
Package gate is jess's preventive control: a fail-closed tool gate. |
|
internal
|
|
|
core
Package core is jess's agentcore-touching implementation: the option-assembler (Config + Agent) that wires a model, system blocks, tools, the memory ContextManager, the tool gate, and the audit middleware into a ready *agentcore.Agent.
|
Package core is jess's agentcore-touching implementation: the option-assembler (Config + Agent) that wires a model, system blocks, tools, the memory ContextManager, the tool gate, and the audit middleware into a ready *agentcore.Agent. |
|
Package ledger is the durable, agentcore-free record of everything an agent does.
|
Package ledger is the durable, agentcore-free record of everything an agent does. |
|
Package memory is jess's durable agent memory: the facts an agent keeps across turns and sessions, and the machinery to recall the right ones for the current prompt.
|
Package memory is jess's durable agent memory: the facts an agent keeps across turns and sessions, and the machinery to recall the right ones for the current prompt. |
|
embed/gomlx
Package gomlx provides an in-process sentence embedder for jess memory, backed by the pure-Go gomlx/compute/gobackend ML runtime.
|
Package gomlx provides an in-process sentence embedder for jess memory, backed by the pure-Go gomlx/compute/gobackend ML runtime. |
|
Package skill provides registerable capability bundles for jess agents, wired via jess.WithSkills and vendor-free (no agentcore types in its API).
|
Package skill provides registerable capability bundles for jess agents, wired via jess.WithSkills and vendor-free (no agentcore types in its API). |
|
Package subagent runs jess subagents with bounded concurrency.
|
Package subagent runs jess subagents with bounded concurrency. |