# AI agents gain autonomy through 'tool use' - giving LLMs access to external systems like databases, APIs, and code execution

**Date:** 2025-12-18  
**Tags:** AI, Agents, LLM  
**URL:** https://kelexine.is-a.dev/til/agentic-ai-tool-use

---

TIL: AI agents gain autonomy through 'tool use' - giving LLMs access to external systems like databases, APIs, and code execution. The key architectural pattern is a planning loop: the agent reasons about the goal, selects a tool, executes it, observes results, and iterates until the task is complete.


```python
# Core agent loop pattern
while not goal_achieved:
    observation = gather_context()
    thought = llm.reason(goal, observation)
    action = select_tool(thought)
    result = execute_tool(action)
    memory.append({thought, action, result})
```




---

*This content is available at [kelexine.is-a.dev/til/agentic-ai-tool-use](https://kelexine.is-a.dev/til/agentic-ai-tool-use)*
