Adaptive multi-agent terminal system for:
- knowledge lookup
- document summary
- tabular data analysis
- code-oriented execution
The runtime is designed as a dynamic loop, not a fixed keyword router.
python3 terminal_chat.py --workspace .--workspace . means all file search/read/write/tool execution is scoped to the current directory.
The orchestrator follows:
- Goal Understanding
- Plan
- Tool Call
- Observation
- Reflection
- Recovery/Replan (if needed)
- Continue or Finish
Main implementation: DynamicLoopOrchestrator in multi_agent_system.py.
The system now includes explicit failure handling instead of stopping after repetitive errors.
- Failure classification (
missing_input,parse_error,timeout,policy_block, etc.) - Recovery step synthesis based on failure category
- Plan injection (insert recovery steps into current plan and continue)
- Reflection logging in results (
reflections) and event stream (reflectphase) - Clarify only after recovery attempts are exhausted
Key methods:
_classify_tool_failure(...)_build_recovery_steps(...)_inject_recovery_steps(...)_reflect_and_recover(...)
These methods are in multi_agent_system.py under DynamicLoopOrchestrator.
For high-frequency lookup tasks (for example JSON key search), the orchestrator uses a deterministic pre-plan before LLM planning.
Current rule:
- detect token/key lookup intent
- run:
list_workspace_filesfor*.jsonsearch_workspace_textfor the target token
This avoids fragile repeated trial calls and improves consistency.
read_document_file: parse.docx/.pdf/.txt/.mdread_spreadsheet_preview/profile_tabular_columns: CSV/XLSX preview and profilinganalyze_tabular_with_python: writes and executes a temporary Python analyzer script, then returns structured resultsread_code_file/read_code_span/replace_text_in_file/run_shell_command: code-task workflow
terminal_chat.py has English-first startup/help/fallback messages and renders:
- execution summary
- observations
- reflections
- event phases
do you find this key d5bbc8180dba11ecb1e81171463288e9 in the json fileanalyze this file ./sample_data.xlsxsummarize /absolute/path/to/file.pdfcheck multi_agent_system.py and run python3 -m py_compile multi_agent_system.py
- This project executes commands locally in the workspace (not containerized by default).
- Safety checks are enforced for risky shell patterns and policy-blocked tool calls.
- High-risk actions can require explicit approval (
approved=truedepending on tool permission policy).