Lightweight AI agent framework with tool calling, memory, and a CLI — built for learning and production extension.
- 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
cp .env.example .env
pip install -r requirements.txt
python -m agent.cli "What is 25 * 17?"User Goal → Agent Loop → LLM decides tool or answer
↓
Tool Registry (calculator, fetch_url, get_time)
↓
Tool Result → back to LLM → Final Answer
| Tool | Description |
|---|---|
calculator |
Safe math evaluation |
get_current_time |
UTC timestamp |
fetch_url |
HTTP GET with text extraction |
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"}'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]"))MIT © almightymoon