Posts

Build a RAG App with FastAPI — MiniLM Embeddings, a Chroma Store, and a Refusal That Works, Step by Step

Image
Ask a language model about your documents — your shop's prices, your team's manual — and it will still answer. Confidently, and wrong: it is guessing from its training, not reading your page. RAG — retrieval-augmented generation — is the fix: keep your documents in a searchable store, fetch the few chunks that match the question, and let the model answer from those chunks only. An answer built that way is called grounded . In this post we build the whole thing with FastAPI: a small shop catalogue goes in, grounded answers come out — including the two moments most demos skip: the app refusing when the answer is not in the documents, and the app going stale when a document changes. Every output below is from the real run. The map — everything follows it, in two rows. Index time (runs when documents change): documents → chunks → embeddings → store. Query time (runs per question): question → retrieve → prompt → model → answer. What you need Python 3.10 or newer....

Connect a FastAPI App to Oracle AI Database — Thin Mode + Wallet, a Real Pool, Step by Step

Image
Your FastAPI app is useless without a database — and connecting Python to Oracle used to mean installing a heavy client and hunting for config files. Not anymore. One pip install, a small key file called a wallet, and a real connection pool. By the end of this post your app will answer live requests from a real Oracle database — and you will have proof inside the database itself. The map — everything follows it: a user sends a request → it lands on our FastAPI app → the app borrows a connection from a pool (connections kept open and ready, like taxis at a rank) → the pool talks to Oracle AI Database , which stores our rows and answers questions in SQL . Every step below lights one leg of this map. What you need Python 3.10 or newer. An Oracle Cloud account (the free tier is enough — this whole tutorial costs $0 ). About 20 minutes. Step 1 — Meet the database Oracle AI Database is Oracle's database service in the cloud: you install nothing; Oracle runs it, you just c...

Build Your Own Coding Agent in Python — A Beginner's Step-by-Step Guide (Every Step Explained)

Image
An AI agent is a program that thinks with an AI model and acts through tools. In this beginner-friendly build, you will write one small Python program — a coding agent — hand it a real failing test, and watch it find the bug, propose the exact fix, and then stop and wait for your permission before it changes anything. By the end, a test suite that starts at 1 failed, 3 passed ends at 4 passed , and the whole run costs less than one cent. Every step is explained in plain words, with a screenshot — no experience with agents is assumed. This is the beginner-first edition of our coding-agent build. If you already know what an agent is and want the denser reference version, read the original build instead: Build Your Own Coding Agent in Python (It Fixes Real Code — Behind an Approval Gate) . This post covers the same machine more slowly, and adds the two things beginners asked for: what every part means , and what to do when it breaks. What you need (versions used in this post) ...