Build Your First Open-Source AI Agent in Python (MIT License)

Have you ever wanted to build your own AI agent but thought you needed to be a professional developer? Good news: with misco-agent you can start right away. https://github.com/JoaquinRuiz/misco-agent

I created misco-agent, an open-source (MIT licensed) Python template that anyone can use and modify freely. This is your gateway to learning how to integrate AI into your daily workflow.

In early 2025 I discovered the concept of vibe coding and went down the rabbit hole of AI-first development. From there, I explored MCP (Model-Centric Programming) and AI agents. What I missed was a simple, plug-and-play project to start experimenting. That’s why I built misco-agent.

It’s designed for beginners and professionals: clear, minimal, and extensible. Perfect if you want to learn how to orchestrate tools with AI models — no advanced programming knowledge required.

🧩 What’s inside?

  • 🕹️ Orchestrator Layer (misco_app.py)
    Manages the conversation loop, decides when to use a tool, and sends results back to the model.
  • 🔧 Tooling Layer (misco_tools.py)
    Already comes with two simple tools:
  • misco_calculator → safe arithmetic evaluator
  • misco_notes → save and list your own notes locally
    You can add your own misco_tools in just a few lines.
  • 🧠 Model Layer
    Compatible with OpenAI, OpenRouter, or even Ollama running locally (llama3.1, etc.).
  • 📜 Governance Layer (prompts/misco_system.md)
    Defines the agent’s personality, safety rules, and how it should use the tools.

🚀 Quick Start Guide

  1. Clone the repo
    git clone https://github.com/your-username/misco-agent.git
    cd misco-agent
  2. Create a virtual environment
    python -m venv .venv
    source .venv/bin/activate # macOS/Linux
    or: .venv\Scripts\activate (Windows)
  3. Install dependencies
    pip install -r requirements.txt
  4. Set up your environment variables
    Copy .env.example to .env and edit it with your keys:
    MISCO_BASE_URL=https://api.openai.com/v1
    MISCO_API_KEY=your_api_key_here
    MISCO_MODEL=gpt-4o-mini

    👉 If you prefer local models (e.g. running in Spain or on your own machine), you can use Ollama with:
    MISCO_BASE_URL=http://localhost:11434/v1
    MISCO_MODEL=llama3.1
  5. Run the agent
    python misco_app.py
  6. 💡 Example prompts
  7. Once running, try:

💡 Example prompts

Once running, try:

Calculate 12*(3+7)/2 → uses misco_calculator.

Add a note: buy milk → saves a note in misco_notes.json.

List my notes → shows all saved notes.

📚 Want to go deeper?

Alongside this project, I’ve just published my book:

“Programming with Artificial Intelligence” (200 pages) https://a.co/d/hjy6HiX

In it, I share everything I’ve learned since discovering vibe coding — from how to integrate AI into your workflow, to building MCP-based agents, setting up tools, contexts, rules, and automations.

It’s already getting amazing feedback from readers, and I couldn’t be happier 🙌.
If you’d like to learn more and explore practical AI coding frameworks, check out the book!

In:

5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x