From: aidotengineer

This article details the setup process for participating in interactive AI workshops, specifically focusing on the use of Docker and Jupyter Notebooks for local environment configuration and execution. The setup allows users to follow along with live coding examples and experiments with AI agents [00:00:10].

Prerequisites

To participate actively in the workshop, users should install Docker on their laptop [00:00:17]. While it’s possible to use pip for installation, Docker is recommended due to potential package management issues with pip [00:13:38]. The materials are also available online for later follow-along [00:01:31].

Workshop Setup Steps

The core of the workshop involves running a Jupyter Notebook client against a server provided via a Docker image [00:00:43].

1. Pull the Docker Image

The first step is to pull the specific Docker image for the workshop [00:00:24]. This step is crucial for setting up the server component [00:01:08].

2. Obtain the Jupyter Notebook

The workshop notebook is available via a link in the designated “workshops” Slack channel (e.g., workshops-leta) [00:00:28]. This link provides the notebook file that will be used for the interactive session [00:00:38]. The readme in the GitHub link also contains all the necessary commands [00:19:18].

3. Start the Leta Server

After pulling the Docker image, the next step is to start the Leta server. This is done by running a docker run command [00:16:26]. The command can be copied from the GitHub link or the Slack channel [00:16:31].

The Leta stack is open-source, built with Fast API, PostgreSQL, and Python logic [00:17:27]. The Docker container exposes an API that agents interact with [00:17:37]. For local setup, the server runs on localhost at the default port [00:22:29]. A free live endpoint is also available, meaning no keys are needed for the demo [00:16:50].

4. Clone the Repository and Navigate

Users need to clone the workshop repository and then cd into the specific example directory [00:19:30].

5. Run the Jupyter Notebook

Assuming Python is installed, the Jupyter Notebook command should be run. This automatically opens a browser tab with the notebook, which users can then double-click to open [00:20:30].

Client-Server Interaction

The notebook acts as a client, and the Docker image provides the Leta server [00:00:43]. Unlike frameworks where an agent is created in memory and passed to the server for completion (e.g., chat completions), Leta involves creating the agent on the server and then obtaining a handle to send messages without needing to track the full state client-side [00:22:53].

Troubleshooting

  • Directory does not exist: If encountering a “directory doesn’t exist” error during setup, perform an ls -R command to resolve it [00:18:21].
  • No Streaming: The “Leta Free” endpoint does not have streaming enabled [00:57:30].

Workshop Content Overview

The Jupyter Notebook session demonstrates basic concepts of AI agent memory and state management [00:11:43].

It covers:

  • Creating Agents: How to instantiate an agent on the Leta server [00:23:36].
  • Memory Blocks: The fundamental units of memory in a Leta agent, which are editable strings [00:23:24]. These can be rewritten by the agent itself [00:23:49].
  • Context Window Management: How Leta manages the LLM’s context window, allowing artificial capping of its length (e.g., to 10k tokens) to control costs and latency, even with long-running workflows [00:25:05]. This is more intelligent than simple recursive summarization [00:42:45].
  • Agent Reasoning: Every Leta agent comes with built-in reasoning (e.g., React style) [00:26:19].
  • Memory Tiers: Leta utilizes two tiers of memory:
    • Core Memory: High-level, in-context memory, akin to immediate human recall [00:29:55].
    • Archival/Recall Memory: Data sources outside the context window that the agent can “jog its memory” from, similar to semantic episodic memory [00:30:33]. Archival memory is a vector database by default [00:45:54].
  • Tool Calling: The system emphasizes tool calling, making the LLM aware of the context problem and providing tools to manage memory [00:12:11]. Tools are executed server-side and are sandboxed [00:29:17]. Custom tools can be written in Python [00:49:23], and agents can even manage other agents’ memory [00:49:50].
  • Multi-Agent Systems: Leta supports building multi-agent systems where agents can communicate via message passing through APIs, similar to human asynchronous communication [01:02:24]. Agents exist independently and maintain state, allowing them to be “detached” or re-grouped [01:02:05].