AutoBot is a local-first assistant that executes a single agentic flow:
tool_use
Removed runtime flows:
reactplanningmulti_agentpev
The orchestrator supports:
- 2 local model lanes (
autobot_instruct,autobot_rag) - Tool integrations (
web_search,send_email) - Long-term + episodic + semantic memory
- Debug traces (tool decisions, retries, failures)
- Retry with log-aware recovery (max 3 attempts)
Note:
- This repository now runs a strict single-agent tool-use path only.
- Some lower sections in this README may still contain historical architecture notes.
Runtime is now strict single-agent tool_use only.
Legacy sections below may still describe historical flows and should be treated as reference only.
AutoBot now uses LangChain components where they are suitable for speed, structure, and reliability:
langchain-core- prompt templating (
PromptTemplate) - structured output parsing (
PydanticOutputParser) - reusable tool definitions (
StructuredTool) - callback-based observability
- prompt templating (
langchain-community- BM25 retrieval reranking for memory fallback
- local document loaders (PDF/CSV/HTML/TXT)
langchain-text-splitters- chunking long local document text before retrieval
langchain- conversation buffer memory integration
langgraph- optional graph-based multi-agent execution path
langchain-experimental/langchain-guardrails- optional advanced/guardrail ecosystem dependencies
When these packages are unavailable at runtime, AutoBot falls back to built-in logic and keeps serving requests.
Note:
- Some requested capabilities like
agents,chains,planning,react,schema,output-parsers,prompt,load,retrievers, andmulti-agentare implemented through the concrete modules above (langchain-core,langchain-community,langgraph, andlangchain) rather than separate runtime packages.
- Entry point:
main.py - Orchestration:
core/orchestrator.py - Intent + Planner + LLM abstraction:
core/intent_classifier.pycore/planner.pycore/llm_interface.py
- Memory:
memory/memory_manager.pymemory/rag_pipeline.py
- Tools:
tools/tool_registry.pytools/web-search/search.pytools/send-email/send-email.py
Reference-only notebooks live in arc-files/ and are not runtime modules.
flowchart TD
U[User Query] --> O[Orchestrator.handle_input]
O --> C[Cache Check]
C -->|hit| R1[Return Cached Response]
C -->|miss| I[Intent Classification]
I --> M[Meta-Controller Routing]
M --> G[Goal Profile Builder]
G --> F{Select Flow}
F --> T[tool_use]
F --> R[react]
F --> P[planning]
F --> MA[multi_agent]
F --> V[pev]
T --> S[Synthesize Final Response]
R --> S
P --> S
MA --> S
V --> S
S --> MEM[Batch + Episodic/Semantic Memory Update]
MEM --> D[Debug Trace Update]
D --> OUT[Return Response]
flowchart LR
Q[Incoming Request] --> MC[Meta-Controller]
MC --> SP[Specialist Pool]
SP --> SG[generalist]
SP --> SR[researcher]
SP --> SC[coder]
SP --> SS[summarizer]
SP --> SA[analyst]
SP --> SPL[planner]
SP --> SRT[retriever]
SP --> SCC[compliance_checker]
SP --> SO[optimizer]
SP --> SE[explainer]
generalist: chat, direct Q&A, simple assistant tasks.researcher: factual research, latest/current events, evidence-heavy requests.coder: code generation, debugging, refactoring, algorithm/programming tasks.summarizer: condenses long text/documents into concise summaries.analyst: interprets data and returns structured insights.planner: decomposes complex tasks into ordered steps.retriever: fetches relevant memory/vector-store context.compliance_checker: validates outputs against rules/safety constraints.optimizer: improves efficiency, latency, cost, or resource usage.explainer: provides step-by-step explanations.
flowchart TD
A[Execute Selected Flow] --> B{Exception or Failed Steps?}
B -->|No| C[Return Flow Result]
B -->|Yes| D[Collect Failure Logs + Trace]
D --> E[Switch to PEV Replan]
E --> F{Replan Success?}
F -->|Yes| G[Return Replanned Result]
F -->|No| H[Return Safe Failure Response]
flowchart LR
U[User Input] --> ST[Short-Term Memory]
U --> LT[Interaction Storage (SQLite)]
LT --> ES[Episodic Memory]
LT --> SM[Semantic Facts]
Q[New Query] --> RET[Retrieve]
RET --> RAG[RAG Context]
RET --> ESR[Episodic Recall]
RET --> SMR[Semantic Recall]
RAG --> C[Combined Context]
ESR --> C
SMR --> C
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txtpython main.pyThen choose:
1for text interface2for voice interface
Important sections:
assistant: display name/versionmemory: sqlite + vector store pathsinterfaces: text/voice enable flagstools.enabled: tool availability flagsperformance: cache and memory batchingdebug.enabled: debug print + trace supportagentic: flow tuning, meta-controller tuning, and langchain optimization toggles
debug:
enabled: true
agentic:
react_max_iterations: 4
pev_max_attempts: 3
max_context_length: 32768
max_tokens_hard_limit: 4096
meta_controller:
enabled: true
temperature: 0.1
max_tokens: 320
langchain:
enabled: true
use_bm25_rerank: true
use_local_doc_loader: true
use_langgraph_multi_agent: true
chunk_size: 900
chunk_overlap: 120Input:
Hello, can you help me plan my day?
Expected route:
- Specialist:
generalist - Flow: typically
react
Output shape:
Sure. Here's a simple plan for your day...
Input:
Search latest AI regulation updates in the US and summarize key points.
Expected route:
- Specialist:
researcher - Flow:
tool_useorplanning(may escalate by complexity) - Tool:
web_search
Output shape:
Here are the latest updates...
Sources considered: ...
Input:
Write a Python function to return the nth Fibonacci number.
Expected route:
- Specialist:
coder - Flow:
react(simple) orplanning/pev(complex)
Output shape:
def fib(n: int) -> int:
if n < 2:
return n
a, b = 0, 1
for _ in range(2, n + 1):
a, b = b, a + b
return bInput:
Send email to alice@example.com with subject "Status" and body "Build is green".
Expected route:
- Tool involvement:
send_email - Missing fields trigger validation prompt before send.
Output shape:
Email sent successfully (or validation message listing missing fields).
Programmatic call:
response = await orchestrator.handle_input(
"Summarize the attached reports and compare findings.",
context={
"local_documents": [
"./memory/data/report_a.pdf",
"./memory/data/report_b.csv",
]
},
)Expected behavior:
- local docs are loaded via langchain-community loaders,
- long text is split with langchain text splitters,
- retrieval context is BM25-reranked before synthesis.
Each request can log:
- chosen flow
- chosen specialist
- models used
- route events and replan events
Runtime debug print example:
[DEBUG] request=trace_... chosen_flow=planning chosen_complexity=medium chosen_specialist=researcher
[DEBUG] request=trace_... chosen_flow=planning chosen_specialist=researcher chosen_models=['autobot_instruct', 'autobot_rag']
Programmatic status endpoint-like call:
status = await orchestrator.get_debug_status(limit=20)
print(status["active_request"])
print(status["recent_trace"])Use these prompts to quickly verify routing:
Hi there!Search latest semiconductor market report and summarize.Write Python code to parse CSV and group by date.Create a comprehensive plan, execute it, and verify risks.Send email to test@example.com saying deployment completed.
Check:
- specialist chosen correctly,
- flow chosen matches complexity,
- tool usage appears when needed,
- replan triggers on forced failures.
arc-files/notebooks are design references, not runtime imports.memory/ingestion_pipeline.pyis a standalone ingestion utility.- Voice mode requires platform audio dependencies (
SpeechRecognition,pyaudio,pyttsx3).