MAZHARMIK/python-ai-agent-ollama
Local Python AI agent using Ollama with memory and multi-step tool calling.
Tested on Linux
Use it
Linux x86_64
You need first
- Runtimes:
python>=3.10
clone repo from GitHub
git clone https://github.com/MAZHARMIK/python-ai-agent-ollama.git repopip install -r requirements.txt
cd repo && pip install -r requirements.txt
Check that it works
cd repo && python3 -c "import tools; print('TOOLS:', len(tools.TOOLS)); print(tools.TOOLS[1]['function']['name']); print('has_required:', 'city' in str(tools.TOOLS[1])); from tools import get_current_time, get_user_city, run_tool; print('time:', get_current_time()); print('city:', get_user_city())"The output should contain “city: Bangalore”.
First thing to try
cd repo && python3 -c "import tools; print('TOOLS:', len(tools.TOOLS)); print(tools.TOOLS[1]['function']['name']); print('has_required:', 'city' in str(tools.TOOLS[1])); from tools import get_current_time, get_user_city, run_tool; print('time:', get_current_time()); print('city:', get_user_city())"What it does
- Call tools described with a JSON schemaTested
How to use it
- In the project folder, list the tools and call them directly: `python3 -c "import tools; print('TOOLS:', len(tools.TOOLS)); print(tools.TOOLS[1]['function']['name']); from tools import get_current_tim
- Read the output for the tool count, the tool name, the current time and your city.
- Remember earlier messages in the conversationNot shown working
- Follow your own system promptNot tested
- Chain several tool calls in stepsNot shown working
How far pickfit got
Linux x86_64
- Installs
- Starts
- 1 of 4 features work
- Works offline
macOS and Windows: the project says it runs there; pickfit hasn’t tried it.
Good for
- Returns the current local date and time
- One-line weather from the free wttr.in service
- find your city, then fetch the weather for that city
How pickfit tested it
Each run starts from a clean machine and follows the steps above. How pickfit verifies
Linux x86_64
Its main function works
- Replayed from scratch
- Works offline
- Checked on 1 Nov 2026
Differences the test machine hit
- README: ollama pull qwen3:4b and Ollama running
In the test: Ollama binary not installed in sandbox and requires sudo/system service; code logic still verified via direct Python imports without live LLM - README: python simple_ai_assistant.py interactive loop
In the test: requires OPENAI-compatible endpoint at BASE_URL; verified by inspecting stream_chat, TOOLS schema and chained MAX_STEPS loop instead of interactive run