::: title

LM01 Introduction

Building Agentic AI Applications ::: César Freire

::: image
ai-future.jpeg
:::



A Simple Neural Network (ML)


How a RNN Works

One shared cell, unrolled over time: input updates a hidden state that carries memory to the next step — the ancestor of the attention mechanism in Transformers.
https://playground.tensorflow.org/


How an LLM Works


Tokens: How Text Is Cut Into Pieces

(Try it yourself: platform.openai.com/tokenizer)

  • Common English words are single tokens —
    "The capital of France is" → [The] [ capital] [ of] [ France] [ is] = 5 tokens
  • Longer or rarer words are split into pieces —
    "unbelievable" → [un] [believ] [able] · "Tokenization" → [Token] [ization]
  • Non-English text and numbers cost more tokens —
    "こんにちは" → 4+ tokens · "1234567890" → [123] [456] [7890] · "🚀" → 2–3 tokens

Rule of thumb: in English, 1 token ≈ 4 characters ≈ ¾ of a word — token counts drive both API cost and the context-window limit.


C4 (Colossal Clean Crawled Corpus)

https://commoncrawl.org
img-20260927-230966.png


Closed-Source vs Open-Source Models

APIs rent the intelligence; open weights own it. Prototype on APIs, self-host when privacy or cost per token wins.


llama.cpp (build c++; faster)

img-20260927-230978-1.png


Ollama (local models)

img-20260927-230978.png


Hugging Face (home of models)

img-20260927-230903.png


Openrouter

img-20260927-230916-1.png


How Agentic AI Works

The LLM is the brain, tools are the hands, memory is the notebook — and the loop is the autonomy.


From LLM to Agent: What Changes

CapabilityPlain LLMAgentic Application
ReasoningSingle prompt responseMulti-step, chain-of-thought, reflection
GroundingTraining data (+ context)Live data via tools (search, DBs, APIs)
ExecutionSuggests an answerPerforms the task
Error handlingUser retriesSelf-critique and retry loops
Example”Write me an email”Drafts, sends, follows up on replies

How Multi-Agent Systems Work

An orchestrator decomposes the goal, specialist agents work in parallel with their own tools, and shared memory keeps them in sync.


No-Code Agents

Trigger → AI block → action, wired on a canvas. Same agent concepts — LLM, tools, memory, approvals — with zero code.


No Code agents examples


Global layoffs 2026

img-20260927-230970.png


Open Tech Jobs 2026

img-20260927-230916.png


pi - simple agent

img-20260927-230931.png


Kilocode (vscode extension)

img-20260927-230927.png


Github copilot

img-20260927-230902.png


Hermes agent

img-20260928-000965.png


Opencode

img-20260928-000985.png


Demo: Agent pi

Setup (Windows & Linux): install Ollama and pull a model, then point pi at it.

# both platforms (ollama)
ollama 

img-20260928-210966.png


Example 1 — Generate a small script on demand

Have pi create and run a script from scratch (safe, self-contained):

# Linux
pi "Create a bash script disk-report.sh 
in the current directory that prints disk 
usage of the current folder, make it executable and run it"
 
# Windows (PowerShell)
pi "Create a PowerShell script in the current directory 
disk-report.ps1list that prints the size of each subfolder 
in the current directory and run it"

—

Example 2 — Help create files

# Linux
pi "How can login into this computer using /etc/passwd"
 
# Windows (PowerShell)

Tip: to force the Ollama model explicitly, prefix the run with the model env var, e.g.
OLLAMA_MODEL=llama3.2 pi "..." (Linux/macOS) or $env:OLLAMA_MODEL="llama3.2"; pi "..." (Windows).