Skip to content

almightymoon/llm-agent-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Agent Starter

Lightweight AI agent framework with tool calling, memory, and a CLI — built for learning and production extension.

CI License: MIT

Features

  • Tool calling — Agents invoke Python functions (calculator, datetime, HTTP fetch)
  • ReAct loop — Reason → Act → Observe until task complete
  • Memory — Conversation history across turns
  • OpenAI-compatible — Works with OpenAI, Ollama, vLLM, Azure OpenAI
  • CLI + API — Interactive terminal or FastAPI endpoint

Quick Start

cp .env.example .env
pip install -r requirements.txt
python -m agent.cli "What is 25 * 17?"

Architecture

User Goal → Agent Loop → LLM decides tool or answer
                ↓
         Tool Registry (calculator, fetch_url, get_time)
                ↓
         Tool Result → back to LLM → Final Answer

Built-in Tools

Tool Description
calculator Safe math evaluation
get_current_time UTC timestamp
fetch_url HTTP GET with text extraction

API

uvicorn agent.api:app --reload
curl -X POST http://localhost:8000/run -H "Content-Type: application/json" \
  -d '{"task": "Summarize what FastAPI is from https://fastapi.tiangolo.com"}'

Extend with Custom Tools

from agent.core import Agent, tool

@tool("lookup_user", "Find user by email")
def lookup_user(email: str) -> str:
    return f"User found: {email}"

agent = Agent(tools=[lookup_user])
print(agent.run("Find user [email protected]"))

License

MIT © almightymoon

About

Lightweight LLM agent with tool calling, ReAct loop, CLI and API

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages