Skip to main content

Challenge 4: Build a Basic Agent

Here is the trick that makes Agent Week fun: you are going to use an agent (R-CLI or Studio) to build an agent (on the Backboard API).
Challenge 4: Build a Basic Agent background
Challenge

Challenge 4: Build a Basic Agent

Global Hack Week: Agent Week | Backboard.io

Time needed: 15 minutes
Difficulty: Medium. You will not hand-write code. You will direct an AI that writes it for you.
What you need: Challenges 1 to 3 done: a Backboard account with credits, your API key, and R-CLI or Backboard Studio installed.

WALKTHROUGH VIDEO HERE


The big idea

Here is the trick that makes Agent Week fun: you are going to use an agent (R-CLI or Studio) to build an agent (on the Backboard API).

Your job is not typing code. Your job is describing what you want, clearly, in plain English. The better your description, the better your agent. This is a real skill, and Challenges 5 and 6 crank it up, so treat this one as practice.

What you will end up with: a chatbot that runs on your computer, talks through the Backboard API, can use any model, and remembers you between runs. Memory is what separates an agent from a goldfish.

Helpful docs (your build agent knows how to read these too):


60 seconds of theory (worth it)

Backboard organizes everything into three layers:

  1. Assistant: the agent’s profile. Its name, its instructions (“you are a study buddy”), its tools. You make it once and reuse it.
  2. Thread: one conversation with that assistant. An assistant can have many threads.
  3. Message: one turn in a thread.
  4. Memory: facts Backboard extracts from conversations. Memories are stored on the assistant, so every thread shares them. New conversation, same brain.

Keep those four words handy. You are about to use them in your prompt.


Step 1: Set up your API key

Your agent-built code needs your Backboard API key (from Challenge 1). The safe way is an environment variable, which is a named value your computer holds so the key never gets pasted into code.

In your terminal (or Studio’s terminal):

export BACKBOARD_API_KEY="paste_your_key_here"

Note: this lasts until you close the terminal. To make it permanent, add that same line to the end of your shell config file (~/.bashrc on most Linux/WSL, ~/.zshrc on Mac), then open a new terminal.

Lost your key? Make a new one at app.backboard.io under Settings → API Keys.


Step 2: Make a project folder and start your build agent

mkdir my-first-agent
cd my-first-agent
backboard

(Studio users: create/open a my-first-agent folder in Studio instead.)


Step 3: Describe the agent you want

Paste this prompt into R-CLI or Studio. Read it first, because how it is written is the lesson:

Build me a command-line chatbot in Python that uses the Backboard API
(docs at https://docs.backboard.io). Requirements:

1. Use the official backboard-sdk pip package.
2. Read my API key from the BACKBOARD_API_KEY environment variable. Never
   hardcode it.
3. On first run, create an assistant named "Sidekick" with a fun, friendly
   personality via its system prompt, and save the assistant_id to a local
   file called sidekick.json so later runs reuse the SAME assistant instead
   of creating a new one.
4. Chat loop: I type a message, Sidekick replies, until I type "quit".
5. Send every message with memory="Auto" so Backboard saves and recalls
   facts about me automatically.
6. Each run should start a fresh thread but reuse the saved assistant, so
   memories carry over between runs.
7. Print the reply text only, keep the interface clean.
8. When it is built, run it, show me it works, and tell me exactly how to
   start it myself. 

Now watch your build agent work: it will install the SDK, write the script, run it, and fix anything that breaks. If it asks you a question, answer it. If it hits an error, tell it to fix it. You are the director here.

Why this prompt works (steal these habits for Challenges 5 and 6):

  • It names the exact tech (backboard-sdk, BACKBOARD_API_KEY, memory="Auto").
  • It numbers concrete requirements instead of vibes like “make it good.”
  • It explains the tricky bit (reuse the same assistant) AND why (memories carry over).
  • It defines “done”: built, run, demonstrated, with instructions.

Step 4: The memory test (this is the moment)

  1. Start your chatbot (however your build agent told you to, probably python sidekick.py).
  2. Tell it three facts: your name, what you are building this week, and something random like your favorite game.
  3. Type quit.
  4. Start it again. Fresh run, fresh thread.
  5. Ask: What do you remember about me?

If it recalls your facts across a restart, you have built a real, stateful agent. Congratulations. Most chatbots on the internet cannot do this.

You can even see the memories in the dashboard at app.backboard.io on the memory page, attached to your “Sidekick” assistant.

If the memory test fails: the usual culprit is creating a new assistant every run (memories live on the assistant). Tell your build agent: The bot is not remembering across runs. Make sure it reuses the saved assistant_id from sidekick.json and sends memory=“Auto” on every message. Let it debug itself.


Stretch goals (optional, for style points)

Ask your build agent to add any of these, one at a time:

  • Model switching: Add a /model command that lets me switch which model Sidekick uses mid-chat. (One API, 17,000+ models. Might as well use them.)
  • Web search: Send messages with web_search="Auto" so Sidekick can look things up when needed.
  • Streaming: Stream the replies word-by-word as they generate instead of waiting for the full response.
  • A tool: Give Sidekick a tool called get_time that returns the current time, using Backboard’s tool calling. (This is a preview of Challenge 5.)

How to complete this challenge

Submit a screenshot (or short screen recording) showing the memory test: your bot recalling facts after being restarted. Include the terminal so we can see the restart.

Crop out your API key if it appears anywhere.


Troubleshooting

Problem Fix
401 Unauthorized or “Invalid or missing API key” Your key is not reaching the code. Re-run the export BACKBOARD_API_KEY=... line in the SAME terminal you run the bot from.
Credit or billing errors Check your balance at app.backboard.io. No credits? Make sure you registered via app.backboard.io/hackathon with code GLOBALMLH2 (Challenge 1).
Bot forgets everything on restart See the memory test fix above: reuse the assistant_id, send memory="Auto".
Build agent goes in circles Stop it and restate the requirement more precisely. Small, specific instructions beat long vague ones.

Next up → Challenge 5: One-Shot an Agentic Workflow. Same tools, but now you get ONE prompt to build something that runs a whole multi-step job by itself. Start thinking about what you would automate.

Submissions are only open during the event.