Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
8e65efd
fix(observability): RedactingSink fails closed on redaction failure
senamakel Jul 3, 2026
9b1d885
fix(tool): enforce schema required fields without properties
senamakel Jul 3, 2026
2112eb3
fix(workspace): anchor path gate to defeat leading `..` sibling escape
senamakel Jul 3, 2026
2ceefe6
fix(language): fail closed on subagent/repl_agent references via one …
senamakel Jul 3, 2026
13d8a5b
fix(language): return parse error for empty token slice
senamakel Jul 3, 2026
f0e4266
fix(language): clamp diagnostic caret range for out-of-bounds spans
senamakel Jul 3, 2026
26e7153
fix(openai): decode SSE across UTF-8 and EOF boundaries
senamakel Jul 3, 2026
94eac5e
fix(openai): surface mid-stream error payloads instead of swallowing …
senamakel Jul 3, 2026
47502bb
fix(stream): adjacently tag ModelStreamItem and StreamChunk so every …
senamakel Jul 3, 2026
3e325e6
fix(openai): correlate index-less streamed tool-call fragments by id
senamakel Jul 3, 2026
50312b1
fix(openai): map empty tool arguments to an empty object
senamakel Jul 3, 2026
c1918b2
fix(openai): wire request and client timeouts
senamakel Jul 3, 2026
23d2fe9
fix(openai): send max_completion_tokens to o-series models
senamakel Jul 3, 2026
f8605f8
fix(openai): send image content parts instead of dropping them
senamakel Jul 3, 2026
eb3c032
fix(model): stop StreamAccumulator::finish clobbering message usage
senamakel Jul 3, 2026
22addf2
fix(graph): collision-free checkpoint/run ids across restarts
senamakel Jul 3, 2026
9628bef
fix(graph): pin duplicate checkpoint-id lookup to last-write-wins
senamakel Jul 3, 2026
ec89ced
fix(graph): key command routing per activation, not per node
senamakel Jul 3, 2026
bd6238c
fix(graph): persist pending activations, completed successors, and ba…
senamakel Jul 3, 2026
b0996ec
fix(graph): keep parent-checkpoint lineage connected across resume
senamakel Jul 3, 2026
dccf8a2
fix(graph): propagate subgraph interrupts to the parent run
senamakel Jul 3, 2026
3d52505
fix(graph): make checkpoint lookups namespace-aware
senamakel Jul 3, 2026
ff659dc
fix(graph): fail the run on reducer/route/persist errors at the boundary
senamakel Jul 3, 2026
fe020f9
fix(graph): emit CheckpointRestored (not CheckpointSaved) on resume load
senamakel Jul 3, 2026
584e2df
fix(graph): reject update_state as a command node
senamakel Jul 4, 2026
110c8e8
fix(graph): map_reduce FailFast returns first error in input order
senamakel Jul 4, 2026
3b76789
docs(harness): add module READMEs for middleware, openai provider, ag…
senamakel Jul 4, 2026
a7d42bb
docs(graph): add module READMEs for compiled, checkpoint, channel
senamakel Jul 4, 2026
3d30ac0
docs(graph): add module READMEs for observability, orchestration, sub…
senamakel Jul 4, 2026
38e66d6
docs(graph): add module README for src/graph root
senamakel Jul 4, 2026
1b06c8f
docs(repl): cross-reference the two ReplSession types
senamakel Jul 4, 2026
35af493
fix(harness): unify model/tool call limits and cap fallback loops
senamakel Jul 4, 2026
61feba4
fix(repl): enforce ReplPolicy::timeout and max_iterations fail-closed
senamakel Jul 4, 2026
47295a7
fix(harness): wire RunLimits::max_retries_per_call and bound tool cal…
senamakel Jul 4, 2026
b90cf9b
fix(harness): route SubAgentTool::call_with_context depth limit to a …
senamakel Jul 4, 2026
0e5dd1c
Support reasoning stream deltas
senamakel Jul 4, 2026
b1cbc22
fix(harness): correct retry backoff schedule and classify provider re…
senamakel Jul 4, 2026
7131906
fix(harness): correct usage/cost accounting for omitted and cached to…
senamakel Jul 4, 2026
0a2e20c
fix(harness): make BudgetTracker reservations atomic, per-run, and fa…
senamakel Jul 4, 2026
8042028
fix(repl): enforce agent-call limit independently of the model-call l…
senamakel Jul 4, 2026
5daf35b
fix(harness): release budget reservation on model-call error
senamakel Jul 4, 2026
d954ae1
fix(language): stop Literal::as_display saturating huge floats to i64…
senamakel Jul 4, 2026
3116b4a
fix(language): diagnose conflicting routing sources and duplicate cha…
senamakel Jul 4, 2026
3a1e355
fix(language): make blueprint_diff cover command/sends/retry/metadata…
senamakel Jul 4, 2026
7895875
fix(repl): report real 1-based line/column in .ragsh parse errors
senamakel Jul 4, 2026
dd11e3e
fix(repl): enforce max_output_bytes inside push_stdout_line, not only…
senamakel Jul 4, 2026
9a1b336
fix(repl): don't consume a graph_define slot on a failed draft
senamakel Jul 4, 2026
caee6c3
fix(repl): stop double-seeding the `answer` reserved name into scope
senamakel Jul 4, 2026
27fd45b
docs(repl): fix broken intra-doc link to nonexistent crate::repl::cod…
senamakel Jul 4, 2026
cd98867
fix(repl): stop tool_call_batched from discarding successes on one it…
senamakel Jul 4, 2026
f37d43b
fix(language): honor a diagnostic's stored line/col when byte offsets…
senamakel Jul 4, 2026
9cb8fd7
perf(harness): drop per-delta middleware event bracketing
senamakel Jul 4, 2026
bc43a9b
perf(store): cache JSONL append offsets and make FileStore writes atomic
senamakel Jul 4, 2026
31ece7f
perf(observability): drain durable harness sinks off the run thread
senamakel Jul 4, 2026
12fed70
perf(graph): drain JournalGraphSink off the executor thread
senamakel Jul 4, 2026
4914afe
fix(middleware): insert compression summary after the system prompt
senamakel Jul 4, 2026
a4fbc11
perf(channel): dedup Messages merge via id->index map
senamakel Jul 4, 2026
2ec6771
perf(checkpoint): single-pass state history and lean file get
senamakel Jul 4, 2026
544060e
perf(agent-loop): build tool schemas once per run, not per turn
senamakel Jul 4, 2026
50e4790
perf(graph): roll max_concurrency window instead of join_all chunks
senamakel Jul 4, 2026
487e035
perf(memory): atomic bulk replace instead of clear-then-append
senamakel Jul 4, 2026
ba022aa
perf(cache): LRU-bound response cache, stream-hash key, skip multi-turn
senamakel Jul 4, 2026
9142c33
perf(summarization): linear token trimming without per-message String…
senamakel Jul 4, 2026
5978894
perf(channel): merge takes current by value to fold aggregates in place
senamakel Jul 4, 2026
96898e0
perf(openai): batch SSE line draining to avoid per-line alloc and O(n…
senamakel Jul 4, 2026
717e6e7
perf(checkpoint): run durable put IO on the blocking pool
senamakel Jul 4, 2026
0d51b4c
fix(langfuse): slim metadata, valid span type, surface 207 failures
senamakel Jul 4, 2026
f78c9b9
perf(repl): drop redundant namespace snapshot clone per cell
senamakel Jul 4, 2026
29089f3
test(langfuse): assert tool observations export as span-create
senamakel Jul 4, 2026
139b10a
fix(middleware): bound TracingMiddleware/ContextCompressionMiddleware…
senamakel Jul 4, 2026
0628cb5
fix(observability): bound InMemoryEventJournal and InMemoryStatusStor…
senamakel Jul 4, 2026
5282654
fix(observability): preserve durable offsets across journal eviction
senamakel Jul 4, 2026
eac0897
docs: remove phantom openai feature and fix README metadata drift
senamakel Jul 4, 2026
9f81efb
docs: fix AGENTS.md project structure to match current tree
senamakel Jul 4, 2026
167ceed
docs: fix stale RustAgents naming in audit.md
senamakel Jul 4, 2026
4205019
docs: refresh ROADMAP.md against what has actually shipped
senamakel Jul 4, 2026
b787eb4
docs: split docs/spec/README.md and fix stale Package Layout/Milestones
senamakel Jul 4, 2026
ce123a6
docs: relocate goal.md to docs/sdk-gaps.md
senamakel Jul 4, 2026
4f30e6e
docs: flag docs/sdk-gaps.md as an internal migration backlog
senamakel Jul 4, 2026
1a185fe
docs: split docs/modules/registry/design.md under the 500-line limit
senamakel Jul 4, 2026
b396ff1
docs: split docs/modules/harness/README.md under the 500-line limit
senamakel Jul 4, 2026
aaaf870
docs: split docs/modules/expressive-language/README.md under 500 lines
senamakel Jul 4, 2026
f23f9e1
docs: split docs/modules/repl-language/design.md under 500 lines
senamakel Jul 4, 2026
5c3d4f8
docs: use https for the wiki submodule URL and document it
senamakel Jul 4, 2026
3840112
fix(registry): re-export ModelCatalog/AliasBinding, fix docs, escape …
senamakel Jul 4, 2026
4e292be
refactor(retry): share one retry-decision engine; fallback skips non-…
senamakel Jul 4, 2026
c3d0076
refactor(subagent): one shared child-depth guard across recursion sur…
senamakel Jul 4, 2026
96cfb71
refactor(ids): fold graph id counter into harness::ids single source
senamakel Jul 4, 2026
06f7ec6
refactor(time): single now_ms helper in harness::ids
senamakel Jul 4, 2026
271f3dc
refactor(openai): extract shared post_json/send transport helpers
senamakel Jul 4, 2026
3926ca1
refactor(middleware): factor stack-runners; balance Started/Completed…
senamakel Jul 4, 2026
ae532d3
refactor(graph): split compiled/mod.rs into executor/state_api/routing
senamakel Jul 4, 2026
5c17309
refactor(harness): split middleware/library/mod.rs by concern
senamakel Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "wiki"]
path = wiki
url = git@github.com:tinyhumansai/tinyagents.wiki.git
url = https://github.com/tinyhumansai/tinyagents.wiki.git
30 changes: 22 additions & 8 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
## Project Structure & Module Organization

TinyAgents is a Rust 2024 library crate rooted at `Cargo.toml`. Public API
exports live in `src/lib.rs`, with core modules split across `src/chat.rs`,
`src/model.rs`, `src/tool.rs`, `src/graph.rs`, and `src/error.rs`. Additional
architecture work is staged under module directories such as `src/harness/`,
`src/language/`, and `src/registry/`.
exports live in `src/lib.rs`, with the crate-wide error type in `src/error.rs`.
The five surfaces each live in their own module directory: `src/graph/`
(durable typed state graphs), `src/harness/` (provider-neutral model calls,
tools, middleware, streaming), `src/language/` (the declarative `.rag`
blueprint format), `src/registry/` (the named capability catalog), and
`src/repl/` (the imperative `.ragsh` session runtime).

Prefer small, focused modules that do one thing extremely well. New feature
areas should live in module directories instead of accumulating broad,
Expand All @@ -15,10 +17,22 @@ dedicated `types.rs` file and keep module-local unit tests in a dedicated
`test.rs` file. The module root should wire the pieces together and expose the
smallest useful API.

Integration tests are in `tests/`, currently focused on serialization behavior.
Runnable usage examples are in `examples/`, especially
`examples/basic_graph.rs`. Design notes and module-level specifications live in
`docs/`, with `docs/spec/README.md` as the top-level architecture reference.
Two Cargo features gate optional dependencies: `sqlite` (embedded SQLite
checkpointer, `graph::checkpoint::SqliteCheckpointer`) and `repl` (embedded
Rhai engine backing `repl::session`); every other provider and surface is
compiled in by default.

Integration tests are in `tests/`, covering serialization, graph routing,
registry binding, the expressive and REPL languages, streaming, subagents,
and provider contracts (including live, network-gated tests such as
`tests/live_*.rs`). Runnable usage examples are in `examples/`, especially
`examples/basic_graph.rs`. Design notes and module-level specifications live
in `docs/`, with `docs/spec/README.md` as the top-level architecture
reference and `docs/modules/` holding per-surface design docs (`graph/`,
`harness/`, `registry/`, `expressive-language/`, `repl-language/`). A `wiki/`
git submodule holds the published GitHub wiki pages; do not edit it as part
of unrelated work, and commit its pointer update separately when it does
change.

## Build, Test, and Development Commands

Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,31 @@ The bundled example should also run:
cargo run --example basic_graph
```

To build with the optional embedded SQLite checkpointer or the `.ragsh` Rhai
session runtime, enable the relevant feature:

```sh
cargo test --features sqlite
cargo test --features repl
```

### Wiki Submodule

The published GitHub wiki lives in `wiki/`, checked out as a git submodule
pointing at the `tinyhumansai/tinyagents.wiki` repository. It is not part of
the crate build and is not covered by this project's Markdown line-length or
review rules. Clone with submodules to pull it down:

```sh
git clone --recurse-submodules https://github.com/tinyhumansai/tinyagents.git
# or, in an existing checkout:
git submodule update --init wiki
```

Do not edit `wiki/` content as part of an unrelated code or docs change; wiki
edits should be their own commit (or made directly on the wiki) so the
submodule pointer update stays easy to review in isolation.

## Project Philosophy

TinyAgents should make agent systems explicit and inspectable. Prefer:
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,23 @@ Add TinyAgents to your project:

```toml
[dependencies]
tinyagents = "0.1"
tinyagents = "1.5"
```

The OpenAI (and OpenAI-compatible) provider is compiled in by default and pulls
no extra dependencies; the build stays offline unless you actually make a call.
The OpenAI (and OpenAI-compatible) provider is compiled in by default; the
build stays offline unless you actually make a call. Two optional Cargo
features gate heavier dependencies: `sqlite` (embedded SQLite checkpointer)
and `repl` (embedded Rhai engine for the `.ragsh` session runtime).

To explore locally:

```sh
git clone git@github.com:tinyhumansai/rustagents.git
cd rustagents
git clone git@github.com:tinyhumansai/tinyagents.git
cd tinyagents
cargo run --example basic_graph
```

OpenAI-backed examples need the feature flag and an API key:
OpenAI-backed examples need an API key:

```sh
export OPENAI_API_KEY=...
Expand Down Expand Up @@ -236,6 +238,10 @@ All live in [`examples/`](examples/):
- **`openai_self_blueprint`** — **the deepest recursion:** a model authors a
`.rag` blueprint that is compiled and run on the same runtime.
- **`rag_blueprint`** — load and run a declarative `.rag` workflow.
- **`goals_and_todos`** — a durable `ThreadGoal` driving a `TaskBoard` kanban
on one thread.
- **`subconscious_loop`** — an offline, testable autonomous closed-loop
harness (see [`examples/subconscious_loop/README.md`](examples/subconscious_loop/README.md)).
- **`openai_chat`** — a single provider-backed chat turn.
- **`openai_tools`** — tool calling against a hosted model.
- **`openai_structured`** — typed structured output.
Expand Down
96 changes: 40 additions & 56 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,50 @@
# Roadmap

TinyAgents is pre-1.0. The roadmap favors small, well-tested modules that build
toward a production-grade Rust agent runtime.

## Current Foundation

- chat message primitives
- model request and response types
- async chat model trait
- async tool trait
- executable state graph
- direct and conditional routing
- graph validation and recursion limits
- basic examples and serialization tests
TinyAgents is at v1.5.0. The roadmap favors small, well-tested modules that
build toward a production-grade Rust agent runtime.

## Shipped Foundation

- typed harness model calls, tools, middleware, structured output, streaming,
usage/cost tracking, retry/limits, cache, memory/embeddings, sub-agents,
and steering (`harness/`)
- durable typed state graph runtime: `START`/`END`, nodes, conditional
routing, `Command`s, fan-out, reducers/channels, checkpoints, interrupts,
subgraphs, streaming, and topology export (`graph/`)
- per-thread `ThreadGoal` and `TaskBoard` productivity primitives, exposed as
harness tools
- named capability registry (models, tools, agents, graphs, stores,
middleware, policy) bound by name (`registry/`)
- the declarative `.rag` blueprint language: lexer, parser, compiler, and
registry-backed binding (`language/`)
- the imperative `.ragsh` REPL language for capability-bound interactive
orchestration (`repl/`)
- an optional SQLite-backed checkpointer (`sqlite` feature) and an optional
Rhai-backed `.ragsh` session runtime (`repl` feature)
- an embedded Langfuse client and graph exporter for observability

## Near-Term Work

- split broad modules into focused module directories with `types.rs` and
`test.rs`
- expand graph tests for routing, recursion, validation, and error behavior
- strengthen harness model, tool, prompt, context, middleware, and usage APIs
- add more examples for model calls, tools, and graph composition
- define reducer and state-channel APIs for parallel writes
- document stable public API boundaries as modules mature

## Declarative Workflow Language

The `.rag` language should let humans and LLMs describe agent workflows without
embedding arbitrary host code.

Planned capabilities:

- graph topology declarations
- allowed models, tools, agents, stores, middleware, and subgraphs
- state channels and reducers
- direct routes, conditional routes, commands, sends, joins, and barriers
- parallel sub-agent fanout
- blocking and optional child-agent policies
- checkpoint, interrupt, timeout, retry, budget, and concurrency policies
- source spans and diagnostics
- blueprint review before execution
- broaden `.rag`/`.ragsh` example coverage for less-common routing and
parallel-fanout shapes
- continue splitting any module or doc that grows past the 500-line limit
into focused files
- expand live (network-gated) provider contract tests as new
OpenAI-compatible endpoints are added
- track and close the internal SDK feature-parity backlog in
[`docs/sdk-gaps.md`](docs/sdk-gaps.md)

## Parallel Agents And Sub-Agents

TinyAgents should support workflow-native parallelism:

- forked child contexts
- shared caches with explicit isolation policy
- child event namespaces
- parent and child run ids
- deterministic reducer-based merges
- optional, blocking, race, quorum, fallback, and compare policies
- resumable checkpoints across parallel branches

## REPL And Agent-Authored Workflows

The `.ragsh` REPL layer should let agents and humans inspect, script, and
control graph runs through capability-bound functions. It should be able to
propose `.rag` workflows, but those workflows must pass through parser,
registry, policy, and compiler checks before execution.
Shipped: forked child contexts, shared caches with explicit isolation policy,
child event namespaces, parent/child run ids, deterministic reducer-based
merges, optional/blocking/race/quorum/fallback/compare policies, and
resumable checkpoints across parallel branches. Ongoing work focuses on
hardening edge cases surfaced by the `e2e_parallel_*` and `live_subagent_*`
test suites.

## Pre-1.0 Stability
## Stability

APIs may change before 1.0. Changes should be documented, tested, and shaped by
real examples rather than speculative abstraction.
The public API is versioned via semver starting at 1.0. Breaking changes are
documented in release notes, tested, and shaped by real examples rather than
speculative abstraction.
2 changes: 1 addition & 1 deletion docs/audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Date: 2026-06-29

This audit reviewed the current RustAgents codebase for correctness gaps,
This audit reviewed the current TinyAgents codebase for correctness gaps,
security issues, implementation weaknesses, and spec-contract mismatches. No
code changes were made as part of the audit.

Expand Down
Loading