Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings
Open more actions menu

Latest commit

 

History

20 Commits
20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation


Python React FastAPI Ollama Pinecone Google Cloud Vite Status


🤖 Local AI Agent with Tool Use

An autonomous AI agent with tool use capabilities running 100% locally.

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




🧩  About the Project

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.




⚡  How It Works


         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.




✨  Features


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



🛠️  Tech Stack


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



📦  Prerequisites

Before getting started, make sure you have the following installed:




🚀  Getting Started


1 — Pull the required model

ollama pull llama3.2   # or your preferred model

2 — Clone the repository

git clone https://github.com/EduhxH/IA-agent-with-tools---.git
cd IA-agent-with-tools---/agente-ia-local

3 — 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.txt

4 — Set up the frontend

cd ../frontend
npm install

5 — 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



⚙️  Configuration

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 reader

No API keys required. Everything runs locally through Ollama.




☁️  Deployment

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.




📁  Project Structure

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



🧠  What I Learned

  • 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

About

Autonomous local AI agent. Ollama, FastAPI, React 19. ReAct pattern, file upload, IDE project reader, and MCP integration.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.