mirror of
https://github.com/open-jarvis/OpenJarvis.git
synced 2026-07-27 21:05:34 +00:00
* chore: create learning subdirectory structure (routing, agents, intelligence) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: extract classify_query to routing/_utils.py Move the classify_query() function and its regex patterns into a shared utility module so multiple routing policies can import it without depending on the full trace_policy module. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: move routing files to learning/routing/ subdirectory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: create LearnedRouterPolicy merging trace-driven + SFT routing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add conditional Algolia DocSearch integration Add Algolia DocSearch as an optional search upgrade — native lunr.js search remains the default until credentials are configured. Includes CDN assets, Jinja2 conditional config injection, init script with graceful fallback, light/dark theme CSS, improved search tokenization for snake_case/dotted identifiers, and search boosts for key pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: move agent_evolver and skill_discovery to learning/agents/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: move learning/orchestrator to learning/intelligence/orchestrator Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: delete removed learning policies, rewrite __init__.py, clean up api_routes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add SFT/GRPO/DSPy/GEPA config dataclasses, update LearningConfig Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add general-purpose SFT trainer (intelligence/sft_trainer.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update stale imports in multi_model_router example Update imports to use new learning/routing/ paths after the subdirectory reorganization. Replace BanditRouterPolicy with LearnedRouterPolicy. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add general-purpose GRPO trainer (intelligence/grpo_trainer.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add DSPy agent optimizer (agents/dspy_optimizer.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add GEPA agent optimizer (agents/gepa_optimizer.py) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add learning-dspy and learning-gepa optional dependency extras Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: update integration test to check for learned policy instead of grpo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: clean up stale APIs and unused params in examples - deep_research: remove system_prompt and max_turns params not accepted by Jarvis.ask(), inline system prompt into the query instead - doc_qa: remove unused --top-k CLI arg that was never passed to the API - multi_model_router: fix select_model() call to match single-arg signature Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: import SFT/GRPO trainers in intelligence/__init__.py for registry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove .md file changes from PR Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: restore search boost frontmatter for key docs pages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Deep Research Assistant
A tutorial example demonstrating how to build a multi-source research agent using OpenJarvis. The assistant uses an orchestrator agent loop with web search, memory storage, and file output to produce comprehensive research reports with citations.
What This Example Demonstrates
- Orchestrator agent loop -- the agent iterates through multiple tool-calling turns, deciding at each step whether to search, store, or synthesize.
- Memory-augmented reasoning -- findings from earlier searches are stored in memory and retrieved later for cross-referencing and deduplication.
- Tool composition -- five tools (
web_search,think,file_write,memory_store,memory_search) are wired together through a single recipe config. - Recipe-driven configuration --
research.tomlcaptures the full pillar-aligned setup (model, engine, agent, tools) in a declarative file.
Prerequisites
- Python 3.10 or later
- OpenJarvis installed (
uv sync --extra devfrom the repo root) - An inference engine running. Either:
- Ollama (local):
ollama serveandollama pull qwen3:8b - Cloud API (remote): set the appropriate key in
.envand use--engine cloud
- Ollama (local):
Quick Start
# From the repository root
python examples/deep_research/research.py "quantum computing advances 2026"
Save the output to a file:
python examples/deep_research/research.py "quantum computing advances 2026" \
--output report.md
Use a different model or engine:
python examples/deep_research/research.py "climate policy trends" \
--model gpt-4o --engine cloud --max-turns 20
Configuration Options
| Flag | Default | Description |
|---|---|---|
--model |
qwen3:8b |
Model identifier passed to the engine |
--engine |
ollama |
Engine backend (ollama, cloud, vllm ...) |
--max-turns |
15 |
Maximum orchestrator loop iterations |
--output |
(none) | File path to save the final report |
The companion research.toml provides the same defaults as a declarative
recipe that can be loaded with load_recipe() or passed to the jarvis eval
runner.
How It Works
User query
|
v
Jarvis SDK (model + engine selection)
|
v
OrchestratorAgent (multi-turn tool loop, up to max_turns)
|
+---> web_search -- fetch recent sources from the web
+---> think -- internal reasoning scratchpad
+---> memory_store -- persist key findings for later retrieval
+---> memory_search -- cross-reference earlier findings
+---> file_write -- save the final report to disk
|
v
Synthesized report with citations
Each turn, the orchestrator decides which tool to call (or whether to produce
a final answer). The think tool lets the model reason without side effects,
while memory_store / memory_search give it persistent scratch space across
turns.
Customization Tips
- Add more tools -- append tool names to the
toolslist inresearch.tomlor pass them on the command line. Seejarvis agent info orchestratorfor the full tool catalog. - Adjust temperature -- lower values (0.2) produce more focused reports; higher values (0.8) encourage broader exploration.
- Swap the agent -- replace
orchestratorwithnative_reactfor a Thought-Action-Observation loop, ornative_openhandsfor a CodeAct-style agent. - Use the recipe programmatically -- load the TOML with
openjarvis.recipes.load_recipe("examples/deep_research/research.toml")and pass the result toSystemBuilder.
Further Reading
- Architecture: Agents -- agent hierarchy (
BaseAgent,ToolUsingAgent,OrchestratorAgent) and theaccepts_toolsmechanism. - Architecture: Tools -- tool registry, MCP adapter, and
the
ToolExecutordispatch pipeline. - Recipes -- composable TOML configs that wire all five pillars.