Skip to content
All tags

#python

44 posts

Looplane's provider-neutral native loop: from one model turn to a verified terminal state

Looplane's native lane is controlled by AgentRunner: prepare a workspace, request a model turn, execute tool calls, append observations, and enter verification only when the model stops calling tools. Step, wall-time, repetition, token, and cancellation guards can terminate the run independently of the model. Protocol translation belongs to the next article.

Looplane's tool isolation: path allowlists, strict argv, process groups, and credential-free subprocesses

This article follows one Looplane tool call through its mechanical execution boundary: `SafePathPolicy` for paths and symlink escape, fixed argv with `shell=False`, a sanitized subprocess environment, read-version hashes plus atomic replace for writes, and process-group cleanup at timeout. Permission policy, OS containment, and tool programs are reserved for later articles.

A map of Looplane: how one coding-agent task crosses workspaces, runtimes, tools, and events

Looplane turns a coding-agent task into inspectable boundaries: native side effects cross Looplane tools, permissions, and sandboxing, while external runtimes retain their own loops and tools before returning a patch for Looplane audit. This article maps the planned 20-part series.

Harvard CS50 AI Week 1: Knowledge — Propositional Logic, Model Checking, Inference Rules & Knowledge Representation

Week 1 shifts to knowledge representation: propositional logic syntax, model checking, Modus Ponens/Resolution inference, CNF conversion. Projects: Knights (logic puzzles) and Minesweeper (probabilistic inference).

Harvard CS50 AI Week 2: Uncertainty — Probability, Bayesian Networks, Markov Models & Genetic Inference

Week 2 shifts from deterministic to probabilistic: Bayes rule, Bayesian nets with D-separation, Markov chains, PageRank random walks. Projects: Heredity (genotype inference) and PageRank (web ranking).

Harvard CS50 AI Week 3: Optimization — Local Search, Simulated Annealing, CSP & Crossword Generation

Week 3 tackles optimization: hill climbing, simulated annealing escaping local optima, CSP framework with AC-3 arc consistency, backtracking with MRV/degree heuristics. Project Crossword builds a crossword puzzle generator.

Harvard CS50 AI Week 4: Learning — Supervised Learning, k-NN, SVM, Reinforcement Learning Q-learning & Nim

Week 4 enters ML: supervised classification (k-NN, SVM, Perceptron), model evaluation, RL basics (MDP, Q-learning, ε-greedy). Projects: Shopping (purchase prediction with k-NN) and Nim (learning to play via Q-learning).

Harvard CS50 AI Week 5: Neural Networks — Backpropagation, TensorFlow/Keras, CNN & Traffic Sign Classification

Week 5 enters deep learning: perceptron to multi-layer nets, backprop chain rule, loss functions, optimizers, TensorFlow/Keras modeling, CNN conv/pool. Project Traffic trains CNN to classify traffic signs.

Harvard CS50 AI Week 6: Language — N-gram Language Models, TF-IDF QA, Parser & Attention

Week 6 processes natural language: N-gram conditional probability & smoothing, CFG syntax parsing with CYK, TF-IDF vector retrieval, attention mechanism & Transformer basics. Projects: Parser (syntactic generation) and Questions (TF-IDF QA system).

Harvard CS50 AI Synthesis (1): From Search to Language — The Complete Arc of Seven Weeks

Synthesis 1: Tracing how seven weeks form a deliberate knowledge arc from symbolic search to language models, revealing the design philosophy from classical AI to modern ML.

Harvard CS50 AI Synthesis (2): Project Portfolio — All 12 Projects Compared, Difficulty Tiered & Skill Mapped

Synthesis 2: Complete comparison of 12 projects — core algorithms, LOC estimates, difficulty tiers, check50 acceptance criteria, transferable skills. With difficulty grading and learning sequence advice.

Harvard CS50 AI Wrap-up: What's Timeless, What's Changed, and Where to Go Next

Series finale: Retrospecting timeless core from 7 weeks/12 projects, gaps in 2020/2023 recordings vs 2026 reality, free OCW route completeness, and forward roadmap (Transformers, LLM fine-tuning, RAG, Agents, Evaluation).

Harvard CS181 HW0: Do These 4 Problems First — They Tell You What to Patch

HW0 checks CS181 prerequisites in four problems — y=Xw solvability, optimizing an objective, reasoning about randomness, and OLS in Python. The problem that slows you down most is the gap to patch before HW1.

Harvard CS181 HW1: Ice Core Regression — Linear, Kernel, and Neural Nets in One Assignment

HW1 uses an 800k‑year ice‑core temperature dataset to implement three regression models (OLS, RBF kernel, MLP) and compare them on the same data, laying the groundwork for later classification and deep‑learning assignments.

Harvard CS50 AI Week 0: Search — From DFS, BFS, A* to Minimax and Alpha-Beta Pruning

Week 0 opens with search algorithms: BFS for shortest paths, Minimax for adversarial play, Alpha-Beta for pruning. Two projects: Degrees (BFS) and Tic-Tac-Toe (Minimax).

Harvard CS50 AI Guide: Seven Weeks, Twelve Projects, and How to Follow a Course Filmed in 2020

CS50 AI's OpenCourseWare edition publishes seven weeks of lectures, slides, notes, and twelve Python projects with autograder feedback, plus a free CS50 Certificate if you score at least 70% on every project. The catch: weeks 0–5 still use the Spring 2020 recordings; only Week 6 (Language) was re-recorded, in 2023.

Why Python: The Cost and Compensation of Language Choice for Coding Agents

None of the five mature coding agents use Python — pi/opencode/claude-code run on TypeScript, codex rewrote TS into Rust, omp bolted ~80k lines of Rust native crates onto its hot path. looplane still chose Python; the costs are startup performance and packaging, compensated by lazy imports, uv, and Cloudflare Sandbox.

tech deep-dive

Building a Taiwan Stock Research Agent (Part 2): LangGraph Parallel Architecture—Five Analysts Working at Once

Five analysts fan out in parallel within one superstep, so latency is max rather than sum; backtesting and reflection stand before synthesis, restricting the LLM to explaining evidence that already exists.

ai deep-dive

AG2: Organizing Multi-Agent Collaboration with Conversations and GroupChat

AG2 continues AutoGen's ConversableAgent model: agents collaborate through messages, while GroupChatManager selects the next speaker by round robin, manual choice, randomness, or an LLM.

ai deep-dive

Python Coding Agent M11: Why an Exec Loop Cannot Reproduce the Claude Code Conversation Experience

A Claude Code- or Codex-style TUI depends on long-lived sessions, typed transcripts, and approval at tool boundaries—not a screen full of color.

ai deep-dive

DSPy: Compiling AI Programs with Signatures, Metrics, and Optimizers

DSPy replaces handwritten prompt strings with task Signatures, execution Modules, and Optimizers that compile better instructions and examples against a dataset and metric.

ai deep-dive

Haystack Deep Dive: Testable RAG with Components and Pipelines

Haystack turns indexing, retrieval, generation, and evaluation into replaceable Components connected by directed-multigraph Pipelines; it fits Python teams that want RAG flows to be tested, versioned, and deployed as code.

ai deep-dive

LangChain v1 Agents: create_agent, Middleware, and the LangGraph Runtime

LangChain v1 provides a high-level agent loop through create_agent, runs it on LangGraph, and treats tools, structured output, and middleware as its extension boundaries.

ai deep-dive

Pydantic AI: Building Python Agents with Types, Dependencies, and Validation

Pydantic AI models an agent as Agent[Deps, Output]: dependencies, tool inputs, and final outputs are typed, and model results must pass Pydantic validation.

CMU 10-301 HW1: Find ML Foundation Gaps with Mathematics and Python

HW1 is written and programming work: mathematical and CS foundations followed by a majority-vote classifier.

Django: Python Web Applications with ORM, Admin, Auth, and Long-Term Evolution

Django combines data models, migrations, authentication, admin, forms, and security defaults into one system; using it well still requires understanding QuerySets, middleware, async boundaries, and production settings.

tech deep-dive

Scrapy Deep Dive: A Self-Hosted Crawler from Engine to Pipeline

Scrapy separates crawling into the Engine, Scheduler, Downloader, Spider, Item Pipeline, and middleware; it fits high-volume, rule-driven HTTP crawling where you need control over scheduling, throttling, retries, and storage.

tech deep-dive

Selenium Deep Dive: Browser Automation from WebDriver Sessions to Grid

Selenium drives real browsers through standardized WebDriver sessions, making it useful for cross-browser workflows, existing test assets, and remote Grid capacity; it can render JavaScript applications, but it does not guarantee bypassing CAPTCHAs or other anti-automation controls.

ai guide

Apify Complete Guide: How Actors, Tasks, Schedules, and Datasets Form a Scraping Platform

Apify is not a single crawler. It packages scraping programs as Actors, saves reusable configurations as Tasks, triggers them with Schedules, and delivers results through Datasets. It fits teams that do not want to operate queues, schedulers, and workers, but Actor fees, compute, proxies, storage, and transfer all draw from the same platform budget.

ai guide

Browser Use Complete Guide: The Agent Loop Behind Browser Automation

Browser Use combines browser state, model decisions, and actions such as click, type, and extract into a repeatable loop. The open-source package favors custom tools and execution control; Cloud manages browsers, profiles, proxies, and concurrent work.

CrewAI: Organizing Multi-Agent Collaboration Through Role-Playing

CrewAI (GitHub 57.4k stars, MIT, PyPI 11.6M weekly downloads) defines agents by role, goal, and backstory, then groups them into crews for collaboration. Unlike LangGraph's graph-first and MAF's workflow-first approach, CrewAI is team-first — you don't draw nodes and edges, you describe who's on the team and what each person does. It fully removed its LangChain dependency in late 2024 and is now a standalone framework. The commercial side splits into the open-source package and AMP, a managed platform adding visual building, deployment, tracing, and compliance.

ai guide

Firecrawl Complete Guide: Choosing Scrape, Crawl, Map, and Structured Extraction

Firecrawl puts single-page scraping, site discovery, whole-site crawling, and JSON extraction behind one API. Cloud removes browser, proxy, and worker operations; self-hosting gives infrastructure control, but not the complete Cloud feature set.

LlamaIndex Is Not a RAG Framework Anymore, and Old Tutorials Won't Tell You

LlamaIndex (51,775 GitHub stars, MIT, verified 2026-08-21) has moved its center of gravity from indexing to Workflows: the standalone llama-index-workflows package pulls 2.81M weekly PyPI downloads, more than the 1.97M of the llama-index umbrella package itself. This post covers the core abstractions, the trade-off against hand-rolling a pipeline, and a hands-on test of its defaults on Traditional Chinese text — at the same chunk_size=1024, English fits 4,645 characters and Traditional Chinese only 1,332. Plus one fact you need before choosing: the TypeScript port is archived and unmaintained.

ai guide

Scrapling Complete Guide: From Adaptive Selectors to Concurrent Spiders

Scrapling puts HTTP, Playwright browsers, CSS/XPath extraction, and a Spider API behind one Python interface. Adaptive selectors save element properties and relocate a target by similarity after a layout change, but the output still needs validation.

Temporal: Write the Process as Code, and It Finishes Even After a Crash

Temporal is a durable execution platform (Server 1.31.2, Python SDK temporalio 1.31.0, MIT, verified 2026-08). What separates it from BullMQ / Celery isn't scale but the guarantee: a queue guarantees a message gets consumed, Temporal guarantees a multi-call process runs to completion. The price is that Workflow code must be deterministic — and LLM calls are inherently non-deterministic. This post covers how to resolve that tension and when the constraint isn't worth it.

Coding Interview Guide: Strategies for ML-Flavored Programming Problems

AI Engineer coding interviews aren't identical to SWE — beyond LeetCode medium, you'll face ML-flavored problems (implementing a tokenizer, writing a batch inference pipeline, handling sparse matrices). Strategy: practice LeetCode medium to 70% pass rate, then spend remaining time on numpy/pandas operations, data processing pipelines, and ML-related programming problems.

The Deterministic Extraction Layer: Solve 80% of Your PDFs With No Model At All

Digital-native PDFs already contain readable text — what's missing is structure, and heuristics can recover it. PyMuPDF, pdfplumber, pypdf, and Tika do this with zero GPU and zero inference cost. The biggest selection trap isn't accuracy; it's PyMuPDF's AGPL-3.0 license.

tech debug

LLM Agent Tool Descriptions Determine Tool Selection: Three Bug Fixes

Rewriting tool descriptions from soft suggestions to hard rules (whitelist + consequence explanation) eliminated the LLM's incorrect tool selection; adding skip_signal=True fixed vector store double-indexing.

MarkItDown: Convert Any File to Markdown Before Feeding It to an LLM

A lightweight open-source tool from Microsoft that converts PDF, Office, images, audio, and more into Markdown — purpose-built for LLM pipelines.

ai guide

notebooklm-py: An Unofficial Python API for Google NotebookLM

notebooklm-py reverse-engineers Google's batchexecute RPC protocol, letting you programmatically control NotebookLM via Python / CLI / AI Agent — including audio, video, slides, quiz generation and more.

tech guide

Celery: The Standard Distributed Task Queue for Python

Celery is Python's go-to distributed task queue, using Redis or RabbitMQ as a broker to offload long-running work to the background. DaoDao's AI service uses it to handle async tasks like LLM feedback generation.

tech guide

FastAPI: The Go-To Framework for Python AI Services

FastAPI is a modern Python web framework built on type hints — it auto-generates OpenAPI docs, supports native async, and delivers performance close to Node.js. It's the top choice for AI/ML services and the most worthwhile framework to learn in the Python backend ecosystem.

tech guide

Turning a Scraper Script into an MCP Server for Claude to Use Directly

Wrap a local Python script into an MCP Server using FastMCP so Claude Code can call it directly — no more manually running pipelines.

tech debug

MCP Tool Returns 1M Characters: The Token Explosion in search_local_jobs

The MCP tool was returning a description field that caused 1,033 job listings to exceed the token limit. The fix: exclude description by default and add pagination.