Lesson 5 — How to Build a Brain
Learning Outcome: Assemble model, memory, orchestrator, and interface into a working architecture; understand how modular intelligence operates through the Foundry loop.
Manual
The Architecture of Awareness
To build a brain is to weave continuity between model, memory, orchestrator, and interface. Each plays a role: the model reasons, the memory recalls, the orchestrator decides what to do next, and the interface makes thought communicable. Together they form a system that learns from its own learning.
1 · Modular Principle
No single model contains intelligence. A real system is modular—many specialized parts coordinated by an orchestrator. Think of perception, reasoning, and language as independent tools synchronized toward purpose.
2 · Memory
A brain without memory is pure reaction. Synthetic memory lives in vector databases, where every document becomes an embedding. Similarity search retrieves context; context anchors continuity.
3 · Retrieval and Orchestration
The orchestrator mediates between memory and model:
- receives a query,
- retrieves relevant chunks (
/search), - builds a context window,
- sends it to the model (
/respond).
This loop converts static data into live reasoning.
4 · Self-Model and Interface
To operate autonomously, the system must represent itself—its goals, tools, and limits. That representation lives in metadata: a schema describing "who I am" and "what I can do." The interface exposes this self-model to the world.
Workshop
Hands-On: Build a Mini-Brain with the Foundry Loop
Goal: connect memory + model + interface using the Foundry APIs.
Agent architecture builder placeholder
(Full interactive demo available at brainfoundry.ai)
Manual Steps (curl)
1️⃣ Ingest content
curl -X POST /api/foundry/embed \
-H "Content-Type: application/json" \
-d '{ "doc_id": "lesson5-demo", "content": "Knowledge about building small brains.", "metadata": {"lesson":"5"} }'2️⃣ Query the brain
curl -X POST /api/foundry/search \
-H "Content-Type: application/json" \
-d '{ "query": "How does memory connect to orchestration?", "k": 3 }'3️⃣ Generate a response
curl -X POST /api/foundry/respond \
-H "Content-Type: application/json" \
-d '{ "query": "How does memory connect to orchestration?", "context": "<PASTE returned chunks here>" }'Each endpoint corresponds to one organ of the synthetic brain:
/embed→ encode perception/search→ recall memory/respond→ reason and speak
Reflection
Reflection — The Ecology of Function
Which part of your own thinking acts as memory, which as orchestrator? Write a short map (3–5 sentences) describing how you decide what to recall, what to reason, and when to speak. Note where feedback reshapes that flow.