
Build an automated GPT-4 with Rust to create an autonomous agent, auto jeopardy, that designs, tests, and runs a Rust web server with UTC time endpoints.
Developers with basic programming experience learn to build an AutoGPT code writing tool with Rust and GPT-4, pull code from GitHub, and debug across macOS, Linux, and Windows.
Explore Rust fundamentals to build an auto jeopardy agent with insights from instructor Sean McDonough, who combines 15+ years of coding, finance leadership, and data-driven crypto experience.
Join the Discord and the course Q&A to ask questions, share ideas, and connect with Rust and GPT-4 builders. Check the resources section for the Discord link.
Learn how to gain access to the GPT-4 API through OpenAI, set up billing, and measure and monitor costs while building an auto GPT tool in Rust using Actix Web.
Explore ai functions and llm limitations when building a rust and gpt-4 powered auto gpt tool. Discover how api functions ensure structured outputs and reduce latency, cost, and text injection.
Learn the Rust environment and fundamentals—from literals and vectors to generics and macros—then build an auto jeopardy agent with a fast Actix web server and OpenAI integration.
Install rust via rust-lang.org with the curl command, configure your shell, and verify cargo; choose nightly or stable with rustup for macOS or Windows.
Explore how rust up manages rust installation and tooling, update commands, toolchains, components, and locations of cargo and rustc to demystify Rust development.
Install and configure Visual Studio Code with Rust extensions to streamline Rust development. Use Rust Analyzer and crates plugins to understand types and work with Rust syntax effectively.
Create your first Rust function add_five that takes a u32 and returns a u32, then learn about mutability, printing values, and basic Rust tooling.
Compare Rust with Python, JavaScript, and others, and highlight typing, memory management, borrow checker, and idiomatic iterators for summing arrays.
Discover how to write unit tests in Rust, organize code with modules and public functions, and manage imports to structure a multi-file project.
Master Rust unit testing with cargo test, writing tests in module scope using cfg(test), asserting values, and using no-capture options to observe test output.
Learn to annotate Rust code with inline and doc comments, generate and view HTML documentation with cargo doc, and distinguish libraries from binaries for crates.io publication.
Create a Rust library project with cargo using --lib, run unit tests, document functions with doc comments, generate docs with cargo doc, and share crates on GitHub or crates.io.
Learn how to handle dead code and unused variables in Rust by using warnings, underscores, and procedural macros, then perform a final cleanse to optimize code.
Compare Rust with other languages by examining its statically typed language, ahead-of-time compilation, safe built-in concurrency, and memory-efficient performance for web servers via Webassembly with Actix Web.
Cover Rust data types—from f32 and f64 floats to booleans, chars, strings, arrays, vectors, tuples, options, results, and memory concepts like stack and heap, plus copy trait.
Explore how the stack and heap manage memory in Rust, including stack frames, allocation, the borrow checker, and the ownership system guiding strings and vectors.
Explore how stack frames handle variables like A, B, C, D, and E, tracing memory addresses, function calls, and drops in Rust with a hands-on example.
Explore how Rust stores data on the stack and heap, using fixed-size scalars, growable vectors, and strings, and learn how references relate stack to heap while previewing ownership and borrowing.
Understand how string literals reside in static memory and how dynamic strings live on the heap, with references on the stack. Learn Rust ownership and borrowing basics.
Explore Rust's ownership and borrowing model, including immutable references, single owner concept, and safe handling of dangling references across stack and heap memory.
Explore how immutable borrows and mutable references affect ownership in Rust, using strings S and T to show moving, borrowing, and mutating through mutable references and functions.
Discover how Rust uses dereference coercion to convert references into values, enabling seamless access and printing of actual data. Mutate through mutable references by dereferencing, changing the underlying value.
Understand how scope governs where variables exist in Rust, examining code blocks, loops, if/else, match, and closures with practical in scope vs out of scope examples.
Learn to expand your Rust skills by exploring enums, traits, generics, structs, lifetimes, asynchronous calls, pattern matching, and polymorphism, while creating and running a new cargo project in VS Code.
Explore fixed size variables in Rust by declaring constants stored in static memory, creating stack-allocated arrays, mutability, loops, booleans, f64, chars, and mapping over arrays to produce a new fixed-size array.
Explore creating string literals and dynamic strings on the heap in Rust, use string slices, and mutate vectors with insert, push, and pop while mastering ownership through borrow and move.
Learn how to convert a vector of characters into a string using iterators, for loops, and collect in Rust, printing hello world.
Demonstrate closures by defining a captured number in Rust and a closure that adds it to an input, then call it as a function and inspect scope.
Explore Rust number literals, including underscores for readability and hex, octal, and binary formats. Learn to use raw string literals to include quotes and JSON-like data, and print outputs.
Master low-level binary in Rust by working with binary literals, bitwise and/or/xor/not operations, bit shifts, and endianness (big and little) with hex representations.
Explore Rust's standard library, import collections like HashMap, and learn to use core types and box, while cargo adds Tokyo for external crates.
Explore Rust intermediate concepts such as enums, structs, traits, generics, and lifetimes, grounding them in ownership and borrowing. Learn to organize code into modules and unit tests with cargo test.
Explore how enums group related values under a single type in rust, with associated data, debug printing via derive, and a practical example creating and printing a blue car color.
Demonstrate enums with generics by building a check under five function that returns a generic result, using an ok and error variant, and relate to Rust’s built-in Result.
Create and test an option enum in Rust that returns either some remainder (an f32) or none, using generics and a modulus calculation to handle cases like arbitrage opportunities.
Explore Rust's built-in Result and Option types, replacing custom enums to handle success and error cases, and learn to work with Some, None, and extracting values in practical examples.
Learn to define your first struct, create a user with username, email, sign in count and active fields, enable debug printing, and prepare to add methods on the struct.
Explore how to mutate a Rust struct by using impl to add methods like increment_sign_in_count and change_email, and call them via mutable references to update username and email.
Explore how traits define a shared interface in Rust by implementing the attacker trait for a character enum, enabling polymorphism and flexible method calls.
Explore polymorphism and generics in Rust by implementing a trait for string references and address types to handle Ethereum addresses with ethers.
Explore lifetimes in Rust by examining ownership and borrowing to prevent dangling references, using references, scopes, and lifetime generics to manage memory safely.
Explore how lifetimes interact with generics in Rust. See generic functions and person structs with references, plus PartialOrd and lifetime annotations.
Explore pattern matching in Rust with the match statement, handling literals, option and result values, returning string slices, and using non-exhaustive patterns and if let techniques.
Master pattern matching on a mixed data enum in Rust, building a complex message enum and using match arms for quit, color, move, and text with printing.
Master pattern matching in Rust with match guards and struct patterns to extract x and y, evaluate conditions, and test axis-based locations using cargo test.
Learn to pull data from the web in rust by making asynchronous API calls with request and Tokyo, and parse JSON with Jason.
Learn how to map errors between libraries in rust, use question mark and map_error, and decode json with serde_json, while choosing safe error handling over unwrap or expect.
Explore hash maps and hash sets in Rust, enabling efficient key-value storage and fast lookups with insert, get, and contains operations; store and look up names.
See how to clean up a Rust project after experimentation by organizing modules into tests, removing unused imports, and keeping dead code only when purposeful, verified by cargo test.
Explore declarative macros in Rust using macro_rules, with captures for expressions and types, and see how vec and format macros work in practice.
Learn how to build a declarative macro in rust with repetition specifiers, captures, and macro_rules to create a vec-like macro that accepts multiple inputs and returns a vector.
Learn how derive procedural macros empower Rust structs with debug, serialize, deserialize, clone, and partial equality, and how to implement a custom derive using token streams, sin, and quote.
Explore attribute-like procedural macros and how a custom function to string turns a function into a string, yielding a token stream. Apply this approach to auto gpt workflows.
Build and test a procedural macro library that converts a function into a string for AI function calls, enabling an auto GPT workflow with Rust proc macro attributes.
Explore the box smart pointer to store values on the heap, enabling recursive linked nodes via Box::new and Option, with Some and None, and verify with cargo test and derive(Debug).
Explore reference counting in Rust using Rc and RefCell to share data without deep copies, enabling interior mutability via borrow_mut and observing how clones increment the reference count.
Explore how to avoid memory leaks and circular references in Rust by using Rc for shared ownership and Weak to break cycles, with RefCell for mutability.
Explore Rust concurrency by using mutexes and atomic reference counting to safely write to a shared file from multiple threads, preventing race conditions and ensuring thread-safe access.
Publish your rust proc macro to crates.io by logging in, preparing readme and docs, publishing versions with cargo publish, and importing with cargo add.
Explore Actix Web documentation to build a rest API with get and post routes, an asynchronous http server on port 8080, and hello and echo endpoints.
Build a Rust web server template with Actix web 4.3.1 to perform CRUD operations on a json-file database for a to-do app, including env vars, Cors, and async traits.
Define task and user structs with id, name, completed, username, and password; derive serialize, deserialize, debug, and clone; implement a database with hash maps for tasks and users and CRUD.
Implement a Rust in-memory database with a HashMap and CRUD operations, plus basic user handling, saved to and loaded from database.json as json using serde_json.
Implement app state with a mutex to safely guard shared database access in a multi-user web server, lock, unwrap, insert tasks from json, save to file, and return ok response.
Implement an asynchronous web server using actix-web, load or create a database, manage shared state with a mutex, and configure a cors-enabled rest api for creating tasks.
Test the rest api with postman by sending a json task to localhost:8080/task, receiving a 200 response on success, and observe database creation on the first request.
Implement a read_task function, fetch a task by id from the app state database's HashMap, and return the task as json or not found for a get request.
Implement complete task CRUD in a Rust server, exposing create, read all, read by ID, update, and delete endpoints with a JSON file database, and test via Postman.
Register and log in users using asynchronous Rust functions, JSON payloads, and post routes, backed by a file-based database for a fast, simple web server.
Apply a quick correction to avoid mutating the database by using immutable bindings like let for read tasks, including login, read all tasks, and read task, noted during GitHub upload.
Build and test a Rust actix web server with a REST API, create endpoints for CRUD or external data, and use a code template to guide an auto GPT.
Build a three-agent auto jeopardy system with a managing agent over a solutions architect and a back end developer. Enable AI function calls and format outputs for ChatGPT in Rust.
Prompt users via the command line, color the prompt blue with Cross-term, read and trim their input, and return the user request to drive the AutoGPT code writing tool.
Learn to build an auto gpt code writing tool in rust by structuring OpenAI chat messages with roles and content, and sending requests to the GPT-4 completions API.
Configure a Rust OpenAI client by setting authorization headers with the API key and organization, build a client with headers, and send a GPT-4 chat completion with messages and debugging.
Write an asynchronous Rust test to call the OpenAI API, building a vector of user messages and invoking GPT-4 chat completion for a short response.
Implement robust error handling for OpenAI calls by retrying failed requests. Use box<dyn std::error::Error + Send> and map_error to return a flexible error type and enable retries.
Map OpenAI chat results to our rust struct, post json to the API, parse choices to extract content, and validate via cargo test, enabling a GPT four based tool.
Learn to create and organize AI functions in Rust, using procedural macros to convert function definitions into OpenAI prompts, and structure modules for architect, backend, and managing agent.
Visualize agent activity by printing color-coded messages to the command line, showing when agents call large language models, run unit tests, or raise issues.
Develop a reusable asynchronous task function that calls a large language model (GPT-4) with message context and agent position and operation metadata, extending and logging flow, retrying on failure.
Decode AI task responses by returning a deserialized struct from a JSON string using serde_json and serde. Create a decoded version of the function for readability and reduced duplication.
Implement an async function to validate an api endpoint by issuing a get request with a request library, then await the response and return the status code as a u16.
Implement read and write functions to extract a code template, feed it to a language model, and save updated back-end code and API schemas in a Rust project.
Introduce the three core agents—managing agent, solutions architect, and back end developer—built in Rust, sharing a fact sheet and API schema to guide project work.
Define a basic_agent struct and agent_state enum (discovery, working, unit_testing, finished) and implement basic_traits to manage objective, position, and memory as a vector of messages.
Create a fact sheet struct in Rust to store project description, scope, external URLs, back-end code, and API endpoint schema for managing agents.
Define a special functions trait for agents, enabling the managing agent to store, access attributes, and trigger asynchronous execution using a shared fact sheet.
See how a solutions architect calls external URLs, defines project scope, and updates the fact sheet, printing site URLs and producing a vector of strings to guide unit testing.
Implement asynchronous functions for the solution architect agent, drive a discovery state loop to fetch project scope, handle external URLs, and transition to unit testing or finished.
Perform unit tests to verify external URLs respond with a 200 status, exclude faulty endpoints, and validate URL discovery from factsheet while logging test details.
Write unit tests for the solutions architect agent, initialize a fact sheet with a project description, determine crud and external URL needs, then execute the agent and validate results.
Define a simple managing agent that holds other agents, uses crates to convert user input to a goal, and builds a project description and fact sheet for execution.
Add agents to a boxed dynamic trait, then run the project asynchronously by iterating over them with a mutable fact sheet.
Copy and adapt the managing agent test, instantiate a managing agent from a user request, run cargo test, and debug the agent factsheet to verify scope and URLs.
Develop back end agents by implementing code templates and reading and writing files. Track bugs and bug counts, improve initial back end code, and generate rest API endpoints schema.
Explore backend development practices to auto fix bugs and extract API endpoints, as the tool tests and rewrites code using print fixed code, broken code, and structured endpoint outputs.
Develop rest API endpoints by importing executable main contents, implementing an async function to extract code as a string, and generating a json schema for testing.
Explore designing a backend agent with discovery and working states, implementing async functions. Transition through discovery, working, and unit testing stages while addressing bugs and code improvements.
Build and test a backend developer agent in rust using cargo test and asynchronous unit tests, generating a json fact sheet and debugging through web template mutations.
Implement AI safety checks in a Rust and GPT-4 based code tool by prompting user to review and confirm safe code before executing generated code.
Automate backend cargo builds and unit tests by scripting cargo build in a web server project, piping output, handling errors, tracking bug counts, and looping until tests pass.
Extract and test rest api endpoints, convert them with serde_json, filter static get endpoints, then run the backend with cargo run and launch server tests.
Automate backend endpoint testing against a local server, spawning cargo run, building a timeout-enabled client, and verifying each endpoint returns a 200 status code with clear error handling.
Execute unit tests to verify the backend agent, adjust agent state, and run cargo test to build, launch the web server, and validate rest API endpoints such as /task.
Explore testing and rewriting backend code with ai, validate rest api endpoints and unit tests, handle chrono library constraints, and push a working backend to GitHub.
This lecture demonstrates a rust-based auto gpt system where a gpu solutions architect and a back end developer build, test, and safely run a web server from a website scope.
Explore how a self-writing agent is human-tested to evaluate forex price retrieval via a get route, app state caching, and error handling, including api key failures and unwrap behavior.
Execute the cross-platform auto jeopardy binary to run a second test, producing a CRUD-based tracking website for AI course assignments with AI-generated backend code and an API schema.
Build and test a hangman game on a Rust-based web server, generating a game state with CRUD endpoints, iterative code fixes, and rest API endpoints for a frontend.
Perform a human test of the web template to verify start and move post endpoints, using a dynamic id, postman calls, and database tracking to simulate a hangman game.
Analyze limitations of auto gpt deployments, refine scope and discovery, and implement tooling, memory storage, and testing across back end and potential front end agents, while highlighting Rust's performance.
Explore the next steps in mastering Rust and automated general pretrained transformers, and join Code Raiders and Crypto Wizards communities for updates, courses, and discussions.
Develop a an automated ChatGPT agent which not only writes code, but tests and re-write code for you. In fact, you can request your agent to do just about anything.
By going through this course, you will not only learn and master Rust from A-Z, but you will also have extensive knowledge in how to build your very own AutoGPT.
The name of the AutoGPT we build together will be Auto-Gippity.
Auto-Gippity will simply be given a task, which it will break down and delegate to other agents to complete. Each agent will be responsible for testing its own output.
Our test piece will be to build an agent that writes a web server given a template. It will write the code in Rust. Not only that, but we will write the agent, that writes Rust code...in Rust. Fantastic. What a time to be a developer.
AutoGPTs will only continue to become extremely relevant and highly sought after and combining these with the worlds favourite programming language, Rust, means that we can build an application which is blazingly fast, memory-safe, modern and robust.
Right now, there is a window of opportunity to learn this fantastic and uncommon technology before it takes over in software engineering.
Just think, you could build an AutoGPT that say, develops full stack SAAS websites end-to-end. With technologies like GPT-4 and soon beyond, such agents will only continue to improve in their performance.
Companies are looking for developers who can build such tools and SAAS startups have a window to be first. If you are curious as to how you can connect new AI technologies to change the world then THIS is the course for you.
You will learn:
How to work with the Open AI API and the GPT-4 API using Rust
How to master rust from A to Z, progressing from beginner, to intermediate, to advanced and beyond
How to build AI functions (special functions that extract a desired response from large-language-models)
How to develop a web server template (including an introduction to web servers) using Actix Web
How to build an Automated GPT agent (Auto-Gippity) which writes code, that executes and tests code. If the code is wrong, it will simply re-write it and test again
We are truly excited to see what you develop, so make sure you share your application with the world.
See you in class!
Shaun