The tools you need before the first run
Briefing Engine reads news feeds, asks Claude how well each new article matches a reader's interests, and emails that reader a short briefing of the best ones. Running it on your own computer takes three programs. Briefing Engine is written in Python, so Python is needed to run it.
PostgreSQL, usually shortened to Postgres, is a database: Briefing Engine records in it every article it fetches, every score Claude gives and every briefing it sends, so a later run can carry on from those records instead of starting again and paying to score the same articles twice.
Mailpit stands in for a real mail server. It catches the email Briefing Engine sends and shows it in your browser, so you can read a briefing without it reaching anyone's inbox. Keeping those jobs separate pays off when something goes wrong, because a failed connection then points at one program, not at the whole setup.
Three tools get the project and those programs onto your computer, each with its own part of the job. Install any that aren't already on your computer:
- Git for Windows copies the project's code from GitHub. You only use it once, to download the project.
- uv installs the Python version and packages the project needs, then runs Briefing Engine with them. You give it commands in PowerShell, the Windows terminal: a window where you type instructions for the computer instead of clicking.
- Docker Desktop for Windows runs Postgres and Mailpit in containers. Each container provides a separate environment for one of these programs and the software it needs. Follow Docker's Windows and WSL 2 setup instructions, then start Docker Desktop with Linux containers selected. This is often the slowest part of the setup: Docker needs hardware virtualisation turned on in your computer's firmware settings, and installing WSL 2 may ask you to restart. Docker's instructions cover both.
After installation, open a new PowerShell window, so that it picks up the tools you have just installed. Paste the following commands one line at a time and press Enter after each line. docker info prints a long report, and running the commands separately keeps each result next to the command that produced it. Command blocks in this guide leave out the PS C:\...> prompt you may see on your screen.
git --version
uv --version
docker compose version
docker info
The first three commands should print version information. The last should include a section about Docker's Server, the engine that actually runs containers; an error connecting to the Docker engine usually means Docker Desktop hasn't finished starting. If a command is missing or uv prints nothing, use the tool checks below before going further, because every later step relies on these tools.
You also need an Anthropic API key with API access and enough credit, or billing enabled. The application sends article text to Anthropic to be scored, and those requests can incur charges. Get the key from the Claude Console and keep it for the configuration step. You can install everything else before you have it; only scoring needs a working key.
Put the commands in the application folder
Most commands in this guide only work from one place: the application's folder, where uv and Docker find the files that tell them what to run. Run them from anywhere else and they report missing files, which looks like a broken installation when the only problem is the folder.
This guide uses C:\dev\briefing-engine as the application folder.
If you already have a copy of the Briefing Engine project in that folder, skip the following download block. Continue with the next block, which enters the application folder and installs its Python packages.
If you are downloading the project for the first time, run the following commands in PowerShell to download it.
New-Item -ItemType Directory -Path C:\dev -Force | Out-Null
Set-Location C:\dev
git clone https://github.com/simonoconnordev/briefing-engine.git
git clone creates the briefing-engine folder and downloads the repository, meaning the project's files and their version history. The repository is public, so you don't need a GitHub account to clone it. You only need to do this once.
Whether you have just downloaded the project or already had a copy, run the following commands in PowerShell to enter C:\dev\briefing-engine and install the Python packages Briefing Engine needs. The final command displays the application's help text, allowing you to check that it can start.
Set-Location C:\dev\briefing-engine
uv sync --locked
uv run briefing --help
uv sync --locked installs exactly the package versions the project has recorded, so your environment matches the one the code was tested with. It can download Python if the required version is missing, and it creates a .venv folder holding this application's Python environment. You don't need to activate that environment yourself, because uv run selects it for you.
When you run uv run briefing --help, Briefing Engine should display its available commands, including migrate, load-config and run-daily. Seeing that list confirms that Python can start the application. Later steps will check whether Briefing Engine can connect to Postgres, ask Claude to score articles and send an email to Mailpit.
Keep this PowerShell window in C:\dev\briefing-engine for the rest of the guide. The examples assume a first local setup. If you already have your own configuration files, keep them and use the examples to compare settings. If you have already generated a briefing, the section on running again explains how a saved edition affects a later run.
Tell the application where to connect
The application needs to know where its database and mail server are, and it needs a key to use Anthropic. None of that belongs in the Python code, because it differs from one computer to the next, so it goes in a file called .env at the top of the application folder.
The project includes an example settings file called .env.example. Run the following commands in PowerShell to copy it to .env and open .env in Notepad. If .env already exists, the commands will open that file without replacing it.
if (-not (Test-Path .env)) {
Copy-Item .env.example .env
}
notepad .env
If you have just created .env from the example, you only need to change two settings for this first run. Paste your API key straight after ANTHROPIC_API_KEY=, and delete the model name after WRITEUP_MODEL= so that the line ends at the equals sign. Then save the file.
The block below shows the settings for this local run. If you opened an existing .env, compare its settings with this block before continuing. Keep your actual API key in place of your-api-key. The file's other lines belong to later stages and can stay as they are. These lines are file contents, so edit them in Notepad rather than running them in PowerShell.
DATABASE_URL=postgresql+psycopg://briefing:briefing@127.0.0.1:5432/briefing
ANTHROPIC_API_KEY=your-api-key
SCORE_MODEL=claude-haiku-5-5
WRITEUP_MODEL=
SMTP_HOST=127.0.0.1
SMTP_PORT=1025
SMTP_USE_SSL=false
MAIL_FROM=Briefing Engine <briefing@briefing.test>
127.0.0.1 means this computer. Postgres will listen on port 5432, and Mailpit will accept email on port 1025. A port is a numbered connection point, which is how several services can share one computer without their connections getting mixed up. The database name, username and password match the local Docker configuration. They can sit here in plain text because they only open a database on your own machine.
Leaving WRITEUP_MODEL empty is deliberate. Claude will still score articles and give a reason for each score, and those reasons can appear in the email. Testing fetching, scoring and delivery first, without the second model call that writes a more polished briefing, means one less thing that could be the cause if the first run fails.
The scoring model above matches the repository and Anthropic's model list when this guide was prepared. If your account can't use it, choose an available model ID from that list and update SCORE_MODEL. The key belongs only in your local .env, never in an article, screenshot or Git commit. The repository already excludes .env from Git, so keeping the key there doesn't risk committing it.
Start the database and the test inbox
The connection settings in .env tell Briefing Engine where to find Postgres and Mailpit. Now those two programs need to be running. Docker Compose is the part of Docker Desktop that reads the project's compose.yaml file and starts the containers described there. Run the following commands in PowerShell to start Postgres and Mailpit through Docker Compose and check their status.
docker compose up -d --wait postgres mailpit
docker compose ps
The first run may download two images, the packaged software for Postgres and Mailpit, and Docker then creates a running container from each. The Compose startup options control what happens next. -d keeps the containers running in the background after PowerShell returns, and --wait holds the prompt until their startup checks pass, so getting the prompt back means the services are ready, not just launched. Naming postgres and mailpit starts only those two services.
The status list should show both services running and Postgres healthy. Next, open the Mailpit inbox on this computer in your browser. On a fresh installation it will be empty. Checking it now, before the application sends anything, rules out one cause in advance: if the first email doesn't appear, you'll already know the inbox works.
Mailpit uses two ports because it has two different conversations. The application sends email to 1025, and your browser views the inbox at 8025. Opening 1025 in a browser fails because nothing on that port talks to browsers, so the error tells you nothing about the inbox.
Postgres keeps its data in a Docker volume, storage that survives a container being stopped or recreated, and Mailpit has a volume too. That is what makes it safe to stop everything at the end of a session: restarting the services later doesn't make the application forget today's briefing.
Give the first run one reader and one feed
The .env file tells the application how to reach other services. A separate file, briefing.toml, tells it what this reader wants. The repository's example configuration, briefing.example.toml, subscribes to five feeds, but one feed makes the first results much easier to check, because every article in the email has to have come from it.
Run the following command in PowerShell to open briefing.toml, the file that will hold your reader preferences and feed details. If the file does not exist, Notepad will ask whether you want to create it.
notepad briefing.toml
For a new setup, accept Notepad's offer to create the file, paste the following contents and save it as briefing.toml. If you use Save As, choose All files so Notepad doesn't add .txt to the name. If you already have a personal configuration, keep it rather than replacing it with this example.
[user]
email = "reader@example.com"
display_name = "Local reader"
timezone = "Europe/Dublin"
send_time = "06:30"
[[profiles]]
name = "ai-news"
threshold = 0.0
max_items = 5
max_age_days = 7
[profiles.rubric]
description = "Practical articles about building and using AI tools."
avoid = ["Funding announcements without anything useful to try."]
scale_hint = "9-10: especially useful; 6-8: worth reading; 0-5: little relevance."
[[profiles.rubric.interests]]
topic = "Building, testing and using AI applications"
weight = 3
[[sources]]
name = "Simon Willison"
url = "https://simonwillison.net/atom/everything/"
kind = "atom"
profiles = ["ai-news"]
The profile groups this reader's preferences, and its rubric describes what Claude should value when it scores an article. The source points at a feed, a machine-readable list of posts, and profiles = ["ai-news"] connects that feed to the profile with the matching name.
For this first test, threshold = 0.0 lets any successfully scored article that passes the other filters, such as the age limit below, compete for a place. The point of the first run is to see the whole route work, and a strict threshold could give you an empty email that hides whether it did. You can make the briefing selective once you've seen it work. max_age_days = 7 leaves out posts published more than seven days ago, so which posts are available depends on what the live feed has published recently.
max_items = 5 limits the email, not the scoring bill. Every recent article has to be scored before the application can choose the best five, so the engine may score more than five. One feed and no write-up model keep the first experiment small, but neither is a spending cap.
The recipient address can stay as reader@example.com. With the SMTP settings you saved in .env, Mailpit captures the message and never forwards it, so the address doesn't need to exist. send_time only matters for scheduled operation; the manual run-daily command runs when you start it, without waiting for 06:30.
Give the database its structure and the reader's settings
Postgres is running, but the new database does not yet contain the tables Briefing Engine needs to store articles, scores and briefings. Without those tables, the next command could not save your reader preferences, and no later step could read or save anything either. Run the following command in PowerShell to create the database structure. This preparation step is called a migration.
uv run briefing migrate
The command should finish with Database is at the latest migration. It is safe to run again, because applied migrations are recorded and only new ones run; it never starts by deleting existing data.
Your reader preferences and feed details are now saved in briefing.toml. Briefing Engine uses a copy of those details stored in its database when it creates a briefing. Run the following command in PowerShell to import them from briefing.toml into the database.
uv run briefing load-config
On a fresh database with the example above, expect 1 profile, 1 source and 1 subscription, with ai-news listed under new rubric versions. Loading the same file again should report none for new rubric versions. That matters for cost: an unchanged rubric keeps its version, and saved scores are tied to that version, so reloading the file doesn't throw away scores you've already paid for.
Whenever you change the reader preferences or feeds in briefing.toml, run uv run briefing load-config again to update the database. Saving the file in Notepad alone does not update the preferences Briefing Engine uses. Connection settings, such as the database address and API key, still come from .env. Neither preparing the database with uv run briefing migrate nor importing the configuration with uv run briefing load-config fetches a feed or calls Claude.
Run the pipeline and open the email
Everything the run depends on is now in place: the tools, the connections, the services, the reader's configuration and the database. The next command fetches the feed, scores eligible articles through Anthropic, builds today's edition and sends it to Mailpit. It is the first step in this guide that makes paid model requests.
uv run briefing -v run-daily
-v asks for more detailed logs. As the program runs, it records background jobs for fetching, scoring, building and delivering, then works through those jobs itself, so there is no separate worker to start for this walkthrough.
At the end, look for the Ingest jobs: and Build jobs: summaries. A clean run shows failed: none for both, with no work waiting to retry. The Model calls this run: line reports the calls made and the cost the application recorded. Your counts will differ from anyone else's, because they depend on what the feed has published recently.
Return to Mailpit's local inbox and refresh if necessary. Open the message whose subject begins Your ai-news briefing for, followed by the date. Check its recipient, article links and score explanations. Earlier, you left WRITEUP_MODEL blank in .env. That setting disables the separately written introduction, so this first email should contain ranked articles and the reasons for their scores.
What you see tells you how far the run got. An email containing articles shows the whole route working, from feed to inbox. Whether those articles are useful to you is a separate question, answered by reading them and adjusting the preferences. An empty edition shows less: delivery worked, but nothing was ready to go into that edition. If you get one, work through the empty-edition checks below before changing several settings at once, or you won't know which change fixed it.
You can inspect the stored work and model usage without starting another run:
uv run briefing jobs
uv run briefing usage
The jobs command shows the state of each piece of work and any recent failures. The usage command shows recorded model calls and costs across runs. It is the application's own diagnostic record; your Anthropic billing remains the authority on what you are actually charged.
The second run remembers the first
After Briefing Engine has successfully sent today's briefing, running uv run briefing -v run-daily again on the same day will not send another copy. Briefing Engine keeps one saved edition for each reader, profile and local date.
The rerun still does some work. It can fetch the feed and score newly published articles, and although existing matching scores are reused, a same-day rerun can still make model calls. What it won't do is replace today's edition: once that exists, the application keeps it unchanged. Deleting the message from Mailpit doesn't change that, because the record that the email was sent is in the database, not in the inbox.
After the first run, a useful next change is to raise threshold from 0.0 to 6.0 in briefing.toml, then run uv run briefing load-config to save it. Later editions can then leave out lower-scoring items, while today's saved edition stays as it was. The threshold only decides which existing scores qualify, so raising it doesn't make anything need scoring again. Changing the rubric itself is different: it creates a new rubric version, and articles may need fresh scores.
When you come back on another day, run uv run briefing -v run-daily again with Docker Desktop and the local services running, and it can build that day's edition. This manual command finishes and exits, so it doesn't arrange tomorrow's run for you.
The optional review page lets you record feedback on the articles in your briefing. Run the following command in PowerShell to make that page available on your computer.
uv run briefing web
Open the review page on this computer, or use the review links in the email. On the page, mark each article Interesting or Not for me to record whether it matches your interests. Compare that feedback with Claude's scores to identify where your written scoring criteria, the rubric in briefing.toml, need improvement. Recording feedback does not change the rubric automatically.
The review page only works while uv run briefing web is running. Leave that command running while you use the page, then press Ctrl+C in PowerShell to stop it.
Stop the services without losing the work
When run-daily returns to the prompt, the Python run has finished, but the containers started with -d are still running in the background. Stop them when you're done:
docker compose stop postgres mailpit
Stopping a container leaves its volume alone, so the database and the Mailpit messages survive. The project files were never inside a container, so they stay in C:\dev\briefing-engine either way.
To continue later, start Docker Desktop and open PowerShell. Run the following commands to enter the application folder and restart Postgres and Mailpit.
Set-Location C:\dev\briefing-engine
docker compose up -d --wait postgres mailpit
You can reopen Mailpit straight away. A new briefing still needs uv run briefing -v run-daily. Everything else was a one-off: the project is already cloned, .env and briefing.toml are already saved, and unchanged preferences are already in the database.
You now have somewhere to see what the application actually produces. Keep the first experiments small: read the selected posts, change one preference at a time and compare later editions, so that each difference has a cause you can name. Inside Briefing Engine follows one article through the program and explains why each step is built the way it is, and How I built Briefing Engine explains why it exists and how it grew.
Troubleshooting and reference
Use these topics when a checkpoint differs from what you see. Fixing the earliest failing step usually tells you more than repeating the entire setup.
A command is missing, or cannot find the project
If PowerShell says git, uv or docker is not recognised, finish installing that tool and open a new terminal. If uv --version produces no version at all, try uv.exe --version: a different file named uv can take precedence on Windows. If the explicit executable works, use uv.exe in place of uv throughout this guide. Use Get-Command uv -All to see which file PowerShell selected.
An error about a missing pyproject.toml or Compose configuration often means the terminal is in the wrong folder. Run Get-Location, then Set-Location C:\dev\briefing-engine. In this folder you should find pyproject.toml, uv.lock, compose.yaml and src.
If uv sync --locked says the lockfile needs updating, check whether pyproject.toml or uv.lock has changed since you downloaded the project. The first file describes the Python packages the application needs; the second records the exact versions to install. Run the following commands in PowerShell, from the application folder, to check those two files and identify your project version.
git status --short -- pyproject.toml uv.lock
git rev-parse --short HEAD
The first command prints nothing if both files match the checked-out project version. A line containing M indicates a modified file, D a deleted file, and ?? a file Git is not tracking. The second command prints a short identifier for the project version.
If Git reports changes, review those changes before replacing either file. If you need help, include the output of these two checks, the full uv sync --locked error and your uv version, shown by uv --version. Do not delete uv.lock to make the error disappear: Briefing Engine needs its recorded package versions for a repeatable installation.
Docker, Postgres or Mailpit will not connect
Run the following commands in PowerShell to check whether Postgres and Mailpit are running and display the last 50 log lines from each service. The status list should show both services running and Postgres healthy; the logs can explain a failed startup.
docker compose ps
docker compose logs --tail 50 postgres mailpit
If Docker reports that a port is already allocated, another process is using 5432, 1025 or 8025. Check Docker Desktop for an existing instance of these services. Moving the repository to another folder will not necessarily isolate it: the supplied Compose file names its project briefing-engine. Identify the existing service before stopping or reconfiguring anything.
A database connection failure during uv run briefing migrate means Briefing Engine could not connect to Postgres. In the status output above, check that Postgres is healthy. In Notepad, check that DATABASE_URL in .env matches the local settings shown in Tell the application where to connect. If both checks pass, use the PowerShell settings check below: a setting already present in PowerShell can override the value in .env. A leftover DB_HOST from cloud work also selects the cloud-style database settings.
If Mailpit's page does not open, check that its container is running and that your browser is using http://127.0.0.1:8025. If the page opens but sending fails, open .env in Notepad and check SMTP_HOST=127.0.0.1, SMTP_PORT=1025 and SMTP_USE_SSL=false. If the file includes MAIL_TRANSPORT, its value should be smtp. PowerShell settings can override these mail settings too.
PowerShell can hold its own settings, called environment variables, which Briefing Engine reads when it starts. Run the following command in the PowerShell window you are using for this guide to check for database or mail settings already present there. It prints only their names, keeping any passwords out of the output.
Get-ChildItem Env: |
Where-Object { $_.Name -match '^(DATABASE_URL|DB_.*|SMTP_.*|MAIL_TRANSPORT)$' } |
Select-Object -ExpandProperty Name
If the command prints nothing, none of these connection settings is present in the PowerShell environment. If it prints names, those settings may be overriding .env. To use the guide's local connection settings from .env, run the following command to remove the database and mail variables from this PowerShell window. This affects commands started from this window; it does not edit .env or your saved Windows settings.
Get-ChildItem Env: |
Where-Object { $_.Name -match '^(DATABASE_URL|DB_.*|SMTP_.*|MAIL_TRANSPORT)$' } |
ForEach-Object { Remove-Item -LiteralPath ("Env:" + $_.Name) }
Retry the command that could not connect. For a database failure during setup, that is uv run briefing migrate. If a briefing run already created failed jobs, follow A job failed and needs another attempt after correcting the connection settings. If the same overrides appear whenever you open PowerShell, they are being supplied by Windows or your PowerShell startup configuration; clearing them from one window does not remove that source.
The settings file or API key is rejected
Use Get-ChildItem -Force -Name .env*,briefing*.toml* to check filenames without printing their contents. The intended names are exactly .env and briefing.toml. A file saved as .env.txt or briefing.toml.txt will not be read by the default commands.
A TOML error from load-config often points to a missing quote or bracket. Keep the configuration block's section headings, and make sure the source's profiles entry matches the profile's name. Save as UTF-8.
For an authentication error, check that ANTHROPIC_API_KEY contains your actual key rather than the placeholder. An API credit or billing error needs attention in the Claude Console. A model-not-found or access error calls for checking SCORE_MODEL against a model your account can use. Correct the cause, then follow A job failed and needs another attempt to retry the failed work.
Do not share the contents of .env when asking for help. The command that failed and its error message are usually the useful starting point; remove any secrets before sharing logs.
An email is empty, missing, or not changing
First run uv run briefing jobs. Fetch or score failures can explain an empty edition; delivery failures can explain a missing email. If those stages completed, the feed may have no eligible recent posts, or a more selective profile may have rejected them. The tutorial's zero threshold removes the score cutoff, but it cannot create new posts or rescue failed scores.
Once an edition has been saved for today, changing the feed, age limit or threshold will not rebuild it. Fix the underlying issue, run uv run briefing load-config to import any changed preferences and use a later day's edition to judge the result. There is no --force rebuild option in the version covered here.
If you need another same-day experiment, you can create a separate trial profile: in briefing.toml, change both the profile name and the matching source profiles entry to a new name, such as ai-news-trial-2, save the file, then run uv run briefing load-config followed by uv run briefing -v run-daily in PowerShell. This creates another profile and potentially more model work; it does not replace the earlier profile or edition. Prefer tomorrow's run when you do not need that extra experiment.
A successful delivery recorded in the database is not reset by deleting an email in Mailpit. Check the recipient, subject and date in the existing inbox before assuming another message should arrive.
A job failed and needs another attempt
Run uv run briefing jobs in PowerShell to inspect recent jobs and their errors. A job marked dead has stopped retrying. Read its error and fix the cause before trying the job again.
To retry a dead job, first put it back into the queue with uv run briefing jobs replay, followed by its job ID. Then run uv run briefing -v run-daily to process the queued work. In the following commands, replace 42 with the ID of the dead job you want to retry, then run both commands in PowerShell.
uv run briefing jobs replay 42
uv run briefing -v run-daily
A job already waiting for an automatic retry does not need manual replay. After running the commands above, run uv run briefing jobs again. Its list of recent dead jobs shows any job that failed again, with its new error; if your job's ID is not in that list, it either succeeded or is waiting for an automatic retry, which the run-daily summary reports as waiting to retry. Returning to the PowerShell prompt alone does not show that every stage succeeded.
Replaying a failed delivery can send its saved edition. Replaying a failed score does not rebuild an edition already created without that score. That distinction matters if a first run both failed to score and produced an empty email.
Local addresses, files and stopping commands
| Item | Purpose in this guide |
|---|---|
.env | Connection settings and the private Anthropic API key, read when a command starts. |
briefing.toml | Reader preferences and feeds, imported into the database by load-config. |
.venv | The Python environment managed by uv. |
127.0.0.1:5432 | Postgres; used by the application, not a browser page. |
127.0.0.1:1025 | Mailpit's SMTP endpoint for accepting email. |
| Mailpit on port 8025 | The browser inbox for captured email. |
| Review on port 8000 | The optional feedback page, available while briefing web runs. |
docker compose stop postgres mailpit stops the services and keeps their containers and volumes. docker compose down removes the project's containers and network, but normally keeps its named volumes. Adding -v removes those volumes too, including the local database and captured mail. That is a destructive reset, not a routine step in this guide. Docker's Compose down reference explains exactly what each option removes.
For every command and its options, run uv run briefing --help. To understand why the work happens in this order, see Inside Briefing Engine, which also links to the code behind each step.
How these steps were tested
This guide describes Briefing Engine as it stood on 16 November 2026. Its first-run configuration uses one feed, a zero selection threshold and no write-up model on purpose: those choices make the first email easy to check, and they are not the repository's full example configuration.
The steps were tested by installing the locked dependencies into a fresh Python environment, applying the migrations and loading the configuration printed in this guide. With separate Postgres and Mailpit services, three sample articles and fixed model replies produced one email. A same-day rerun produced no duplicate, and the message survived stopping and restarting the services.
That test used the real database, queue, email rendering and SMTP delivery, but fixed replies in place of Claude. The parts it couldn't cover are the ones that depend on you: your Anthropic key and billing, and whatever the live feed has published. If your first real run fails at scoring or finds no articles, start there.