SmartAgent extends Agent with a curated set of built-in tools and two operating modes: solo for broad, open-ended tasks and project for context-driven, codebase-specific work. It is the recommended choice when you want practical capabilities (web search, bash, notes, scheduling) without manually wiring each tool.
Modes
- Solo mode
- Project mode
General-purpose chat and reasoning. The agent is not bound to any project context and can explore broadly.
- Ideal for discovery, brainstorming, and ad-hoc technical queries.
- Web search, bash, notes, datetime, cron, and memory tools are all available.
- No project context is injected — responses are scoped only by the conversation history.
SmartAgentMode Constants
mode constructor parameter and to set_mode().
Built-in Tools
SmartAgent loads a curated toolkit at initialization. Default tools are intentionally not loaded — the toolkit is lean and focused:
| Tool | Category | Description |
|---|---|---|
web_search | Web | Search the web and return results |
image_search | Web | Search for images with inline results |
datetime | Utility | Get current date and time |
notes | Utility | Create and retrieve persistent notes |
memory | Memory | Store and retrieve facts via RAG |
bash | Execution | Run shell commands |
add_cron_job | Scheduling | Schedule recurring tasks |
list_cron_jobs | Scheduling | List all scheduled jobs |
remove_cron_job | Scheduling | Cancel a scheduled job |
get_crons | Scheduling | Get cron job details |
You can extend the built-in toolkit with
register_tool_from_function() or add_custom_tool() inherited from Agent. Custom tools are merged with the built-in set.Constructor
LLM provider. Pass a string shorthand (
"ollama", "openai", "gemini", "groq", "azure") or a LLMProvider instance. Determines backend routing for all model calls.Provider-specific model name. Always specify explicitly in production for consistent behavior.
API key for cloud providers. Not required for
ollama.Operating mode:
"solo" or "project". Controls the system prompt template and whether project context is injected. Can be changed at runtime via set_mode(), switch_to_project(), or switch_to_solo().ID of an existing project to bind at initialization. When set alongside
mode="project", the agent immediately loads that project’s context. Create projects with create_project() before using this.Verbose logging — prints tool names, mode switches, and learning capture events.
Enable persistent memory indexing via
AgentrySimpleMem. Independent of the built-in memory tool, which is always available for explicit RAG lookups.Maximum tool-call iterations per
chat() call.Additional skill names or
Skill objects to load at startup.Root directory for filesystem and bash tools. Set this when the agent should only operate within a specific project directory.
chat()
Agent.chat(). In project mode, it prepends the project’s stored context to the session before calling the LLM. After a response, it scans for significant learnings and auto-stores them.
User message. Accepts plain text or a multimodal content list.
Conversation thread. Same ID preserves history across turns.
Enable token streaming with
on_token callback.Append an LLM-generated execution summary.
str — final assistant message.
Project Management Methods
create_project()
switch_to_project() after.
switch_to_project(project_id)
Load a project and switch to project mode. Rebuilds the system prompt with the project context.
ProjectContext if found, None if the project ID does not exist.
switch_to_solo()
Switch back to solo mode and clear the active project context.
set_mode(mode, project_id=None)
Low-level mode switch. Updates the system prompt and all active sessions.
list_projects()
Return all projects stored in project memory.
Memory Methods
remember(memory_type, title, content, tags)
Store a memory entry directly without going through the LLM:
recall(query, limit=5)
Search stored memories:
Reasoning Helper
reason(problem, session_id)
Explicitly request step-by-step chain-of-thought reasoning for a complex problem:
Status
| Key | Type | Description |
|---|---|---|
mode | str | Current mode ("solo" or "project") |
project_id | str | None | Active project ID |
project_title | str | None | Active project title |
model | str | Provider model name |
tools_loaded | int | Number of registered tools |
sessions_active | int | Number of live sessions |
memory_entries | int | Memory entries in active project |
Automatic Learning Capture
In project mode,SmartAgent scans each response for significant learning indicators and automatically stores qualifying snippets in project memory:
Auto-captured learnings are tagged
["auto-captured"] and stored under the active project_id. Use recall() or the memory tool to retrieve them in future sessions.Examples
- Solo mode
- Project mode
- Mode switching
- Status & memory
web_search to find current information and synthesize it into an answer.Comparison: Solo vs. Project Mode
| Aspect | Solo | Project |
|---|---|---|
| System prompt | Generic SmartAgent prompt | Project goal + environment + key files injected |
| Learning capture | Off | On — significant learnings auto-stored |
| Project context | None | Loaded from ProjectMemory on each chat() |
recall() scope | Global | Scoped to project_id |
| Best for | Exploration, brainstorming | Sustained delivery work |
Extends Agent
SmartAgent inherits all methods from Agent:
register_tool_from_function(),add_custom_tool(),load_skill()get_session(),clear_session()set_callbacks(),set_auto_approve_all()get_execution_summary(),print_execution_summary()