[{"content":"Every RAG tutorial starts the same way. Load some PDFs, split them, embed them, put them in a vector store.\nSo RAG starts to feel like a synonym for \u0026ldquo;vector database\u0026rdquo;.\nIt isn\u0026rsquo;t. Retrieval-Augmented Generation is generation with data retrieval. Nothing in that name says where the data comes from. A vector store is one source. A SQL database is another. So is an API, a search engine, or a folder of markdown files.\nAnd for a data engineer, that\u0026rsquo;s the exciting part. The data I already deliver can feed these systems.\nI just finished Pluralsight\u0026rsquo;s LangChain: Working with Data, the follow-up to the course behind my previous LangChain post. Here\u0026rsquo;s what\u0026rsquo;s worth knowing, and where I\u0026rsquo;d push back.\nThe Familiar Part The course opens with the ingestion pipeline:\nLoad the documents Split them into chunks Embed each chunk into a vector Store the vectors in a vector store For a data engineer this is home turf. Extract, transform, load. Batch loading, lazy loading for big collections, chunk size and overlap as tuning knobs. It\u0026rsquo;s ETL with a vector store as the target.\nThe one abstraction I liked is LangChain\u0026rsquo;s Document: page content plus metadata, whatever the source. A PDF, a web page and a CSV row all become the same object.\nBut I\u0026rsquo;m not convinced it\u0026rsquo;s as source-agnostic as it looks. The content is uniform. The metadata isn\u0026rsquo;t. A PDF gives you page numbers, a web page a URL, a database row whatever columns you mapped. Anything downstream that filters on metadata still has to know where the document came from.\nThen a Question Comes In The indexing happens once. Everything else happens per question:\nEmbed the question, with the same embedding model as the chunks Search the vector store for the closest chunks Give those chunks plus the question to the LLM Generate the answer The first step is the one most diagrams skip. The search compares vectors with vectors, so the question has to become a vector too, in the same space. Use a different embedding model for the question and the search returns nonsense.\nRetrieval Is Where the Engineering Is The basic flow is the demo. The course gets interesting once it starts fixing its weaknesses, and LangChain makes that composable: strategy retrievers wrap the base retriever, and each one fixes one problem.\nMulti-query lets an LLM rewrite the question into several versions. A chunk that\u0026rsquo;s worded differently from the question still gets found. Better recall, at the cost of an extra LLM call. Contextual compression runs an LLM over every retrieved chunk and keeps only the relevant part. Better precision and a smaller final prompt. But it adds one LLM call per chunk, so it only pays off when chunks are long and mostly noise. MMR (maximal marginal relevance) fetches more candidates than you need and picks the final set one at a time: relevant to the question, but different from what\u0026rsquo;s already picked. Three near-duplicate chunks become three chunks that each add something. Metadata filtering and hybrid search cover what embeddings are bad at: exact terms like error codes, and hard constraints like \u0026ldquo;only the current policy\u0026rdquo;. BM25 keyword search alongside vector search handles the first, metadata filters the second. Every one of these trades speed and cost for quality. The system always balances the three.\nMeasure Before You Tune The most useful part of the course was how to evaluate a retriever. You need a set of questions where you know which documents are relevant. Then you can measure three things:\nRecall: did we find the relevant documents? Precision: is what we found actually relevant? Ranking: is the best document at the top? Mean Reciprocal Rank scores that: full points if the right document is first, half if it\u0026rsquo;s second, a third if it\u0026rsquo;s third. And then the diagnosis is almost mechanical:\nSymptom Fix Low recall Increase k, or use multi-query Low precision Contextual compression, or a similarity threshold Poor ranking MMR, a reranker, hybrid search, or better chunks and embeddings That table is what turns RAG from \u0026ldquo;it seems to work\u0026rdquo; into engineering.\nThen the Course Adds SQL The last module is about structured data. The idea: the LLM turns a question into SQL, the database runs it, and the LLM turns the result back into an answer.\nThe course builds it twice:\nAs an explicit LCEL chain. A prompt with the database schema generates the SQL, a tool executes it, and a second prompt answers the question using the query and its result. Every step is visible. As an agent. create_agent gets an LLM, a system prompt and the tools from SQLDatabaseToolkit: list tables, inspect the schema, check a query, run it. The agent decides the order itself. The chain is controlled. The agent is flexible. That\u0026rsquo;s the trade-off with every agent, and here it\u0026rsquo;s very concrete: the chain always does the same four steps, while the agent might look at three tables first, or at none.\nThe common problems will sound familiar to anyone who has ever written documentation for a data warehouse:\nUnclear questions. \u0026ldquo;Which product is best?\u0026rdquo; Best by revenue, margin or rating? Schemas that don\u0026rsquo;t explain themselves. Column names that mean nothing to an outsider, and documentation that doesn\u0026rsquo;t exist. Schemas that are too big. You can\u0026rsquo;t put 400 tables in a prompt. Only the relevant ones, with descriptions. The model needs the same thing a new analyst needs: good names, good descriptions, and only the tables that matter.\nTwo Places Where I\u0026rsquo;d Do It Differently Asking the LLM to check its own SQL. The course validates a generated query by asking an LLM whether it\u0026rsquo;s correct. I\u0026rsquo;m not convinced. If the model wrote the wrong query, why would it spot the mistake on the second look? And the checker can just as well reject a query that was fine. Checking the result is more useful: is it empty, full of NULLs, or suspiciously large?\nSafety through a wrapper. The course makes the agent safe by replacing the execute tool with a safe_execute that checks the SQL before running it. Fine as a demo. But the real wall is much simpler: give the agent\u0026rsquo;s database user SELECT rights only. Then it doesn\u0026rsquo;t matter what SQL the model writes.\nSame lesson as in my MCP server: the prompt describes the rules, the permissions enforce them.\nReal Questions Are Hybrid The course ends with a hybrid system. A router prompt classifies each question as structured, unstructured or hybrid, and is only allowed to answer with one word. A RunnableBranch, LangChain\u0026rsquo;s if/elif/else, then runs the matching path. For hybrid questions it runs both: the SQL result and the retrieved documents go into one final prompt.\nThe example is \u0026ldquo;what\u0026rsquo;s our top-selling product, and what do customers say about it?\u0026rdquo; Sales figures from the database, reviews from the vector store.\nThat\u0026rsquo;s where it clicks why the vector-store framing is too narrow. Real questions don\u0026rsquo;t respect your storage layer. \u0026ldquo;Why did sales drop in Q2?\u0026rdquo; needs the numbers and the context around them.\nAnd structured versus unstructured is still a simplification. In practice there are APIs, search indexes, graph databases and data products, each with its own way to query it. The router pattern scales to all of them: classify the question, fetch from the right sources, answer with what came back.\nWhy This Excites Me as a Data Engineer Most of my work is making data available to other people. Pipelines, models, documentation, access.\nUntil now, the people who got the most out of that were the ones who could write SQL. With retrieval in front of an LLM, that changes. Someone who has never seen the schema can ask a question in plain language and get an answer based on the real data.\nBut only if the data underneath is good. Clear names, good descriptions, sensible access rights, data that\u0026rsquo;s actually up to date. Exactly the things data engineers already care about.\nRAG doesn\u0026rsquo;t replace the data platform. It\u0026rsquo;s a new consumer of it.\nWhat I\u0026rsquo;m Taking With Me RAG is retrieval plus generation, not a vector database. The vector store is one source. Your warehouse, your APIs and your documents are the others, and real questions need more than one.\nMeasure, then tune. Recall, precision and ranking each have their own fix. Without a test set, you\u0026rsquo;re just changing settings and hoping.\nThe model is only as good as what you retrieve.\nAnd retrieving data well is the job I already do.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/rag-is-not-a-vector-database/","summary":"\u003cp\u003eEvery RAG tutorial starts the same way. Load some PDFs, split them, embed them, put them in a vector store.\u003c/p\u003e\n\u003cp\u003eSo RAG starts to feel like a synonym for \u0026ldquo;vector database\u0026rdquo;.\u003c/p\u003e\n\u003cp\u003eIt isn\u0026rsquo;t. \u003cem\u003eRetrieval-Augmented Generation\u003c/em\u003e is generation with data retrieval. Nothing in that name says where the data comes from. A vector store is one source. A SQL database is another. So is an API, a search engine, or a folder of markdown files.\u003c/p\u003e","title":"RAG Is Not a Vector Database"},{"content":"May 2018. GDPR applied, and enterprises across Europe found out they didn\u0026rsquo;t really know where their personal data was.\nNot because nobody cared. Because for twenty years, data had only ever come in. It was copied, combined and reused, and nothing ever said it had to go.\nMost privacy work since then has been catching up. Finding the data, assigning owners, building retention and deletion into systems that were never designed for it. At many organisations that work still isn\u0026rsquo;t finished.\nWriting the policy is the easy part. Retrofitting it is the hard part.\nNow the EU AI Act is here. And this time we can start on time.\nWhy Everyone Was Late on Privacy Privacy went wrong in enterprises because it was bolted on afterwards. By the time GDPR applied, the data was already everywhere.\nNo overview. Nobody knew where all the personal data was. Registers of processing were reconstructed from interviews, after the fact. No ownership. Data was copied between departments, and every copy made it less clear who was responsible. Purpose drift. Data collected for one purpose was quietly reused for another, because it was there. Shadow IT. Exports, spreadsheets and SaaS tools that IT and privacy never saw. Compliance on paper. A DPIA and a policy document said one thing. The systems did another. None of that is anyone being evil. It\u0026rsquo;s what happens when data grows for years without anyone keeping track.\nAnd fixing it afterwards is expensive. Every fix touches systems that were never designed for it.\nThe AI Act in One Minute The AI Act is risk-based. What you have to do depends on what the AI is used for.\nProhibited. Social scoring, manipulative systems, most emotion recognition at work. Banned since February 2025. High-risk. AI in hiring, credit scoring, education, critical infrastructure and regulated products. Strict rules: risk management, data governance, logging, human oversight. Transparency. Chatbots must say they\u0026rsquo;re bots, and generated content must be recognisable as such. In force since August 2026. Minimal risk. Most AI. Spam filters, recommendations, internal tools. Barely regulated. It also matters who you are. A provider builds an AI system and puts it on the market. A deployer uses one.\nMost enterprises are mainly deployers. They buy Copilot, a customer service chatbot or an HR tool with AI inside. Deployers have fewer obligations than providers, but not zero. If you use a high-risk system, you have to use it as intended, assign human oversight, keep its logs and inform the people it affects.\nThe timeline moved this year. The Digital Omnibus pushed the high-risk rules back: to December 2027 for most high-risk systems, and to August 2028 for AI inside regulated products.\nThat delay is not a reason to wait.\nIt\u0026rsquo;s the head start GDPR never gave us.\nSame Mistakes, New Name Look at the list of what went wrong with privacy, and you can already see it happening with AI.\nWhat went wrong with privacy What it looks like with AI No register of processing No AI inventory: which systems, which models, what data, what purpose, which risk class A DPIA written afterwards Risk classification done after the system is live Shadow IT Shadow AI: employees pasting company data into ChatGPT Unclear processor agreements Not knowing what your AI vendor does with your data No data owner No owner per AI system Compliance on paper Policies that say \u0026ldquo;human in the loop\u0026rdquo; while nobody checks the output The difference: with privacy, the data had piled up for twenty years before anyone looked. With AI, most enterprises have a handful of real use cases and a lot of pilots.\nThe pile is still small.\nStart Fresh Keeping track now is cheap. Later it\u0026rsquo;s a multi-year programme.\nFrom the privacy side, I\u0026rsquo;d take three lessons into AI governance:\nOne place to look. An AI inventory that\u0026rsquo;s actually maintained. Every system, its purpose, its data, its risk class and its owner. Add a new AI tool, add a row. Boring. And exactly what everyone wished they\u0026rsquo;d had for personal data in 2018. Prove it, don\u0026rsquo;t promise it. Logging and human oversight designed in from the start, not added when an auditor asks. In privacy, an audit log is what turns a retention policy into proof. AI is no different. Per domain, not one big system. Each team owns its AI use cases and their documentation. A central team sets the rules and checks them. One giant governance platform that tries to do everything tends to break, and it\u0026rsquo;s hard to prove it works. None of this needs the high-risk deadline. It needs someone to start.\nThe Stamp Then there\u0026rsquo;s the stamp. There are actually two, and they\u0026rsquo;re easy to mix up.\nCE marking is mandatory for high-risk AI systems. Providers go through a conformity assessment, and without the CE mark you can\u0026rsquo;t put a high-risk system on the EU market at all. It\u0026rsquo;s not a bonus. It\u0026rsquo;s an entry ticket.\nISO/IEC 42001 is the voluntary one. It\u0026rsquo;s a certifiable standard for an AI management system, the way ISO 27001 is for information security. It doesn\u0026rsquo;t say a single product is safe. It says the organisation has its AI governance in order.\nAnd that one I expect to become a selling point.\nEvery enterprise buying AI will soon ask its vendors the same questions: what\u0026rsquo;s in your inventory, how do you classify risk, who oversees the output? A vendor that can answer with a certificate wins that procurement round. Just like ISO 27001 became the default answer to \u0026ldquo;is our data safe with you?\u0026rdquo;\nThe money isn\u0026rsquo;t in the stamp itself. It\u0026rsquo;s in getting there.\nWhy This Field Will Pay Every enterprise in the EU that uses AI needs someone who understands the regulation, the data and the technology together.\nThat combination is rare. Lawyers know the articles. Engineers know the systems. Very few people can read Article 26 and then build the logging that satisfies it.\nThat\u0026rsquo;s exactly what happened with privacy. The people who could turn GDPR into working systems, not just policy documents, had more work than they could handle. They still do.\nThe AI Act will do the same. Only with a better head start.\nData and privacy engineers are already halfway there. We know lineage, access control, retention and audit trails. AI governance is mostly the same discipline, applied to models instead of tables.\nWhat I\u0026rsquo;m Taking With Me Governance is cheap at the start and expensive later. Privacy taught us that the hard way. With AI, most enterprises still have a small enough landscape to get the overview right from day one.\nProve it, don\u0026rsquo;t promise it. A policy document doesn\u0026rsquo;t make you compliant. Logs, owners and an inventory that\u0026rsquo;s actually kept up to date do.\nWe were late for GDPR.\nWe\u0026rsquo;ve been given the time not to be late again.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/we-were-late-for-gdpr/","summary":"\u003cp\u003eMay 2018. GDPR applied, and enterprises across Europe found out they didn\u0026rsquo;t really know where their personal data was.\u003c/p\u003e\n\u003cp\u003eNot because nobody cared. Because for twenty years, data had only ever come in. It was copied, combined and reused, and nothing ever said it had to go.\u003c/p\u003e\n\u003cp\u003eMost privacy work since then has been catching up. Finding the data, assigning owners, building retention and deletion into systems that were never designed for it. At many organisations that work still isn\u0026rsquo;t finished.\u003c/p\u003e","title":"We Were Late for GDPR. We Don't Have to Be Late for the AI Act."},{"content":"I\u0026rsquo;m Evert Boesenkool, a data engineer from the Amsterdam Area. I build data platforms, mostly on AWS, currently at ANWB. Outside of work I build other things: experiments with AI agents, a self-hosted home server, a personal finance website and whatever else I can\u0026rsquo;t stop thinking about.\nThis page is the long answer to \u0026ldquo;so, what do you do?\u0026rdquo; The short answer: I move data for a living, but what I really love is building things people use.\nMy story I set out to study wildlife. I ended up falling for the data.\nIt started long before university. I grew up in the wild west of the early internet, playing RuneScape. Playing turned into botting, and botting turned into running a bot farm that made real-world money. Without knowing it, I was learning to script, automate and keep systems running.\nI love nature, so I studied it: a BSc in Animal Management, majoring in Wildlife Management. The plan was a career in nature research. But during my internships and thesis, I noticed the part I enjoyed most wasn\u0026rsquo;t the fieldwork. It was the data.\nPied flycatchers. Studying their nesting behaviour, I ran my first real analyses in SPSS. Tens of thousands of photos. Their metadata was a mess, so I wrote a script to clean it instead of fixing them by hand. Over 10 million pigeon flights. In ArcGIS, I analysed how wind affects the flight of homing pigeons. By the time I had 10 million flights on my screen, the choice was made: nature stayed my love, data became my work. And the bot farm and the pigeons have more in common with my job today than you\u0026rsquo;d think. Automate the boring parts, clean up the mess, and find the signal in millions of records.\nWhat I do I\u0026rsquo;m a Lead Data Engineer. Most of my experience is on AWS. I like building data pipelines that are serverless and defined as code, and keeping them simple and cheap to run.\nThe work I\u0026rsquo;m proudest of is privacy by design as actual code, not a slide: a retention flow that automatically anonymises customer data and later deletes it, designed together with privacy officers. Privacy has been a thread in my work ever since, and I enjoy sharing what I learn with colleagues.\nAWS certifications AWS Certified Data Analytics – Specialty AWS Certified Database – Specialty AWS Certified Database Engineer – Associate AWS Certified Developer – Associate AWS Certified Cloud Practitioner Where I\u0026rsquo;m heading I\u0026rsquo;ve always felt more like a software engineer who happens to work with data. In data engineering I mostly enable other teams, and I want to be closer to the end result again.\nSo I\u0026rsquo;m moving toward AI engineering: making LLM and agent systems production ready. Predictable, testable, and compliant. Turning a demo into something you can actually rely on is where my data background, my privacy work and my love for building things come together.\nI learn best by building, not by watching hours of video. I pick a topic, dig in with AI as a sparring partner, and make something that works.\nThings I build on the side Stempl: an experiment in letting AI agents pay for API access with work instead of money. An agent hits a 402, completes a few small tasks like classifying or scoring, and earns an access token. The idea came from reCAPTCHA. The story behind it. Verstandig Vermogen: a Dutch site that explains personal finance (mortgages, investing, saving, taxes) with articles and calculators. No advice, just clear explanations. An n8n pipeline helps me spot the questions people are actually asking. My home server: a small, quiet mini PC running Ubuntu and Docker. It hosts n8n, a browser agent, Stempl and a Minecraft server for the kids. What it taught me about AWS. An MCP server for my Obsidian vault: AI can read and search all my notes, but may only write to one folder. A second brain with guard rails. How it works. Reverse engineering my printer: I\u0026rsquo;d never done any reverse engineering, so I\u0026rsquo;m learning by poking at my own printer. Ask me again in a few months. Why this site I experiment a lot: new tools, side projects, courses. This site is how I close each one, with a post or a small project that captures what I learned.\nExpect writing on building with LLMs, AI agents, privacy and AI governance in practice, and the home lab experiments that go with them. A few to start with:\nTreat Prompts Like Code: What LangChain Gets Right We Were Late for GDPR. We Don\u0026rsquo;t Have to Be Late for the AI Act. Giving Claude My Obsidian Vault Outside of work I live in the Amsterdam Area with my wife, our son and daughter. When I\u0026rsquo;m not behind a screen, I\u0026rsquo;m with them.\nI\u0026rsquo;m an explorer at heart. We travel a lot as a family, and wherever we land, I want to be outside: discovering what lives there, how the landscape works and what makes it different from home. The wildlife student in me never really left.\nCloser to home, I play padel and keep working on my fitness.\nSomeday I have two dreams, and they come straight from the two halves of my story.\nThe first is to build an MMO. RuneScape is where all of this started, and building a world that thousands of people play in together is still the most ambitious thing I can imagine making.\nThe second is to work in nature conservation. Not instead of data, but with it: the same skills that once analysed 10 million pigeon flights can help protect the places I love to explore.\nGet in touch I\u0026rsquo;m always up for a conversation about data platforms, privacy, AI governance, or AI agents that actually do something useful. The easiest way to reach me is on LinkedIn.\nThe views on this site are my own and don\u0026rsquo;t represent those of my current or former employers.\n","permalink":"https://www.evertboesenkool.com/about/","summary":"\u003cp\u003eI\u0026rsquo;m Evert Boesenkool, a data engineer from the Amsterdam Area. I build data platforms, mostly on AWS, currently at ANWB. Outside of work I build other things: experiments with AI agents, a self-hosted home server, a personal finance website and whatever else I can\u0026rsquo;t stop thinking about.\u003c/p\u003e\n\u003cp\u003eThis page is the long answer to \u0026ldquo;so, what do you do?\u0026rdquo; The short answer: I move data for a living, but what I really love is building things people use.\u003c/p\u003e","title":"About me"},{"content":"The first app I built with an LLM in it was an email tool. Pick a template, fill in the blanks, done. Or let the model write the whole email for you.\nThe template part was easy. The LLM part needed real engineering.\nI wrote my own system to keep the structure of a prompt separate from the user\u0026rsquo;s data, so a prompt change didn\u0026rsquo;t mean touching five places. I wrote the glue between model calls. And I had to think about what happens when people send weird input to the model.\nThose are exactly the problems LangChain is built to solve. So I took Pluralsight\u0026rsquo;s Introduction to LangChain to see how a framework handles them. Here\u0026rsquo;s what it gets right, where the course oversells it, and what\u0026rsquo;s still up to you.\nEasy to Build, Hard to Ship Building a demo with AI in it is easy. Making it production ready is hard.\nThe reason is simple. A normal function gives you the same output for the same input. An LLM doesn\u0026rsquo;t. Ask it the same thing twice and you get two different answers. That\u0026rsquo;s fine for a chatbot demo. It\u0026rsquo;s not fine when the output goes into a database or another system.\nLangChain\u0026rsquo;s pitch is structured and predictable LLM applications. It sits between your application (UI, business logic, data) and the model provider, and handles the prompts, the chains and the output parsing.\nIn practice that means:\nIt connects prompts, models, memory and tools It gives you a predictable workflow It removes a lot of fragile glue code That last one is the real value. Glue code is where LLM apps quietly break.\nOne Big Prompt Is Not Software The most common anti-pattern in LLM apps is the mega-prompt. \u0026ldquo;First do this, then do that, then format it like this.\u0026rdquo;\nIt works, sort of. But you can\u0026rsquo;t see the outcome of each step. You don\u0026rsquo;t control what comes out in between. When the final answer is wrong, you have no idea which step went wrong.\nThat\u0026rsquo;s not software. That\u0026rsquo;s an experiment you run again and hope for a better result.\nThe fix is prompt chaining. Split the work into small steps, and the output of one step becomes the input of the next. Every transformation is explicit, so you can inspect, test and swap each step on its own.\nA nice side effect: you can use a cheap model for the small, boring steps and save the expensive model for the step that actually needs it.\nThe Building Blocks LangChain has five core components:\nPrompt Template: the input to the model Model: generates text based on text Output Parser: turns that text into something your code can use Callbacks: events you can hook into while it runs Chain: wires all of the above into one workflow Prompt Templates Think of a prompt template as a function signature for your prompt. The fixed instructions are defined once, and the variable data is injected at runtime.\nSummarize: {text} Inject text = \u0026quot;Hi I'm Evert\u0026quot; and you get Summarize: Hi I'm Evert. Nothing fancy. But it kills manual string concatenation, and a prompt change happens in one place.\nIt\u0026rsquo;s the same pattern I built by hand for the email app. Here it\u0026rsquo;s a standard component.\nFor chat models there\u0026rsquo;s ChatPromptTemplate. Instead of one string, the input is a list of messages: a system message, a human message, and optionally an assistant message. Structure and data stay separated.\nLCEL: Pipes, Like Linux LangChain Expression Language (LCEL) wires the components together with |, just like a Linux pipe.\nchain = prompt | model | parser The prompt goes into the model, the model output goes into the parser. It turns imperative code (\u0026ldquo;call this, then take the result and call that\u0026rdquo;) into a declarative pipeline. If you\u0026rsquo;ve ever written cat file | grep foo | sort, it reads naturally right away.\nOutput Parsers An output parser turns the unpredictable text an LLM produces into structured data. There are a few levels:\nStrOutputParser gives you a Python string ListOutputParser gives you a Python list JsonOutputParser gives you a Python dict PydanticOutputParser gives you a typed Python object StrOutputParser shows up in almost every example. A chat model returns an AIMessage object with content, metadata, tool calls and so on. The parser pulls out the text, so the next step gets a plain str.\nThe Pydantic parser is where it gets useful. Extracting structured data from a customer review:\nfrom typing import Literal from pydantic import BaseModel from langchain_core.prompts import ChatPromptTemplate from langchain_core.output_parsers import PydanticOutputParser class Review(BaseModel): customer_name: str product: str sentiment: Literal[\u0026#34;Positive\u0026#34;, \u0026#34;Neutral\u0026#34;, \u0026#34;Negative\u0026#34;] parser = PydanticOutputParser(pydantic_object=Review) prompt = ChatPromptTemplate.from_messages([ (\u0026#34;system\u0026#34;, \u0026#34;Extract the customer name, product and sentiment.\\n{format_instructions}\u0026#34;), (\u0026#34;human\u0026#34;, \u0026#34;{text}\u0026#34;), ]).partial(format_instructions=parser.get_format_instructions()) chain = prompt | model | parser review = chain.invoke({ \u0026#34;text\u0026#34;: \u0026#34;Hi, I\u0026#39;m Evert. I recently bought the new Wireless Headphones \u0026#34; \u0026#34;from your store. The sound quality is excellent and the battery \u0026#34; \u0026#34;lasts all day. I\u0026#39;m really happy with my purchase!\u0026#34; }) # Review(customer_name=\u0026#39;Evert\u0026#39;, product=\u0026#39;Wireless Headphones\u0026#39;, sentiment=\u0026#39;Positive\u0026#39;) Two details make this work:\nget_format_instructions() returns a plain string you put in your prompt. It tells the model how to format its answer so the parser can read it. For a list parser that\u0026rsquo;s a bit thin: \u0026ldquo;Your response should be a list of comma separated values\u0026rdquo;. With Pydantic it generates a proper schema description from your class, and that works well. .partial() pre-fills some of the template\u0026rsquo;s variables and returns a new template. The format instructions are baked in once, instead of passed on every invoke. Few-Shot Examples Do the Heavy Lifting The simplest technique is also one of the most effective. If you want consistent output, give the model examples.\nThe course used IT incident severity. Put a few past incidents and their severity in the prompt, and the model ranks new incidents the same way. Add rules on top: if it affects 100 people, it\u0026rsquo;s high. If it only affects Diana from HR, it\u0026rsquo;s low.\nNo fine-tuning, no magic. Just examples.\nA Parser Doesn\u0026rsquo;t Ensure Anything The course says an output parser validates the output against a schema, \u0026ldquo;ensuring predictable results\u0026rdquo;.\nThat\u0026rsquo;s overselling it. A parser checks. It doesn\u0026rsquo;t fix. It tells you, after the fact, that the model got it wrong.\nPredictability comes from what you do next. There are four options:\nRetry with a correction prompt. Send the model its own bad output plus the error (\u0026ldquo;field price must be a number, got \u0026rsquo;ten euros\u0026rsquo;\u0026rdquo;) and ask again. Models are good at fixing a mistake once you point it out. LangChain has RetryOutputParser for this, and .with_retry() for plain re-attempts. Cap the retries: every one costs a model call. Reformat automatically. Repair the output without asking the original question again. That can be plain code, like stripping markdown fences around JSON, or a small second model call that only reformats. That\u0026rsquo;s OutputFixingParser. Cheaper than a full retry, but it only fixes formatting, not wrong content. Fall back to a safe default. Return something you know is valid: an empty list, an \u0026ldquo;unknown\u0026rdquo; category, or the answer from a different model. That\u0026rsquo;s .with_fallbacks([...]). Make sure downstream code can tell a default from a real answer. Log and fail predictably. Record the raw output, the error and the input, then raise a clear exception. The alternative is a half-parsed result crashing something three steps later, or bad data quietly landing in a table. safe_chain = chain.with_retry(stop_after_attempt=3).with_fallbacks([fallback_chain]) The parser is the check. The failure plan is the guarantee.\nControlling How It Runs With more than one chain, you need to decide how they run together:\nSequential: prompt | model | parser, one after another Parallel: RunnableParallel feeds several chains the same input and combines the results Conditional: route to a different path based on the result, a bit like a pattern match Then there\u0026rsquo;s RunnableLambda. It wraps a normal Python function so it becomes a step in a chain, with the same interface as every other component: invoke, batch, stream and the | operator. Ideal for the small bits of logic between model calls.\nOne distinction worth keeping: context is your application data. It travels through the chain and shapes the output. Metadata describes the execution. It\u0026rsquo;s for tracing and debugging, and it doesn\u0026rsquo;t change the output.\nIf You Have No Data, You Can\u0026rsquo;t Debug When a chain fails, you need to see what happened at each step. Otherwise you\u0026rsquo;re guessing.\nLangChain\u0026rsquo;s answer is callbacks. Extend BaseCallbackHandler, implement methods like on_chain_start, on_llm_start, on_llm_end and on_chain_end, and pass the handler in when you invoke:\nworkflow.invoke( {\u0026#34;text\u0026#34;: \u0026#34;...\u0026#34;}, config={\u0026#34;callbacks\u0026#34;: [MyHandler()], \u0026#34;metadata\u0026#34;: {\u0026#34;run\u0026#34;: \u0026#34;test\u0026#34;}}, ) The course example only prints each step. The real value is further down the road: tracing every step in production, catching schema drift, and checking exactly what each step hands to the next.\nThe Hard Part Isn\u0026rsquo;t the Framework LangChain looks simple, and the API mostly is. The hard part is design: how do you cut your logic into steps? Ten tiny chains, or a few bigger ones? Which steps belong together?\nNo course answers that. It comes from building things, and it\u0026rsquo;s the same judgement call as splitting any codebase into functions.\nThen there\u0026rsquo;s the weird-input problem from my email app. Prompt templates keep instructions and user data apart, and that helps. But separating them isn\u0026rsquo;t the same as defending against them. Prompt injection deserves its own post.\nWhat I\u0026rsquo;m Taking With Me Treat prompts like code. Small steps you can see, test and swap out. That\u0026rsquo;s the difference between an experiment and software.\nA parser checks, it doesn\u0026rsquo;t fix. Predictability comes from validation plus a plan for when validation fails.\nThe course did one thing really well: every question I had was answered in the next video. That doesn\u0026rsquo;t happen often.\nLangChain won\u0026rsquo;t design your app for you. But it takes care of the glue, so you can focus on the parts that matter.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/treat-prompts-like-code/","summary":"\u003cp\u003eThe first app I built with an LLM in it was an email tool. Pick a template, fill in the blanks, done. Or let the model write the whole email for you.\u003c/p\u003e\n\u003cp\u003eThe template part was easy. The LLM part needed real engineering.\u003c/p\u003e\n\u003cp\u003eI wrote my own system to keep the structure of a prompt separate from the user\u0026rsquo;s data, so a prompt change didn\u0026rsquo;t mean touching five places. I wrote the glue between model calls. And I had to think about what happens when people send weird input to the model.\u003c/p\u003e","title":"Treat Prompts Like Code: What LangChain Gets Right"},{"content":"AI agents can\u0026rsquo;t sign up for your API. So they leave.\nMost APIs are built for humans. A sign-up form, an email confirmation, a credit card, an API key to copy. An agent that runs into that just gives up. You never see that traffic, and you never earn anything from it.\nSo I built Stempl. It\u0026rsquo;s a gate in front of your API that lets agents pay with work instead of money.\nEveryone Is Giving 402 a Job HTTP 402 Payment Required sat unused for almost thirty years. Now everyone wants it.\nx402 settles in stablecoins. L402 runs over Lightning. Machine Payments Protocol, launched by Stripe and Tempo this year. They all answer the same question: how does an AI agent pay for an API call? And they all give the same kind of answer. With money.\nThat\u0026rsquo;s clever. But it means every agent needs a wallet, someone has to fund it, and the API owner needs a way to receive it. That\u0026rsquo;s a lot of setup for one API call.\nWhat reCAPTCHA Got Right This reminded me of reCAPTCHA. Millions of people digitised books just by proving they weren\u0026rsquo;t a robot. They didn\u0026rsquo;t pay with money. They paid with a bit of work.\nreCAPTCHA had humans label data to prove they weren\u0026rsquo;t bots.\nWhat if bots labeled data to get in?\nAn agent always has one thing it can pay with: the ability to read something and answer a question about it.\nHow It Works AI agent wants your data Gate in front of the API Stempl tasks + quality control Your API unchanged 1. request 2. 402 + work key 3. do the work 4. access token 5. with token: through verified ✓ GET 402 key tasks answers token token 200 data An agent calls your endpoint and gets a machine-readable 402 Payment Required, with a work key and instructions. It picks up a batch: one question and a few records from someone\u0026rsquo;s workload. Classify them, score them, or answer something about them. Its answers are cross-checked against other agents. Good work counts. Sloppy work earns nothing. After enough good batches it gets an access token and comes back. No account, no API key, no wallet, no human in the loop. Your API stays exactly as it is. Existing customers with their own key go straight through.\nKeeping the Work Honest An agent that answers \u0026ldquo;yes\u0026rdquo; to everything shouldn\u0026rsquo;t get in. So every batch hides a test.\nCheck items. A batch of 5 holds 3 new records and 2 that earlier agents already answered. Item ids are random, so an agent can\u0026rsquo;t tell which is which. The batch only passes if it agrees on the checks. Fuzzy answers. Scores from 0 to 1 pass within a tolerance of earlier answers, by default the median ± 0.2. Text answers are compared by meaning, with embeddings, not by exact words. Stop early. Once 2 answers to a record agree, that record is done. No agent\u0026rsquo;s work is wasted on it. The Other Side: an Agent Workforce The work has to come from somewhere.\nAnyone who has built a data pipeline knows the expensive part usually isn\u0026rsquo;t storage or compute. It\u0026rsquo;s the labels. Classifying records, scoring them, pulling answers out of messy text. You either pay people to do it, or you pay an LLM per token and then still check its output.\nWith Stempl, a business uploads a CSV, JSONL or text file and asks one question about every record. They define the answer fields themselves: yes/no, pick one, a score, or free text. Stempl knows nothing about any domain. It just hands out the work and checks it.\nThe business gets back verified results, plus how far the agents agreed. Stempl already meters items, characters and estimated tokens per batch, so the work can be priced later.\nWhat I Tried First The first version didn\u0026rsquo;t use agents at all.\nIt labeled data with a local model: Gemma 4 26B, served by Ollama on the CPU of my home server. No GPU. I gave it a JSON schema for structured output, turned off reasoning tokens, ran one request at a time and kept the context small.\nIt worked. A full labeling pipeline with zero API costs.\nBut one CPU-bound model caps your throughput, and it was sharing RAM with a Minecraft server. So Stempl moved on. Now AI agents fetch batches over an API and check each other. The local model might come back later to seed a few \u0026ldquo;gold\u0026rdquo; answers that the owner confirms.\nUnder the Hood The trust model is two signed JWTs, so the gate never has to call home:\nWork key. Signed by the API\u0026rsquo;s own gate key and handed to the agent in the 402. It says how much work the agent owes. Access token. Signed by Stempl\u0026rsquo;s Ed25519 key once the work passes. The gate checks it offline, with Stempl\u0026rsquo;s public key from a JWKS endpoint. The gate fits in three ways:\nProxy: internet → gate → API. The API needs no changes and can be written in any language. Gateway plugin: your gateway (Traefik, for example) keeps routing and TLS, and asks the gate about each request through forward auth. FastAPI middleware: one line in a Python API. All three share one small library, gatekit, so the signing logic can\u0026rsquo;t drift apart.\nBehind it all is a single Python service with SQLite. It runs on a box in my home, behind a Cloudflare Tunnel. No Kubernetes, no managed services.\nIs This Just Prompt Injection With Consent? That\u0026rsquo;s the question I asked on LinkedIn, and I still don\u0026rsquo;t have a clean answer.\nThe 402 response literally tells an agent what to do. That\u0026rsquo;s the whole point. But it\u0026rsquo;s also exactly what people worry about when a web page tells an agent what to do.\nWhat I do know: I don\u0026rsquo;t think this replaces payments. Some API calls are worth a wallet. But not every call is, and not every agent has one.\nTry It It\u0026rsquo;s an experiment, and you can try it right now. Point your agent at the demo Flight API at flights.stempl.dev and let it follow the instructions in the 402. The flights are made up. /flights is open, but the details cost work.\nThe landing page at stempl.dev has a walkthrough. Demo work is public, so don\u0026rsquo;t upload anything personal.\nNext up are self-service accounts, so API owners can set up their own gate and businesses can upload their own work.\nTwo Things I\u0026rsquo;m Taking With Me Payment doesn\u0026rsquo;t have to mean money. reCAPTCHA proved that years ago. Agents just flip it around.\nTrust comes from cross-checking, not from the agent. You never trust one answer. You trust two answers that agree.\nYour API gets a new kind of customer. It just pays in a different currency.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/letting-ai-agents-pay-with-work/","summary":"\u003cp\u003eAI agents can\u0026rsquo;t sign up for your API. So they leave.\u003c/p\u003e\n\u003cp\u003eMost APIs are built for humans. A sign-up form, an email confirmation, a credit card, an API key to copy. An agent that runs into that just gives up. You never see that traffic, and you never earn anything from it.\u003c/p\u003e\n\u003cp\u003eSo I built Stempl. It\u0026rsquo;s a gate in front of your API that lets agents pay with \u003cem\u003ework\u003c/em\u003e instead of money.\u003c/p\u003e","title":"Letting AI Agents Pay With Work"},{"content":"I asked Claude to work with my notes. It couldn\u0026rsquo;t.\nThere is no Obsidian connector. My options were linking a desktop session to the laptop that holds the vault, or pasting notes into the chat one by one.\nBut an Obsidian vault is just a folder of markdown files. Anything that can read a folder can serve it. And I already had a home server doing nothing most of the day.\nSo I built a small MCP server. Claude can search and read every note in my vault, and write only inside one Claude/ folder. This post is how it got there, including the versions that didn\u0026rsquo;t survive.\nI built it pairing with Claude. Which is a slightly strange experience: the thing I was giving access to was helping design its own guardrails.\nShould I Even Build This? Honestly, the \u0026ldquo;Obsidian MCP server\u0026rdquo; niche is crowded. When I looked in October there were at least five: a few on GitHub and npm, a plugin that runs one inside Obsidian, and one in Docker\u0026rsquo;s MCP catalog. Someone launching yet another one on the Obsidian forum opened by saying most of them are unmaintained or overly complicated.\nSo \u0026ldquo;Obsidian in Docker\u0026rdquo; on its own is a tutorial, not a project.\nWhat made it worth doing anyway: almost all of them need the Obsidian desktop app running, with the Local REST API plugin enabled. I wanted something headless. A synced vault on a server, no app anywhere, reachable by any MCP client on my network.\nTwo Containers and a Folder The whole thing is two small containers sharing one folder of markdown files.\nobsidian-sync runs Obsidian Headless, Obsidian\u0026rsquo;s own command-line client for Sync. It keeps ./vault on the server identical to the vault on my laptop and phone. vault-mcp is a Python FastMCP server. It reads the same folder and serves MCP over HTTP at http://server:8765/mcp, on my home network only. My first idea was running the real Obsidian app in a container and putting an MCP bridge in front of its REST plugin. That works. It\u0026rsquo;s also a full desktop app you use through a browser, that only serves while it\u0026rsquo;s open. Obsidian Headless made it unnecessary. Its docs even list giving agents access to a vault, without giving them your whole computer, as a use case.\nThere\u0026rsquo;s no tunnel, on purpose. claude.ai calls connectors from Anthropic\u0026rsquo;s cloud, so it can\u0026rsquo;t see server:8765. Claude Code is different. It runs on my laptop and makes the calls from there, so the home network is enough.\nClaude Doesn\u0026rsquo;t Live on Your Server There\u0026rsquo;s no Claude in the vault-mcp container, and there doesn\u0026rsquo;t need to be. The server knows nothing about models. Claude only sees my notes when it asks for them.\nThe model runs in Anthropic\u0026rsquo;s cloud. Claude Code on my laptop asks my server which tools it has, the model picks one, and Claude Code makes the HTTP call. My server just runs plain Python and returns text.\nThe easiest way to think about it: MCP is FastAPI for LLMs. FastMCP turns a function\u0026rsquo;s name, docstring and type hints into a JSON schema:\n@mcp.tool async def recent_notes(n: int = 10) -\u0026gt; list[str]: \u0026#34;\u0026#34;\u0026#34;The n most recently changed notes in the vault, newest first.\u0026#34;\u0026#34;\u0026#34; The model never sees the function body. Only the name, the docstring and the parameters. That has two consequences that shaped everything after:\nThe docstring is the whole manual. Which tool the model picks, and how, depends on names and descriptions. They are prompts. The docstring enforces nothing. Writing \u0026ldquo;only write in your own folder\u0026rdquo; in a description proves nothing. The model can send any path it likes. The code has to decide what is reachable. A Search Tool an LLM Can Actually Use The smallest working search tool is five lines. Loop over every .md file, return the paths that contain the query.\nIt works. It\u0026rsquo;s also a poor tool, because what a tool returns is all the model has to work with. Five changes made it useful:\nSnippets, not just paths. With filenames only, the model has to open every hit to see if it\u0026rsquo;s relevant. A short snippet lets it pick the right note straight away. All words, not the exact phrase. \u0026quot;sync conflict\u0026quot; should match a note that mentions both words, even when they\u0026rsquo;re not side by side. Match the path too. A query like \u0026quot;work meeting\u0026quot; should find Work/meeting notes.md. Folder names carry meaning in a vault. A limit. If 400 notes contain \u0026ldquo;data\u0026rdquo;, returning all of them floods the context window. Cap it. Skip .obsidian/ and .trash/. Plugin config and deleted notes never belong in results. And one sentence in the docstring that does a lot of work: \u0026ldquo;Open a result with read_note.\u0026rdquo; Tell the model what to do next and it stops guessing.\nAn empty query lists the most recently changed notes. That turned out to be my favourite feature. It doubles as \u0026ldquo;what have I been working on?\u0026rdquo;\nI Said Prefix, I Meant Folder Reading is safe-ish. Writing to my second brain is where it gets serious.\nMy requirement was simple: Claude may create notes, and I must be able to see at a glance which ones it created. So the first version only allowed filenames starting with claude-. The server added the prefix itself, so the model couldn\u0026rsquo;t forget it.\nIt worked. And testing found a leak. A symlink called claude-link.md pointing at one of my own notes was refused by read_note, but search_notes read straight through it and would have shown my note in a snippet.\nThen I realised I had said \u0026ldquo;prefix\u0026rdquo; but meant a directory.\nA folder turned out to be simpler. Every write path is resolved first, then checked:\np = (VAULT / rel.parent / f\u0026#34;{rel.name}.md\u0026#34;).resolve() if not p.is_relative_to(WRITE_ROOT): raise ToolError(\u0026#34;You can only write inside the \u0026#39;Claude/\u0026#39; folder. \u0026#34; \u0026#34;Use a path like \u0026#39;Claude/meeting summary\u0026#39;.\u0026#34;) Small lines, a few lessons:\nResolve before you check. .resolve() turns ../../etc/passwd or a symlink into its real target. Then you check that. is_relative_to, not startswith. A string check on /vault/Claude also lets a neighbouring Claudette/ folder through. My test vault has a Claudette/ folder just to prove it. The error says what to do instead. \u0026ldquo;Use a path like…\u0026rdquo; lets the model fix itself on the next call instead of giving up. The folder version was too strict, though. Claude could only see its own notes. What I actually wanted was asymmetric: read the whole vault, write only in Claude/. So reading got a looser check (inside the vault, not in .obsidian/ or .trash/), and writing kept the strict one on top.\nDocker Says No Too The code check is the first wall. The second is two lines of YAML:\nvolumes: - ./vault:/vault:ro # everything, read-only - ./vault/Claude:/vault/Claude # Claude/ writable on top The whole vault is mounted read-only. Only Claude/ is mounted again, writable, on top. Even if my path check has a bug, the operating system refuses the write. I tested that directly by writing to the mount and skipping the server code entirely.\nOne line of config for a second, independent guarantee. That\u0026rsquo;s a good deal.\nMy original request was actually \u0026ldquo;search and read everywhere on my machine\u0026rdquo;. I scoped that down to the vault. Read access to the whole server would also expose ~/secrets/, with the keys of every stack on it. That\u0026rsquo;s not a tool I want an LLM to have.\nOne Key, and Where I Left It Every request needs a secret key, sent as a bearer token. Two choices I\u0026rsquo;m happy with:\nFail closed. No key, or one shorter than 32 characters, and the server refuses to start. There\u0026rsquo;s no \u0026ldquo;no auth\u0026rdquo; switch to forget about. Constant-time comparison. hmac.compare_digest takes the same time whether the first or last character is wrong, so nobody can guess the key from response times. It\u0026rsquo;s plain HTTP, so the key is the only protection. Fine on a home network with my own devices. Not fine on the internet, which is why this one never goes on my Cloudflare Tunnel.\nAnd then I pasted the full claude mcp add command, key included, into my daily note.\nWhich is now readable by… the MCP server.\nRotate your keys. Keep them out of your vault.\nCheck the Disk, Not the Reply Every guarantee above only counts if something tries to break it. So I tested against a fake vault, where almost every file is a trap:\na stand-in for one of my notes, that must never change the Claudette/ folder next to Claude/ a symlink inside Claude/ pointing at my note a symlink pointing outside the vault notes in .obsidian/ and .trash/ a file next to the vault, as a target for ../ tricks The tests use FastMCP\u0026rsquo;s own client, so they send the same messages Claude does.\nThe most useful habit: after the tool calls, read the files back. A reply doesn\u0026rsquo;t prove what happened on disk. In the prefix version, \u0026ldquo;overwrite my note\u0026rdquo; returned no error. It returned a path. Only listing the files showed it had created a new claude- note next to mine. Correct, as it happens. But the reply alone couldn\u0026rsquo;t tell me that.\nBesides the symlink leak, the tests caught a trailing slash (Work/ quietly wrote a file called Work.md) and symlinks showing up as duplicate search results.\nWhat I Actually Use It For Mostly, it\u0026rsquo;s my study buddy.\nA review after every lesson. When I finish a lesson, I ask Claude to read what I wrote that day and check it. It flags what\u0026rsquo;s wrong or oversimplified while the lesson is still fresh, not months later when I\u0026rsquo;m relying on that note. Searching my own brain. \u0026ldquo;Did I write anything about MMR?\u0026rdquo; Ten seconds later I have my own note, in my own words, instead of a generic explanation from the internet. Scattered notes, one summary. A course assignment ended up spread over six notes: one per lesson. Claude read them all and wrote one note with the complete flow, linked back to the originals. In Claude/, of course. Notes that talk back. In the middle of a lesson I wrote: \u0026ldquo;if you read this AI then remind me to think about token use vs this extra llm step\u0026rdquo;. The next time Claude read that note, it did exactly that. It writes blog drafts from my notes too, following a style guide that is itself a note.\nMy notes stay where they are, and Claude\u0026rsquo;s work lands somewhere I can see it.\nWhat\u0026rsquo;s Still Open Right now it\u0026rsquo;s deliberately plain. Three tools, keyword search, a key on the home network. Next up:\nclaude.ai and my phone. That needs a public HTTPS address and real login, not a key in a header. Better search. Keyword search won\u0026rsquo;t connect \u0026ldquo;hypotheek\u0026rdquo; to a note that only says \u0026ldquo;mortgage\u0026rdquo;. A SQLite full-text index, then embeddings. Obsidian-shaped tools. Backlinks, tags, appending to today\u0026rsquo;s daily note. That\u0026rsquo;s what makes it an Obsidian server instead of a markdown-folder server. Notes are untrusted input too. Web clippings and pasted emails end up in the model\u0026rsquo;s context. A note can contain instructions aimed at the model. Writing to one folder keeps the blast radius small, but I\u0026rsquo;ll keep it in mind before adding more powerful tools. Two Things I\u0026rsquo;m Taking With Me The docstring is the interface. The code is the boundary. Descriptions decide how well the model uses a tool. Path checks decide what it can reach. Never let the first do the job of the second.\nCheck the disk, not the reply. A tool call that \u0026ldquo;succeeds\u0026rdquo; can still have done the wrong thing.\nEvery step in this project gave Claude a bit more access, and every step came with its own check.\nAnd yes, Claude helped write this post. From the Claude/ folder.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/giving-claude-my-obsidian-vault/","summary":"\u003cp\u003eI asked Claude to work with my notes. It couldn\u0026rsquo;t.\u003c/p\u003e\n\u003cp\u003eThere is no Obsidian connector. My options were linking a desktop session to the laptop that holds the vault, or pasting notes into the chat one by one.\u003c/p\u003e\n\u003cp\u003eBut an Obsidian vault is just a folder of markdown files. Anything that can read a folder can serve it. And I already had \u003ca href=\"/posts/what-aws-was-doing-for-me-all-along/\"\u003ea home server\u003c/a\u003e doing nothing most of the day.\u003c/p\u003e","title":"Giving Claude My Obsidian Vault"},{"content":"My day job is AWS. I think in VPCs, IAM roles, Lambdas and managed everything. And I\u0026rsquo;m good at it.\nSo for a side project I wanted the opposite. One Ubuntu box at home, called server. No managed services at all.\nIn about a month it grew from a place to try out n8n into a small platform: automation, an AI browser agent, a short-lived local LLM, and a public product called Stempl. Everything lives in one Git repo and runs on Docker Compose.\nNone of My Usual Answers Applied That was the fun part. Every AWS habit needed a home-grown replacement. And every replacement made me think about what the managed service had been doing for me all along.\nOn AWS I\u0026rsquo;d reach for Here I used What I noticed VPC, security groups A Compose network per stack, plus one shared network for the stacks that need to talk Isolation is a choice per port, not a default ALB or API Gateway A Cloudflare Tunnel (and ngrok for n8n), no open ports on the router Public HTTPS in minutes, but auth is still my job ECS services One Compose stack per service Restarts and deploys are just make \u0026lt;stack\u0026gt;-up CloudFormation or CDK A Makefile and Compose files in Git Less safety, far less ceremony Secrets Manager ~/secrets/\u0026lt;stack\u0026gt;/, outside the repo Works fine, as long as I stay disciplined RDS SQLite in a mounted folder Backups are mine to remember Bedrock Ollama on the CPU, for a day Free and private, but slow Auto Scaling A fixed RAM budget Minecraft and the LLM had to take turns That last row is my favourite. On AWS you never have to choose between your language model and your Minecraft server.\nWhat Runs on It Each service is its own Compose stack. n8n, the browser agent, Portainer and Hoppscotch share one Docker network, internal-network, so n8n can call the browser agent by name. The rest keep to themselves, and when they do need each other they go through the host: the flight API\u0026rsquo;s gate reaches Stempl on the server\u0026rsquo;s port 8002.\nMost stacks stay on the home network. Three are public: Stempl and the flight API through a Cloudflare Tunnel, and n8n through ngrok.\nStempl. My main project. You upload a dataset and ask a question about every record, and AI agents answer it in batches of five: three new records and two that an earlier agent already answered. The batch only passes if those two agree. API owners can put a Stempl gate in front of their API, so agents pay for access with that work instead of money. It\u0026rsquo;s live at stempl.dev and has its own post. Flight API. A made-up flight API at flights.stempl.dev, the live demo for the Stempl gate. The API has no gate code at all. The gate runs in front of it as a proxy, and the API itself has no published port. n8n. Workflow automation. The editor runs on the home network, and an ngrok container gives it a public URL so webhooks from outside can reach it. It\u0026rsquo;s the glue that sends tasks to the browser agent. Browser agent. Built on Browser Use, with Gemini 2.5 Flash through OpenRouter. n8n sends it tasks over HTTP, including a structured endpoint for posting to Reddit. A noVNC view lets me watch the browser live from my phone, or step in to solve a CAPTCHA. Obsidian MCP server. Two containers. One keeps my Obsidian vault in sync through Obsidian Sync, the other serves it to Claude as MCP tools with FastMCP. Claude can search and read every note, but can only write in a Claude/ folder. Docker enforces that too: the vault is mounted read-only, with only Claude/ writable on top. Every request needs a secret token, and it never goes on the tunnel. Windows 11 VM. dockur/windows runs Windows in a container with QEMU/KVM, on 8 GB of RAM and 4 cores. I use it from my laptop over Remote Desktop. Media server. MiniDLNA streams my media folder to devices on the network, next to a small web page that downloads torrents and magnet links with aria2. Minecraft. A Paper 1.20.6 server with 4 GB of RAM and room for 10 players. Message of the day: \u0026ldquo;Find the Button!\u0026rdquo; Portainer and Hoppscotch. A dashboard for the containers, and an API client for testing endpoints. Yes, a Windows VM and a Minecraft server are running next to an AI platform. It\u0026rsquo;s a home server. That\u0026rsquo;s allowed.\nA 26B Model on a CPU The first version of Stempl labeled data with a local model: Gemma 4 26B, served by Ollama on the server\u0026rsquo;s CPU. No GPU. Ollama ran as its own container in Stempl\u0026rsquo;s Compose stack, with no published ports, so only the app could reach it.\nGetting a 26B model to behave on a CPU, next to everything else, took a few choices:\nStructured output. Every request passed a JSON schema as Ollama\u0026rsquo;s format. So every answer was valid JSON with exactly the fields the user defined. No reasoning tokens. think: false kept the time per record reasonable on a CPU. One request at a time. OLLAMA_NUM_PARALLEL=1 and one loaded model. Parallel requests would only queue inside Ollama anyway. Bounded context. A 4K context window, with each record cut to 8,000 characters (about 2–3K tokens). Sharing memory. OLLAMA_KEEP_ALIVE=10m unloaded the model after 10 idle minutes. That freed about 17 GB of RAM for Minecraft. Self-starting. The worker waited for Ollama to come up, pulled the model if it was missing (a 17 GB download on the first run), and retried failed calls three times. It worked. A full labeling pipeline with no API costs.\nIt also lasted one day. The model went in on September 29 and came out on the 30th.\nOne CPU-bound model caps your throughput, and there\u0026rsquo;s no bigger instance to click. So Stempl moved on: now AI agents fetch batches over an API and their answers are checked against each other. The local model is still on the roadmap, to seed a few \u0026ldquo;gold\u0026rdquo; answers that the owner confirms.\nHow I Keep It Manageable Everything runs on Docker Compose. On purpose.\nWith one host, Kubernetes would add work and give nothing back. That\u0026rsquo;s not a hot take. It\u0026rsquo;s just one machine.\nA few rules keep it sane:\nOne Makefile. make \u0026lt;stack\u0026gt;-up and make \u0026lt;stack\u0026gt;-down for every stack. The stacks on the shared network start the base stack first, which creates it. make up starts the everyday stacks; the tunnel, the Windows VM and the Obsidian server are started on their own, because they need a login or a lot of RAM first. Secrets outside the repo. Every stack with secrets reads them from ~/secrets/\u0026lt;stack\u0026gt;/, and the repo only holds an env.conf.example. Signing keys live there too and are mounted read-only. Stempl refuses to start without its key. Nothing installed on the host. No pip, venv or npm on the server. Images are built and tests run only in Docker: make stempel-test for unit tests, make stempel-e2e against a throwaway stack, and make stempel-live-test against the running one. Public without open ports. A Cloudflare Tunnel publishes stempl.dev and flights.stempl.dev. The tunnel only makes them reachable. Anyone can look at Stempl, but changes need the admin login, with a lockout after 5 wrong passwords in 15 minutes. What\u0026rsquo;s Next Self-service accounts for Stempl, so API owners, businesses and people with idle agents can sign up without me.\nAnd backups to S3: Litestream streaming the SQLite database, plus a nightly sync of the files. Yes, AWS. I see the irony.\nWhat I\u0026rsquo;m Taking With Me The cloud hides a lot. On one box you feel every trade-off. The local model, the Windows VM and Minecraft all want the same RAM, and there\u0026rsquo;s no bigger instance type to pick.\nA local model is a great teacher. It\u0026rsquo;s free and private, and it shows you exactly what a model needs: a schema, a context budget and retries. Just don\u0026rsquo;t expect throughput from a shared CPU.\nI\u0026rsquo;ll keep using AWS at work, gladly. But building without it made me a better architect there too.\nNow I know what each managed service is actually worth.\nEvert\n","permalink":"https://www.evertboesenkool.com/posts/what-aws-was-doing-for-me-all-along/","summary":"\u003cp\u003eMy day job is AWS. I think in VPCs, IAM roles, Lambdas and managed everything. And I\u0026rsquo;m good at it.\u003c/p\u003e\n\u003cp\u003eSo for a side project I wanted the opposite. One Ubuntu box at home, called \u003ccode\u003eserver\u003c/code\u003e. No managed services at all.\u003c/p\u003e\n\u003cp\u003eIn about a month it grew from a place to try out n8n into a small platform: automation, an AI browser agent, a short-lived local LLM, and a public product called Stempl. Everything lives in one Git repo and runs on Docker Compose.\u003c/p\u003e","title":"What AWS Was Doing for Me All Along"}]