How sumoksh1/ai-research-agent works
AI Research Agent is an interactive CLI assistant for research and coding. Users submit a request for direct ReAct execution or sequential planned tasks; the agent consults Gemini, dispatches tools, and returns results. Short-term conversation state and SQLite-backed long-term memory support those workflows, with memory viewing and conversation clearing available from the menu. The graph preserves the documented research, calculation, workspace, and memory tool capabilities. Some tool implementations were not excerpted, so their documented roles are shown without guessed internal call relationships.
Main entry points: agent.py ReAct agent · tool_registry.py Tool registry · app.py Interactive menu · planner.py Plan execution
Components 18
CLI and execution
- Interactive menu
src/agent/app.py - Conversation session
src/agent/features/chat/session.py - Plan execution
src/agent/features/planning/planner.py
Agent reasoning
- ReAct agent
src/agent/features/chat/agent.py - Gemini client
src/agent/core/llm.py - Tool registry
src/agent/core/tool_registry.py
Memory
- SQLite memory store
src/agent/features/memory/store.py - Memory retrieval
src/agent/features/memory/retrieval.py - Memory extraction
src/agent/features/memory/extraction.py - Memory viewing
src/agent/features/memory/view.py
Agent tools
- Web search
src/agent/features/tools/web_search.py - Page fetch
src/agent/features/tools/fetch_page.py - Calculator
src/agent/features/tools/calculator.py - Workspace files
src/agent/features/tools - Workspace path guard
src/agent/features/tools/_workspace.py - Memory tools
src/agent/features/tools
Other components
- CLI user
- Gemini API
Connections 26
- CLI user → Interactive menu: submits request
src/agent/app.py - Interactive menu → ReAct agent: runs directly
src/agent/app.py - Interactive menu → Plan execution: runs plan
src/agent/app.py - Interactive menu → Memory viewing: views memories
src/agent/app.py - Interactive menu → Conversation session: clears history
src/agent/app.py - Plan execution → ReAct agent: runs each task
src/agent/features/planning/planner.py - Plan execution → Gemini client: generates plan
src/agent/features/planning/planner.py - ReAct agent → Conversation session: adds messages
src/agent/features/chat/agent.py - ReAct agent → Memory retrieval: builds context
src/agent/features/chat/agent.py - Memory retrieval → SQLite memory store: retrieves facts
src/agent/features/memory/retrieval.py - ReAct agent → Gemini client: requests response
src/agent/features/chat/agent.py - Gemini client → Gemini API: calls API
src/agent/core/llm.py - ReAct agent → Tool registry: dispatches tools
src/agent/features/chat/agent.py - Tool registry → Web search: executes handler
src/agent/features/tools/__init__.py - Tool registry → Page fetch: executes handler
src/agent/features/tools/__init__.py - Tool registry → Calculator: executes handler
src/agent/features/tools/__init__.py - Tool registry → Workspace files: executes handler
README.md - Tool registry → Memory tools: executes handler
src/agent/features/tools/__init__.py - Workspace files → Workspace path guard: validates paths
src/agent/features/tools/write_file.py - Workspace files → CLI user: reads or writes files
README.md - ReAct agent → Memory extraction: saves user facts
src/agent/features/chat/agent.py - Plan execution → Memory extraction: saves request
src/agent/features/planning/planner.py - Memory extraction → SQLite memory store: stores facts
src/agent/features/memory/extraction.py - Memory extraction → Gemini client: extracts facts
src/agent/features/memory/extraction.py - Memory tools → SQLite memory store: searches or deletes
- Memory viewing → SQLite memory store: lists facts