Coding AI agent using Pydantic AI's Direct API for minimal abstraction. Features 9 file system tools and interactive terminal interface.
# Codantic AI - Educational AI Agent Loop
> **For Educational Purposes Only** - Learn AI agent architecture with minimal abstractions
A Python AI agent system using **Pydantic AI's Direct API** for maximum learning clarity. Built with Google Gemini and featuring 9 file system tools.
## 🧠 **Why This Approach?**
Uses `pydantic_ai.direct.model_request_sync()` - minimal abstraction perfect for learning:
- **🔍 See exactly** how LLM interactions work
- **📚 No magic** - every API call is explicit
- **🛠 Direct control** over context and tool calling
## 🎬 **Live Demo**

## 🛠 **9 Built-in Tools**
| Tool | Description |
|------|-------------|
| `read` | Read files with optional line limits |
| `write` | Create files with audit logging |
| `edit` | String replacements in files |
| `multiedit` | Multiple edits atomically |
| `ls` | List directory contents |
| `glob` | Pattern-based file search |
| `grep` | Regex search in file contents |
| `bash` | Execute shell commands |
| `todo` | Task management |
## 🚀 **Quick Start**
### Prerequisites
- Python 3.13+
- Google Claude API key ([Get one here](https://ai.google.dev/))
### Installation
```bash
git clone <your-repo-url>
cd codantic-ai
# Setup environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# OR: uv sync
# Configure API key
cp .env.example .env
# Edit .env and add your Claude API key
# Run the agent
python main.py
```
## 🏗 **How It Works**
```mermaid
graph TB
A[👤 User Input] --> B[🔄 AgentLoop]
B --> C[🤖 Pydantic AI Direct API]
C --> D{🛠 Tool Calls?}
D -->|Yes| E[⚡ Execute Tools]
E --> B
D -->|No| F[💬 Response]
```
### Key Learning Points
```python
# Direct API usage - no hidden abstractions!
model_response = model_request_sync(
self.model_name,
self.context, # Full conversation history
model_request_parameters=ModelRequestParameters(
funGoogle's AI-powered research notebook that ingests your documents and becomes an expert on your content. Generates audio overviews, study guides, FAQs, and interactive discussions from uploaded sources.
Google DeepMind's experimental AI agent that can navigate websites, fill forms, and complete multi-step browser tasks autonomously. Uses Gemini's multimodal understanding to interact with web interfaces.
Google DeepMind's universal AI assistant prototype that can see, hear, and respond in real-time through your device camera and microphone. Demonstrates the future of multimodal AI interaction.
Google Cloud's enterprise platform for building, deploying, and managing AI agents powered by Gemini. Supports multi-agent orchestration, tool integration, and enterprise governance.
Gemini's agentic research capability that autonomously browses the web, synthesizes information from dozens of sources, and produces comprehensive research reports on any topic.
Interactive coding and content creation agent that generates, previews, and iterates on code, documents, and interactive applications in a side panel. Supports HTML/CSS/JS, Python, and more.