Enhanced with MCP-SERVER-PRO for professional tool integration.
🇺🇸 The source code — variables, functions, and comments — is written entirely in American English.
How It Works • Features • Tech Stack • Getting Started • Configuration • Deployment
This project is a deep dive into the ReAct (Reasoning and Acting) pattern — built from scratch, without relying on high-level AI frameworks like LangChain.
The goal was to create an agent that doesn't just talk, but actually executes actions to find information and perform tasks. It uses a manual implementation of the reasoning loop, where the LLM decides which tool to invoke, processes the output, and continues reasoning until it reaches a final answer.
Now integrated with the Model Context Protocol (MCP), the agent can leverage professional-grade tools via MCP-SERVER-PRO for database management, spreadsheet manipulation, and more.
User Question
↓
LLM Reasons (Thought)
↓
Action Selection (Tool Call)
↓
Tool Execution (Local / MCP)
↓
Observation (Tool Output)
↓
LLM Final Answer (Result)
The backend exposes a /chat endpoint. On each request, the agent runs the full ReAct loop —
reasoning, selecting a tool, executing it, and feeding the result back — until a final answer is reached.
| Icon | Feature | Description |
|---|---|---|
| 🛠 | Manual ReAct Pattern | Reasoning loop implemented from scratch — no abstractions |
| 📂 | Smart File Upload | New frontend button to upload files directly; agent reads them using file_reader.py |
| 💻 | IDE Project Reader | Advanced feature to read any local project by setting the workspace_root path |
| 🌐 | Web Search Tool | Real-time search powered by DuckDuckGo |
| 🔢 | Calculator Tool | Accurate math operations executed via code |
| 🔌 | MCP Integration | Professional tools via MCP-SERVER-PRO |
| 🚀 | FastAPI Backend | Lightweight, async API handling all agent logic |
| 🔒 | 100% Local | Powered by Ollama — data never leaves your machine |
| Technology | Role |
|---|---|
| React 19 | Frontend UI with new File/IDE integration buttons |
| Vite | Frontend build tool |
| FastAPI | Backend API framework |
| Ollama | Local LLM engine |
| MCP | Model Context Protocol integration |
| DuckDuckGo Search | Web search capability |
| Pydantic | Data validation |
Before getting started, make sure you have the following installed:
- Python 3.11+
- Node.js & npm
- Ollama — running locally on your machine
1 — Pull the required model
ollama pull llama3.2 # or your preferred model2 — Clone the repository
git clone https://github.com/EduhxH/IA-agent-with-tools---.git
cd IA-agent-with-tools---/agente-ia-local3 — Set up the backend
cd backend
python -m venv .venv
# Activate the virtual environment
source .venv/bin/activate # Linux / Mac
.venv\Scripts\activate # Windows
pip install -r requirements.txt4 — Set up the frontend
cd ../frontend
npm install5 — Run the project
# Terminal 1 — Backend (inside /backend)
uvicorn api.app:app --reload --port 8000
# Terminal 2 — Frontend (inside /frontend)
npm run dev| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend | http://localhost:8000 |
The backend is configured via environment variables. Create a .env file inside backend/:
OLLAMA_BASE_URL=http://localhost:11434 # default Ollama address
OLLAMA_MODEL=llama3.2 # model used for inference
WORKSPACE_ROOT=C:/your/project/path # configurable path for IDE readerNo API keys required. Everything runs locally through Ollama.
This project is also deployed in the cloud:
| Platform | URL |
|---|---|
| 🌐 Vercel (Frontend) | ia-agent-with-tools.vercel.app |
| 🚂 Railway (Backend) | ia-agent-with-tools-production.up.railway.app |
⚠️ The deployed version uses a remote LLM provider. For full privacy, run the project locally with Ollama.
agente-ia-local/
│
├── backend/
│ ├── agent/
│ │ ├── agent.py # ReAct loop logic
│ │ └── ollama_client.py # Ollama HTTP client
│ ├── api/
│ │ └── app.py # FastAPI routes & app setup
│ ├── tools/ # Core tool implementations (file_reader.py, etc.)
│ └── requirements.txt
│
├── frontend/
│ ├── src/ # React components with Upload/IDE UI
│ └── vite.config.js
│
└── .gitignore
- The inner workings of the ReAct pattern and how agentic reasoning loops are structured.
- Manual tool-calling implementation using structured system prompts.
- Integration with the Model Context Protocol (MCP) for professional toolsets.
- Implementing File Upload logic to allow agents to process user-provided data.
- Creating a Dynamic IDE Reader to allow AI interaction with any local workspace.
- Designing a clean, decoupled architecture with FastAPI and React 19.
Made with 💜 by EduhxH