Build a Tiny RAG Application
Retrieve document context, ask Ollama for a grounded answer, cite the source, and refuse unsupported questions.
What you'll build
Before You Build
2 quick questions. This is diagnostic only — it does not block the lesson.
What happens before generation in RAG?
Why cite the source?
Mission
Retrieve document context, ask Ollama for a grounded answer, cite the source, and refuse unsupported questions.
Understand
Retrieval-augmented generation joins two operations: deterministic retrieval finds evidence, then the model answers using only that evidence.
Build
Create rag.py, save it, then test a grounded answer and an honest refusal.
Running both paths proves the app uses evidence instead of inventing unsupported facts.
~/enjyra-free-ai.mkdir -p app
touch app/rag.py
code app/rag.pymkdir -p app
touch app/rag.py
code app/rag.pyNew-Item -ItemType Directory -Force -Path "app" | Out-Null
if (-not (Test-Path "app\rag.py")) { New-Item -ItemType File -Path "app\rag.py" | Out-Null }
code "app\rag.py"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Python 3 is installed; activate .venv first when the lesson has already created it.
- Visual Studio Code is installed; the optional code shell command is available, or you can open the file manually.
Why You're Running This
app/rag.py is the project’s python file at ~/enjyra-free-ai/app/rag.py. It must exist before you can paste the supplied content. The commands create its folder when needed, create the file, and open it in VS Code; the next stage tells you what to paste and reminds you to save it.
Command Breakdown
mkdir -p / New-Item Directory- Creates the requested folder and any missing parent folders without failing when it already exists.
touch / New-Item File- Creates an empty file at the requested path without requiring code to exist first.
code- Opens the file or folder in Visual Studio Code from the terminal.
Expected Result
app/
└── rag.py
app/rag.py exists and is ready for the supplied content.What Changed
Beforeapp/rag.py may not exist yet, or may still contain its previous content.
Afterapp/rag.py now exists in the lesson workspace and is ready for the next instruction.
Verify It
macOSls -l app/rag.py
Linuxls -l app/rag.py
Windows PowerShellGet-Item "app\rag.py"
Confirm the file exists at the expected path.
If It Fails
- Check that the terminal is in the lesson project, the path spelling is exact, and VS Code is installed. If the code command is unavailable, use File → Open Folder in VS Code.
If code is unavailable, open VS Code, choose File → Open Folder, select enjyra-free-ai, then create app/rag.py in the Explorer.
app/rag.py.from pathlib import Path
import os
import requests
from documents import load_chunks, search
STOP_WORDS = {"a", "an", "and", "are", "can", "how", "in", "is", "of", "the", "to", "what"}
def meaningful_words(value: str) -> set[str]:
return {word.strip(".,?!:;\"'").lower() for word in value.split()} - STOP_WORDS
def answer(question: str) -> str:
source, context = search(load_chunks(Path("docs")), question)[0]
overlap = meaningful_words(question) & meaningful_words(context)
if not overlap:
return "I don't have enough information in the provided documents."
prompt = f"Answer only from CONTEXT. If unsupported say you do not have enough information.\nCONTEXT: {context}\nQUESTION: {question}"
url = os.getenv("OLLAMA_URL", "http://localhost:11434")
response = requests.post(f"{url}/api/generate", json={"model":"llama3.2:3b","prompt":prompt,"stream":False}, timeout=120)
response.raise_for_status()
return f"{response.json()['response'].strip()}\nSource: {source}"
if __name__ == "__main__":
import sys
print(answer(" ".join(sys.argv[1:]) or "How many holiday days can employees carry over?"))
Save before continuing: press Cmd + S on macOS or Ctrl + S on Linux and Windows.
cat app/rag.pycat app/rag.pyGet-Content "app\rag.py"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Reading app/rag.py back from disk proves that the python content was saved at the correct path, rather than remaining only in an unsaved editor tab.
Command Breakdown
cat / Get-Content- Reads the saved file and prints its contents so you can verify it.
Expected Result
The terminal prints the complete content you pasted into app/rag.py.What Changed
BeforeThe current state has not yet been checked.
AfterNo persistent state changed; the command printed evidence you can compare with the expected result.
Verify It
macOScat app/rag.py
Linuxcat app/rag.py
Windows PowerShellGet-Content "app\rag.py"
Run the command and compare its output with the Expected Result block.
If It Fails
- Save the file, confirm the filename and capitalisation, and check the current folder with pwd on macOS/Linux or Get-Location on Windows.
If it fails
Check that your terminal is in ~/enjyra-free-ai, the filename and capitalisation match exactly, and the file was saved. Use pwd on macOS/Linux or Get-Location on Windows to check your current folder.
cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "How many holiday days can employees carry over?"cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "How many holiday days can employees carry over?"Set-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\rag.py "How many holiday days can employees carry over?"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Running the program proves that the saved code and its local dependencies work together.
Command Breakdown
cd / Set-Location- Changes the terminal’s current working directory before the next command runs.
.- Runs the . tool with the shown arguments to complete this lesson step.
python- Runs the selected Python module or script with the supplied arguments.
activate- Makes the project’s virtual environment the active Python environment for this terminal session.
&&- Runs the next command only when the previous command succeeds.
Expected Result
Employees may carry over up to five unused days.
Source: handbook.txt
The answer is grounded and names its source; wording may vary.What Changed
BeforeThe saved program has not yet been executed for this verification step.
AfterThe program ran and produced output or started the local process described by the lesson.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- No such file or directory → verify the current folder and the path spelling.
- Permission denied → work inside your own lesson folder and confirm it is writable.
Employees may carry over up to five unused days.
Source: handbook.txtIf it fails
command not found → verify the required tool is installed and reopen the terminal.No such file or directory → check your current folder with pwd or Get-Location.Permission denied → confirm the lesson workspace is writable.cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "What is the CEO favourite colour?"cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "What is the CEO favourite colour?"Set-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\rag.py "What is the CEO favourite colour?"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Running the program proves that the saved code and its local dependencies work together.
Command Breakdown
cd / Set-Location- Changes the terminal’s current working directory before the next command runs.
.- Runs the . tool with the shown arguments to complete this lesson step.
python- Runs the selected Python module or script with the supplied arguments.
activate- Makes the project’s virtual environment the active Python environment for this terminal session.
&&- Runs the next command only when the previous command succeeds.
Expected Result
I don't have enough information in the provided documents.
The application refuses a question unsupported by the documents.What Changed
BeforeThe saved program has not yet been executed for this verification step.
AfterThe program ran and produced output or started the local process described by the lesson.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- No such file or directory → verify the current folder and the path spelling.
- Permission denied → work inside your own lesson folder and confirm it is writable.
I don't have enough information in the provided documents.If it fails
command not found → verify the required tool is installed and reopen the terminal.No such file or directory → check your current folder with pwd or Get-Location.Permission denied → confirm the lesson workspace is writable.app/rag.py exists and handles supported and unsupported questions.
Break
docker stop enjyra-v6-local-ai-02 && cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "holiday carry over"docker stop enjyra-v6-local-ai-02 && cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "holiday carry over"docker stop enjyra-v6-local-ai-02
Set-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\rag.py "holiday carry over"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Docker Desktop or Docker Engine is running.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Running the program proves that the saved code and its local dependencies work together.
Command Breakdown
docker- Runs the docker tool with the shown arguments to complete this lesson step.
cd / Set-Location- Changes the terminal’s current working directory before the next command runs.
.- Runs the . tool with the shown arguments to complete this lesson step.
python- Runs the selected Python module or script with the supplied arguments.
activate- Makes the project’s virtual environment the active Python environment for this terminal session.
&&- Runs the next command only when the previous command succeeds.
Expected Result
Connection refused
Retrieval can work while generation fails because Ollama is unavailable.What Changed
BeforeThe saved program has not yet been executed for this verification step.
AfterThe program ran and produced output or started the local process described by the lesson.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- No such file or directory → verify the current folder and the path spelling.
- Permission denied → work inside your own lesson folder and confirm it is writable.
- Docker daemon not running → start Docker Desktop or Docker Engine, then retry.
Connection refusedIf it fails
command not found → verify the required tool is installed and reopen the terminal.No such file or directory → check your current folder with pwd or Get-Location.Permission denied → confirm the lesson workspace is writable.Debug
cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/documents.py && docker ps -a --filter name=enjyra-v6-local-ai-02cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/documents.py && docker ps -a --filter name=enjyra-v6-local-ai-02Set-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\documents.py
docker ps -a --filter name=enjyra-v6-local-ai-02Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Docker Desktop or Docker Engine is running.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
This checks the current state without changing it, so you can verify the previous action worked.
Command Breakdown
cd / Set-Location- Changes the terminal’s current working directory before the next command runs.
.- Runs the . tool with the shown arguments to complete this lesson step.
python- Runs the selected Python module or script with the supplied arguments.
docker ps- Inspects or interacts with local Docker state without using a cloud service.
activate- Makes the project’s virtual environment the active Python environment for this terminal session.
&&- Runs the next command only when the previous command succeeds.
Expected Result
handbook.txt ... / Exited
The evidence isolates generation runtime from retrieval data.What Changed
BeforeThe current state has not yet been checked.
AfterNo persistent state changed; the command printed evidence you can compare with the expected result.
Verify It
macOScd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/documents.py && docker ps -a --filter name=enjyra-v6-local-ai-02
Linuxcd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/documents.py && docker ps -a --filter name=enjyra-v6-local-ai-02
Windows PowerShellSet-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\documents.py
docker ps -a --filter name=enjyra-v6-local-ai-02
Run the command and compare its output with the Expected Result block.
If It Fails
- No such file or directory → verify the current folder and the path spelling.
- Permission denied → work inside your own lesson folder and confirm it is writable.
- Docker daemon not running → start Docker Desktop or Docker Engine, then retry.
handbook.txt ... / ExitedIf it fails
command not found → verify the required tool is installed and reopen the terminal.No such file or directory → check your current folder with pwd or Get-Location.Permission denied → confirm the lesson workspace is writable.Improve
Use stronger tokenization and embeddings later. The key contract remains: retrieve evidence, constrain the prompt, cite the source, and refuse unsupported claims.
Verify
docker start enjyra-v6-local-ai-02 && cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "holiday carry over"docker start enjyra-v6-local-ai-02 && cd ~/enjyra-free-ai && . .venv/bin/activate && python3 app/rag.py "holiday carry over"docker start enjyra-v6-local-ai-02
Set-Location $HOME\enjyra-free-ai
.\.venv\Scripts\Activate.ps1
py app\rag.py "holiday carry over"Before You Run
- Your terminal is open in ~/enjyra-free-ai.
- Docker Desktop or Docker Engine is running.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Running the program proves that the saved code and its local dependencies work together.
Command Breakdown
docker- Runs the docker tool with the shown arguments to complete this lesson step.
cd / Set-Location- Changes the terminal’s current working directory before the next command runs.
.- Runs the . tool with the shown arguments to complete this lesson step.
python- Runs the selected Python module or script with the supplied arguments.
activate- Makes the project’s virtual environment the active Python environment for this terminal session.
&&- Runs the next command only when the previous command succeeds.
Expected Result
Source: handbook.txt
Grounded generation succeeds again.What Changed
BeforeThe saved program has not yet been executed for this verification step.
AfterThe program ran and produced output or started the local process described by the lesson.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- No such file or directory → verify the current folder and the path spelling.
- Permission denied → work inside your own lesson folder and confirm it is writable.
- Docker daemon not running → start Docker Desktop or Docker Engine, then retry.
Source: handbook.txtIf it fails
command not found → verify the required tool is installed and reopen the terminal.No such file or directory → check your current folder with pwd or Get-Location.Permission denied → confirm the lesson workspace is writable.Challenge
Repeat the verification from a fresh terminal and explain which observable signal proves each dependency is healthy.
Ship
A tiny RAG application that answers from your files and admits when evidence is missing.
Next Step
Continue to Lesson 08: Dockerise and Debug Your AI App.
Before You Start the Lab
Confirm your machine has everything required for this lesson. Continue only when the verification commands succeed.
This lesson needs
Docker setup
Docker not installed? Show setup instructions ▾
- Check your Mac's chip architecture (Apple Silicon vs Intel) before downloading.COMMAND
uname -mExpected output"arm64" (Apple Silicon) or "x86_64" (Intel)If error
If nothing prints, open Terminal from Applications → Utilities and try again.
- Download Docker Desktop for your chip from docs.docker.com/desktop/setup/install/mac-install and open the downloaded
.dmg, then drag Docker to Applications. - Launch Docker Desktop from Applications and wait for the whale icon in the menu bar to show "Docker Desktop is running".
- Verify the CLI is installed.COMMAND
docker --versionExpected outputDocker version 2x.x.x, build xxxxxxxIf error
If “command not found”, reopen Terminal after installing so your PATH refreshes, or reinstall Docker Desktop.
- Verify the engine is actually running (not just installed).COMMAND
docker infoExpected outputA block of server information, including Server Version and ContainersIf error
If it says “Cannot connect to the Docker daemon”, open Docker Desktop and wait for the whale icon to stop animating.
- Run a real test container end-to-end.COMMAND
docker run --rm hello-worldExpected output"Hello from Docker!" followed by an explanation of what happenedIf error
If the image can't be pulled, check your internet connection; this is the only step that needs it.
- Download Docker Desktop for Windows from docs.docker.com/desktop/setup/install/windows-install and run the installer. Docker Desktop will guide you through any compatible Windows backend requirement; this lesson does not require a WSL terminal.
- If the installer asks you to enable a Windows feature or restart, follow that prompt and finish the Docker Desktop setup before continuing.
- Start Docker Desktop from the Start menu and wait for the whale icon in the system tray to report "Docker Desktop is running".
- Verify the CLI, using PowerShell or the built-in VS Code terminal (not a Bash-syntax terminal).COMMAND
docker --versionExpected outputDocker version 2x.x.x, build xxxxxxxIf error
If “not recognized”, close and reopen your terminal so PATH changes take effect.
- Verify the engine is running.COMMAND
docker infoExpected outputA block of server information, including Server Version and ContainersIf error
If it can't connect to the daemon, open Docker Desktop, wait until it reports Running, and review Docker Desktop's own Troubleshoot panel.
- Run a real test container.COMMAND
docker run --rm hello-worldExpected output"Hello from Docker!" followed by an explanation of what happenedIf error
If the pull hangs, check your internet connection and that Docker Desktop shows as running, not starting.
- Prefer Docker Engine (not Docker Desktop) on Linux. Follow the official instructions for your distribution at docs.docker.com/engine/install — for Ubuntu specifically, use docs.docker.com/engine/install/ubuntu.
- Start and enable the Docker service.COMMAND
sudo systemctl enable --now dockerExpected outputNo output on successIf error
If systemctl isn't available, your distro may use a different init system — check its Docker Engine install page.
- Confirm the service is active.COMMAND
systemctl status dockerExpected outputActive: active (running)If error
If it shows “inactive” or “failed”, re-run the enable command above and check the install steps were completed.
- Verify the CLI.COMMAND
docker --versionExpected outputDocker version 2x.x.x, build xxxxxxxIf error
If “command not found”, the Engine install likely didn't finish — re-check the distro-specific install page.
- Verify the engine responds.COMMAND
docker infoExpected outputA block of server information, including Server Version and ContainersIf error
A permission-denied error here usually means your user isn't in the docker group yet — see the note below rather than running commands as root.
- Run a real test container.COMMAND
docker run --rm hello-worldExpected output"Hello from Docker!" followed by an explanation of what happenedIf error
If you see a permission error, add your user to the docker group yourself (sudo usermod -aG docker $USER, then log out and back in) — we won't do this for you automatically.
Note: running Docker commands as root or with a global chmod on the socket is not recommended. Add your user to the docker group instead, as shown above.
Before You Run
Install Docker Desktop on macOS or Windows, or Docker Engine/Desktop using the official instructions for your Linux distribution. Start Docker and open Terminal or native Windows PowerShell.
Why Do We Need Docker?
The ENJYRA AWS, Azure, and GCP labs run locally inside Docker containers. No real AWS, Azure, or GCP account is required.
Command Breakdown
docker --version- Confirms the Docker command-line client is installed.
docker info- Asks the Docker Engine for server information, proving it is running and reachable.
docker run --rm hello-world- Runs a small official test container end to end and removes it when finished.
Expected Result
Docker version 2x.x.x
docker info: server details
Hello from Docker!What Changed
BeforeDocker is not yet confirmed.
AfterDocker CLI and Docker Engine are available to launch the local lab.
Verify It
macOSdocker --version
docker info
Linuxdocker --version
docker info
Windows PowerShelldocker --version
docker info
If It Fails
- Open Docker Desktop or start Docker Engine, wait until it reports running, and retry.
- Open a new terminal after installation so PATH changes are loaded.
- On Linux, follow the official instructions for your distribution rather than assuming Ubuntu commands apply.
Lesson-specific check
curl http://localhost:11434/api/versionIf error
If connection is refused, the Ollama container isn't running yet — start it with this lesson's start command, then retry.
Verify your setup
Run each command in your own terminal. This page cannot run commands on your machine, so tick a box only after you see the expected result.
docker --versiondocker --versiondocker --versionBefore You Run
- Your terminal is open in Any terminal folder.
- Docker Desktop or Docker Engine is running.
Why You're Running This
Confirms the Docker command-line client is installed.
Command Breakdown
docker- Runs the docker tool with the shown arguments to complete this lesson step.
Expected Result
A Docker version is printedWhat Changed
BeforeThe action shown by this card has not yet been completed or verified.
AfterThe command has completed and the next lesson step has the state it needs.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- Confirm Docker CLI is installed or running, then retry the command in a new terminal.
docker infodocker infodocker infoBefore You Run
- Your terminal is open in Any terminal folder.
- Docker Desktop or Docker Engine is running.
Why You're Running This
Confirms Docker is actually running, not only installed.
Command Breakdown
docker- Runs the docker tool with the shown arguments to complete this lesson step.
Expected Result
Docker server information is returnedWhat Changed
BeforeThe action shown by this card has not yet been completed or verified.
AfterThe command has completed and the next lesson step has the state it needs.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- Confirm Docker Engine is installed or running, then retry the command in a new terminal.
curl http://localhost:11434/api/versioncurl http://localhost:11434/api/versioncurl http://localhost:11434/api/versionBefore You Run
- Your terminal is open in Any terminal folder.
- The local service named in the URL is already running.
Why You're Running This
Confirms the local Ollama runtime is reachable on its API port.
Command Breakdown
curl- Makes an HTTP request to the local service and prints its response.
Expected Result
The Ollama version endpoint respondsWhat Changed
BeforeThe action shown by this card has not yet been completed or verified.
AfterThe command has completed and the next lesson step has the state it needs.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- Confirm Ollama API is installed or running, then retry the command in a new terminal.
python3 --versionpython3 --versionpy --version
# If py is unavailable:
python --versionBefore You Run
- Your terminal is open in Any terminal folder.
- Python 3 is installed; activate .venv first when the lesson has already created it.
Why You're Running This
Confirms Python 3 is installed. On Windows PowerShell use py --version or python --version if python3 is not found.
Command Breakdown
python- Runs the selected Python module or script with the supplied arguments.
py- Runs the py tool with the shown arguments to complete this lesson step.
#- Runs the # tool with the shown arguments to complete this lesson step.
Expected Result
A supported Python 3.x version is printedWhat Changed
BeforeThe saved program has not yet been executed for this verification step.
AfterThe program ran and produced output or started the local process described by the lesson.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- Confirm Python is installed or running, then retry the command in a new terminal.
Ready to start?
- Docker CLI verified
- Docker Engine running
- Ollama API responds
- Python 3 verified
- Visual Studio Code ready
Need help with a prerequisite?
Docker not running? Open Docker Desktop or start Docker Engine, then run docker info.
Permission denied? Confirm your account can access the Docker daemon; do not use a global prune.
Port already in use? Use docker ps to identify the container that owns the port.
Ollama API not responding? Run docker ps, then restart the Ollama service from the lesson command.
Model not found? Run docker exec enjyra-ollama ollama list.
Launch the ENJYRA Lab
Start only after the prerequisite checks above are complete.
This button confirms readiness; commands still run in your own terminal.
ENJYRA Lab · 07-tiny-rag-v6.0.0
docker run --rm --name enjyra-v6-rag-07 --add-host host.docker.internal:host-gateway -e OLLAMA_URL=http://host.docker.internal:11434 enjyra/free-rag-labs:07-tiny-rag-v6.0.0docker run --rm --name enjyra-v6-rag-07 --add-host host.docker.internal:host-gateway -e OLLAMA_URL=http://host.docker.internal:11434 enjyra/free-rag-labs:07-tiny-rag-v6.0.0docker run --rm --name enjyra-v6-rag-07 --add-host host.docker.internal:host-gateway -e OLLAMA_URL=http://host.docker.internal:11434 enjyra/free-rag-labs:07-tiny-rag-v6.0.0Before You Run
- Your terminal is open in Any terminal folder.
- Docker Desktop or Docker Engine is running.
Why You're Running This
Creates and starts the verified ENJYRA lesson container on your machine.
Command Breakdown
docker run- Creates and starts a container from the named image using the supplied ports, environment values, and runtime options.
--rm- Automatically removes the temporary container after it stops.
--name enjyra-v6-rag-07- Assigns a predictable lesson-scoped name so the container can be inspected or removed safely.
--add-host host.docker.internal:host-gateway- Adds the host mapping the container needs to reach a service running on the learner’s machine.
-e OLLAMA_URL=http://host.docker.internal:11434- Supplies this environment value to the process inside the container.
enjyra/free-rag-labs:07-tiny-rag-v6.0.0- Names the verified ENJYRA lesson image and its pinned lesson version.
Expected Result
The lesson container starts successfully.What Changed
BeforeThe requested local service or lab containers are not yet confirmed running.
AfterThe local service or lab containers are running in the background and can be verified.
Verify It
macOSdocker ps
Linuxdocker ps
Windows PowerShelldocker ps
Confirm the expected container is listed as running or healthy.
If It Fails
- Check the current folder, confirm Docker is running when required, and verify the image or script name before retrying.
What this command does Creates and starts the verified ENJYRA lesson container on your machine.
The lesson container starts successfully.If it fails
Check the current folder, confirm Docker is running when required, and verify the image or script name before retrying.
docker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'docker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'docker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'Before You Run
- Your terminal is open in Any terminal folder.
- Docker Desktop or Docker Engine is running.
Why You're Running This
Reads the local image metadata and prints only its architecture so you can confirm that the expected ENJYRA image exists.
Command Breakdown
docker image inspect- Reads metadata for the named local image without creating or starting a container.
enjyra/free-rag-labs:07-tiny-rag-v6.0.0- Identifies the exact ENJYRA image and lesson tag to inspect.
--format- Prints only the requested metadata field instead of the complete image record.
Expected Result
amd64 or arm64What Changed
BeforeThe current state has not yet been checked.
AfterNo persistent state changed; the command printed evidence you can compare with the expected result.
Verify It
macOSdocker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'
Linuxdocker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'
Windows PowerShelldocker image inspect enjyra/free-rag-labs:07-tiny-rag-v6.0.0 --format '{{.Architecture}}'
Run the command and compare its output with the Expected Result block.
If It Fails
- Confirm the start command completed first, then compare the image, container, port, or script name exactly with this lesson.
What this command does Reads the local image metadata and prints only its architecture so you can confirm that the expected ENJYRA image exists.
amd64 or arm64If it fails
Confirm the start command completed first, then compare the image, container, port, or script name exactly with this lesson.
Reset My Lab
docker rm -f enjyra-v6-rag-07 2>/dev/null || truedocker rm -f enjyra-v6-rag-07 2>/dev/null || truedocker rm -f enjyra-v6-rag-07 2>$nullBefore You Run
- Your terminal is open in Any terminal folder.
- Docker Desktop or Docker Engine is running.
Why You're Running This
Returns this lesson’s local runtime or resources to a known starting state without touching unrelated projects.
Command Breakdown
docker- Runs the docker tool with the shown arguments to complete this lesson step.
Expected Result
This lesson’s runtime state is reset or the named lesson container is removed.What Changed
BeforeThe action shown by this card has not yet been completed or verified.
AfterThe command has completed and the next lesson step has the state it needs.
Verify It
macOSInspect the command output shown above.
LinuxInspect the command output shown above.
Windows PowerShellInspect the command output shown above.
Continue only when the observed result matches the Expected Result block.
If It Fails
- Check Docker is running and make sure you are using this lesson’s exact container or launcher name.
What this command does Returns this lesson’s local runtime or resources to a known starting state without touching unrelated projects.
This lesson’s runtime state is reset or the named lesson container is removed.If it fails
Check Docker is running and make sure you are using this lesson’s exact container or launcher name.
Prove What You Learned
This lesson contains 4 focused questions. You answered 2 before the build; complete the remaining 2 now.