Commit Graph

36 Commits

Author SHA1 Message Date
JackChen ffec13e915
refactor: reorganize examples by category (#125)
Examples grew to 19 flat files mixing basics, provider demos, orchestration
patterns, and integrations, with two files colliding on the number 16.
Reorganized into category folders so the structure scales as new providers
and patterns get added.

Layout:
  examples/basics/         core execution modes (4 files)
  examples/providers/      one example per supported model provider (8 files)
  examples/patterns/       reusable orchestration patterns (6 files)
  examples/integrations/   MCP, observability, AI SDK (3 entries)
  examples/production/     placeholder for end-to-end use cases

Notable changes:
- Dropped numeric prefixes; folder + filename now signal category and intent.
- Rewrote former smoke-test scripts (copilot, gemini) into proper three-agent
  team examples matching the deepseek/grok/minimax/groq template. Adapter
  unit tests in tests/ already cover correctness, so this only improves
  documentation quality.
- Added examples/README.md as the categorized index plus maintenance rules
  for new submissions.
- Added examples/production/README.md with acceptance criteria for the new
  production category.
- Updated all internal npx tsx paths and import paths (../src/ to ../../src/).
- Updated README.md and README_zh.md links.
- Fixed stale cd paths inside examples/integrations/with-vercel-ai-sdk/README.md.
2026-04-19 17:01:58 +08:00
JackChen b857c001a8
feat: agent delegation mechanism (#123)
Implements `delegate_to_agent` built-in tool (closes #63). Opt-in registration via `includeDelegateTool`; only wired up by `runTeam` / `runTasks` for pool workers. Guards: self-delegation, unknown target, cycle detection via `delegationChain`, depth cap (`maxDelegationDepth`, default 3), pool deadlock.

Delegation runs on ephemeral Agent instances via `AgentPool.runEphemeral` (pool semaphore only, no per-agent lock) so mutual delegation (A→B while B→A) can't deadlock. Delegated run `tokenUsage` surfaces via `ToolResult.metadata` and rolls into the parent runner's total before the next budget check; delegation tool_result blocks are exempt from `compressToolResults` and the `compact` strategy. Best-effort SharedMemory audit writes at `{caller}/delegation:{target}:{ts}-{rand}`.

Picks up @NamelessNATM's work from #84 and adds cycle detection, token aggregation, compression exemption, mutual-delegation deadlock fix (Codex P1), and tool_result-preservation on budget-exceeded (Codex P2).

Co-authored-by: NamelessNATM <hamzarstar@gmail.com>
2026-04-19 10:50:44 +08:00
JackChen b4b38ffdd8 docs: drop deprecated mixtral from groq example model list
Groq deprecated mixtral-8x7b-32768; not in current production models.
Follow-up to #121.
2026-04-17 12:16:52 +08:00
Matt Van Horn 4714dd1d4c
feat: add Groq provider example and README entry (#121)
Fixes #25
2026-04-17 12:15:45 +08:00
hkalex 0485bfb82f Change the default URL of deepseek. Change the example to use reasoner for architect. 2026-04-16 12:17:22 +10:00
hkalex fa4533e8d0 Support DeepSeek 2026-04-16 11:36:03 +10:00
hkalex 5305cb2321 Support MiniMax 2026-04-16 11:06:37 +10:00
JackChen 8ecfc1504c feat: add Vercel AI SDK integration example (Next.js + runTeam)
Next.js App Router demo showing OMA + Vercel AI SDK working together:
- Backend: OMA runTeam() orchestrates researcher + writer agents
- Frontend: AI SDK useChat hook for streaming chat UI
- Uses DeepSeek via OpenAI-compatible provider
2026-04-16 00:49:49 +08:00
JackChen ced1d90a93
Merge pull request #89 from ibrahimkzmv/feat.mcp-tool-integration
feat: add connectMCPTools() to register MCP server tools as standard agent tools
2026-04-12 17:05:31 +08:00
JackChen 0fb8a38284
Merge pull request #88 from ibrahimkzmv/feat.context-strategy
feat: Add contextStrategy to control conversation growth and prevent token explosion in agent runs
2026-04-12 16:54:41 +08:00
Ibrahim Kazimov 167085c3a7
Merge branch 'main' into feat.mcp-tool-integration 2026-04-12 00:03:18 +03:00
MrAvalonApple 12dd802ad8 feat: update MCP GitHub example and added llmInputSchema 2026-04-12 00:01:22 +03:00
Ibrahim Kazimov aa5fab59fa
feat: enforce dependency-scoped agent context (default-deny) (#87)
Co-authored-by: MrAvalonApple <74775400+ibrahimkazimov@users.noreply.github.com>
2026-04-10 03:09:58 +08:00
MrAvalonApple 7aa1bb7b5d feat: add connectMCPTools() to register MCP server tools as agent tools 2026-04-09 20:05:20 +03:00
MrAvalonApple eb484d9bbf feat: add context management strategies (sliding-window, summarize, custom) to prevent unbounded conversation growth 2026-04-09 19:40:15 +03:00
JackChen cb11020c65 chore: rename research aggregation example to 15- (avoid collision with 14-) 2026-04-08 12:14:23 +08:00
JackChen 91494bcca9
Merge pull request #79 from mvanhorn/osc/76-research-aggregation
feat: add multi-source research aggregation example
2026-04-08 12:13:48 +08:00
JackChen faf24aaffa chore: rename example to 14- prefix and fix misleading shared memory prompts
The agent system prompts and task descriptions implied agents could
explicitly read/write shared memory keys, but the framework handles
this automatically. Simplified to match actual behavior.
2026-04-08 12:08:54 +08:00
Matt Van Horn 54bfe2ed2d fix: address review feedback on research aggregation example
- Fix handleProgress: use underscore event types (task_start/task_complete)
  and correct property names (event.task/event.agent) per OrchestratorEvent
- Remove Task[] annotation (Task requires id, status, createdAt, updatedAt)
- Rename 13-research-aggregation.ts to 14-research-aggregation.ts
- Remove shared memory key references from prompts (framework handles this)
- Add header note differentiating from example 07 (runTasks vs AgentPool)
2026-04-07 18:22:31 -07:00
Matt Van Horn 40f13a09a6 fix: correct event types, properties, and Task annotation
- Use 'task_start'/'task_complete' (underscores) instead of colons
- Use event.task/event.agent instead of non-existent taskTitle/agentName
- Remove Task import; runTasks() accepts a lighter inline type
2026-04-07 16:46:50 -07:00
Matt Van Horn 0fd18d8a19 feat: add multi-perspective code review example
Adds an example showing a generator agent producing code, then
three reviewer agents (security, performance, style) analyzing it
in parallel, followed by a synthesizer merging all feedback into
a prioritized action item report.

Closes #75
2026-04-07 03:16:27 -07:00
Matt Van Horn 34ca8602d0 feat: add multi-source research aggregation example
Demonstrates parallel analyst execution with dependency-based
synthesis using runTasks(), sharedMemory, and dependsOn:

1. Three analyst agents research the same topic in parallel
   (technical, market, community perspectives)
2. Synthesizer waits for all analysts via dependsOn, reads
   shared memory, cross-references findings, and produces
   a unified report

Fixes #76
2026-04-07 02:52:23 -07:00
JackChen bc31008f4e feat(llm): add fallback tool-call extraction for local models (#15)
Local models (Ollama, vLLM) sometimes return tool calls as text instead
of using the native tool_calls wire format. This adds a safety-net
extractor that parses tool calls from model text output when native
tool_calls is empty.

- Add text-tool-extractor with support for bare JSON, code fences,
  and Hermes <tool_call> tags
- Wire fallback into OpenAI adapter chat() and stream() paths
- Add onWarning callback when model ignores configured tools
- Add timeoutMs on AgentConfig for per-run abort (local models can
  be slow)
- Add 26 tests for extractor and fallback behavior
- Document local model compatibility in README
2026-04-05 11:49:10 +08:00
MrAvalonApple 553bf24e61 chore: support Node >=18, add optional @google/genai peer dependency and API key fallback 2026-04-04 22:12:28 +03:00
Ibrahim Kazimov 944918d5ae
Merge branch 'main' into main 2026-04-04 13:43:40 +03:00
Marcelo Ceccon 10074c9b7d
feat(llm): add first-class Grok (xAI) support with dedicated GrokAdapter (#44)
feat(llm): add first-class Grok (xAI) support with dedicated GrokAdapter
2026-04-04 18:20:55 +08:00
JackChen 0111876264
feat: add onTrace observability callback (#18)
Add lightweight onTrace callback to OrchestratorConfig that emits
structured span events (llm_call, tool_call, task, agent) with timing,
token usage, and runId correlation. Zero overhead when not subscribed.

Closes #18
2026-04-03 15:28:59 +08:00
JackChen 17546fd93e docs: merge Gemma 4 examples, reorder README sections
- Merge examples 08 (runTasks) and 09 (runTeam) into a single Gemma 4 example
- Renumber: structured output → 09, task retry → 10
- Move Author and Contributors sections to bottom in both READMEs
- Add Author section to English README
2026-04-03 14:32:48 +08:00
JackChen 27c0103736 docs: add examples for structured output and task retry 2026-04-03 14:23:22 +08:00
JackChen d86ea766d3 feat: add Gemma 4 auto-orchestration example (runTeam)
Add examples/09-gemma4-auto-orchestration.ts demonstrating runTeam()
with Gemma 4 as the coordinator — the framework's key feature running
fully local. The coordinator successfully decomposes goals into JSON
task arrays, schedules dependencies, and synthesises results.

Verified on gemma4:e2b (5.1B params) with Ollama 0.20.0-rc1.
2026-04-03 09:28:45 +08:00
JackChen f9fcac0c38 feat: add Gemma 4 local model example with tool-calling
Add examples/08-gemma4-local.ts demonstrating a pure-local multi-agent
team using Gemma 4 via Ollama — zero API cost. Two agents (researcher +
summarizer) collaborate through a task pipeline with bash, file_write,
and file_read tools. Verified on gemma4:e2b with Ollama 0.20.0-rc1.

Update both READMEs: add example 08 to the examples table and note
Gemma 4 as a verified local model with tool-calling support.
2026-04-03 09:12:44 +08:00
MrAvalonApple 9f3e4751aa docs: update example for Gemini adapter with correct usage instructions 2026-04-02 22:17:54 +03:00
MrAvalonApple 91826b5c22 docs: add example for Gemini model 2026-04-02 22:16:16 +03:00
JackChen 31a0fa4951 docs: add examples for local models (Ollama) and fan-out/aggregate pattern
- 06-local-model.ts: mix Ollama (local) + Claude (cloud) in a runTasks pipeline,
  demonstrating baseURL and apiKey placeholder for OpenAI-compatible servers
- 07-fan-out-aggregate.ts: MapReduce pattern using AgentPool.runParallel() to
  fan out analysis to 3 perspective agents, then aggregate via a synthesizer
2026-04-03 02:12:05 +08:00
Deathwing eedfeb17a2 feat: add GitHub Copilot as LLM provider
- Add CopilotAdapter with OAuth2 device flow authentication
- Token exchange via /copilot_internal/v2/token with caching
- Premium request multiplier system (getCopilotMultiplier)
- Full model metadata catalog (COPILOT_MODELS)
- Add 'copilot' to SupportedProvider and provider union types
- Add example: examples/05-copilot-test.ts
2026-04-02 01:45:43 +02:00
JackChen a6244cfe64 Initial release: open-multi-agent v0.1.0
Production-grade multi-agent orchestration framework.
Model-agnostic, supports team collaboration, task scheduling
with dependency resolution, and inter-agent communication.
2026-04-01 04:33:15 +08:00