WIP (maybe v1 will be ready in July 2026)


TOC

  • 1 AI “intelligence”. How real intelligence and AI work together.
  • 2 AI components. NNs, models, agents.
  • 3 AI projects. How to apply to real world problems.


1 AI “intelligence”


1.1 The human <> machine interface

This is perhaps the most important function of AI. The problem is AI token output starts to fool humans into believing AI is intelligent. These tokens ellicit thoughts in intelligent human (no explanation necessary or possible). For a NN these tokens are just a large set of large (FP) numbers. When you type a prompt into a chatbot, that prompt is converted into a lot of FP numbers. That is all the TF sees.


1.2 NNs are always passive; CPU-based agents are in control

A core lesson from the demos was that a NN is always passive. At least the NN part that does the pattern matching and statisical computation that passes for intelligence. An NN inputs data and outputs the (100% deterministic) result. Thats it. No control loop. In the end AI is simply an add-on to CPU-based systems.

Electronic agents still run the world, not electronic “NNs”
drones


1.3 NN and agent = Tweedledee and Tweedledum

A possible analogy for the NN and the agent are Tweedledee and Tweddledum from Alice in Wonderland. This analogy will help you assess where AI can be deployed successfully and how much effort system integration will cost (if AI was intelligent, you’d just plug AI into the system and finished).

An intelligent human (left) dealing with the robotic dynamic duo (right)
drones


1.4 Agentic AI higher level “thinking” is statistical probability

Agentic AI models have some pretty sophisticated abilities that really resemble higher level thinking. Planning is one of the most interesting. You send a complicated human language plan to a model and you get back a “sanitized” version that consists of basically plan steps that match a format you specified in your prompt to them model. But this is also statistical computation at work. The model TF only communicates with the internal agent via prompts. So the model must be trained specifically for such planning, and the internal agent must know the exact prompt “protocol” to use for maximum results. Basically the agent and TF and designed to work together to create the illusion of higher level thinking by only exchanging tokens.


2 AI components


The major components are shown in the diagram below.

  • 2 NNs (simple NN, CNN, TF)
  • 2b Models (with internal agent)
  • 3 Agents (external)


Major AI project components
drones


2 NNs

The NN is the core of AI “intelligence”. A NN provides a pattern matching algorithm. The the NN is controlled by Python code (“agent”).

  • #1 Tiny NN demo (D2ccc) (inference)
  • #2 Tiny NN demo (D2ccc) (training)
  • #3 AlexNet CNN (the defining architecture from 2012 and a good example to study)
  • #4 Tiny CNN demo (D4) (a good programming example)
  • #5 Tiny TF demo (D5) (hands-on demo)


#1 Tiny NN demo (demo D2ccc) (inference)

This one simple NN demo will give you an understanding of the core of all AI inference (including CNNs, LLMs TFs, etc). The following diagram shows the core components of the demo:

  • Encoder. All NNs only “know” numbers (including ChatGPT, Claude, etc). So if you have a dataset that is not (FP) numbers, it must be encoded (and later decoded).
  • NN. The source of “intelligence”. A UFA (universal function approximator).
    • This NN inputs 2 numbers. And based on that number outputs 2 probabilities. That’s it.
  • Decoder. Convert from a probability for inside/outside the circle to a binary state (1 or 0; inside/outside circle).

drones drones


#2 Tiny NN demo (demo D2ccc) (training)

Training input/output must match exactly what is desired in inference. The following code defines the training steps (more details later).

for epoch in range(100):
    logits = model(X)
    loss = loss_fn(logits, Y)
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()


#3 AlexNet CNN

This CNN was released in 2012. Its an important historical version to study, but too complicated to use as a hands on demo (most demos now abstract behind APIs much of the programming details that were required in 2012). Diagram from 2.2.1b D4 CNN algorithm details.

drones


#4 Tiny CNN (demo D4)

A hands on demo. Input a 28x28 pixel screenshot of a digit, and the NN outputs “0”, “1”, … “9”. For details see

The following code defines the NN.

class TinyCNN(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(1, 8, kernel_size=3, padding=1)
        self.conv2 = nn.Conv2d(8, 16, kernel_size=3, padding=1)
        self.pool = nn.MaxPool2d(2, 2)
        self.fc1 = nn.Linear(16 * 7 * 7, 64)
        self.fc2 = nn.Linear(64, 10)

drones drones


#5 Tiny TF (demo D5)

In D5 (diagram below):

  • Loop 1 inputs the letter “h” (T1) and infers (outputs) “e”.
  • Loop 2 inputs the letters “h”, “e” (T1,T2) and infers “l” (letter l).
  • The loop continues until the output is “hello world hello world hello world”.

The following code defines the NN.

class TinyTransformer(nn.Module):
    def __init__(self):
        super().__init__()
        self.token_embed = nn.Embedding(vocab_size, embed_dim)
        self.pos_embed = nn.Embedding(block_size, embed_dim)
        self.q = nn.Linear(embed_dim, embed_dim)
        self.k = nn.Linear(embed_dim, embed_dim)
        self.v = nn.Linear(embed_dim, embed_dim)
        self.ffn = nn.Sequential(
            nn.Linear(embed_dim, 64),
            nn.ReLU(),
            nn.Linear(64, embed_dim), )
        self.out = nn.Linear(embed_dim, vocab_size)

drones


2b Models (with API)

The agent and the NN are typically packaged into a model that has an API that makes it possible for existing software to access the model via API. The model code that controls the TF NN is the “internal agent” (iAgent).

- HF = stores/distributes NN/PT files
- Render/AWS/etc = runs API/eAgent code
- Client = calls eAgent/API

Example:
HF
 └── .pt file
Render
 └── FastAPI server
     ├── NN definition
     ├── downloads .pt from HF
     ├── iAgent/inference logic
     └── exposes /predict
Laptop client
 └── eAgent/client code calls Render API
AWS could do the same job as Render, but Render is simpler for your demos.


3 Agents

External agents access the model via API. This supports

  • reliable workflows built around models, tools, and automation.
  • tolerance of AI faults and unpredictable outputs


3b AI projects

“Spinning up” real-world projects quickly with minimal code analysis or manual coding (the final demo section in ZiptieAI).

drones


26.0615 (v1 26.0611)