python
Technical notes on web development, DevOps, and AI integration.
51 articles
- 11:31ai
Duplicate-Gate Blind Spot: Vector Coverage and 0.50
A cosine-similarity duplicate gate is only as good as its vector coverage. Lessons from a 32-article blind spot and a self-measured 0.50 cutoff.
TL;DR: I nearly trusted a duplicate check running on a half-populated index, since 164 of 196 articles had vectors and the missing 16% never showed up. The fix was a backfill plus a self-check confirming each article's own title returns its slug. The 0.50 cutoff isn't universal either; measure your corpus's own score distribution first.
#embedding#python#automation - 17:26devops
Three Fixes That Tamed My Server Monitoring Dashboard
A server monitoring dashboard becomes noise when attention items pile up with no organization. Three complementary fixes transform a flat grid into a usable workflow.
TL;DR: Dashboard Guy Eighteen flat grid of alerts made it impossible to find critical issues across nine servers. Backend search with debounce, severity filter buttons, and collapsible server groups solved the noise problem by pushing all filtering logic server-side. Three tools together let you triage from hundreds of items in two taps or three words.
#monitoring#ux#devops - 10:36devops
One API Key Just Stops Research at 429
A 429 rate limit froze my research pipeline. Designing multi-key rotation: per-HTTP-status cooldown, single-pass failover, and errors that should not rotate.
TL;DR: The pipeline hit 429 rate limits, so the author added key rotation with per-status cooldowns: 60s for 429, 300s for 402, an hour for auth errors. Rotation is single-pass to avoid infinite loops, and request errors like 404 throw immediately. The author stresses rotation only raises ceilings; fix wasteful requests first.
#firecrawl#python#automation - 12:23ai
Stealing OpenViking's L0 Pattern for My Research Knowledge Base
Queries returned just a path and a score. So I stole OpenViking's L0 summary pattern: one line per dossier, no new infrastructure.
TL;DR: Search results in my knowledge base showed only scores, so I kept opening dossiers just to judge relevance. Rather than install OpenViking, I stole its L0 tier pattern and added a mandatory one-line summary field to each dossier in about 40 lines of Python. Making summaries a hard requirement keeps them consistent, no new dependency needed.
#ai-agents#embedding#python - 22:52tooling
Green Selftest, Then an ImportError Caused by a File Name
A CLI tool named keyword.py passed its own selftest yet broke import collections. sys.path order and a transitive import turned out to be the trap.
TL;DR: Naming a local file keyword.py shadows Python's stdlib keyword module because the script directory sits first in sys.path. The trap stays hidden until collections transitively imports keyword and crashes with a confusing ImportError. Fix: avoid stdlib names, run a quick import check, and use Python 3.11's -P flag as backup.
#python#tooling#debugging - 02:34ai
AI Agent Auto-Publishing: Brakes Beat Gas
A blog pipeline that researches, writes, verifies, and publishes on its own, plus the four gates that make it trustworthy.
TL;DR: The author's blog publishes articles fully automatically via a 2-hour cron pipeline that researches, drafts, verifies, and posts without human touch. Safety comes from strong brakes: verification gates that reject bad content, automatic rollback after publishing, and escalation to humans for taste calls. Full-auto is trusted only for mechanical tasks; editorial judgment stays human.
#ai-agents#automation#ci-cd - 02:34backend
Semantic Search on a 1GB VPS Without a Vector DB
Pure-Python cosine, vectors in MariaDB postmeta, embeddings computed locally. Semantic features with no new service on a small server.
TL;DR: Running a blog on a 1GB VPS rules out a vector database, so the author computes bge-m3 embeddings locally via Ollama and stores them as JSON in MariaDB postmeta. Related-article matching and dup-checks use pure-Python cosine similarity, fast enough for around 100 articles. Lesson: for small blogs, skip Qdrant or pgvector until scale demands it.
#python#fastapi#embedding - 16:40backend
Bare python in a Docker entrypoint picks the wrong interpreter
The knowledge seed failed on every container start although the script was in the image. Bare python resolved to the system interpreter.
TL;DR: The CI seed script failed because bare python resolved to the system interpreter, which had none of the project's packages or venv site-packages on its path. Running a script file by path skips CWD, so cd didn't help either. Fix: call the venv interpreter directly with PYTHONPATH set to the project root.
#docker#python#deployment - 11:45backend
Twelve entries locally, eight on the VPS
Hand-typed knowledge entries never reached the VPS. A repo-tracked seed file, upserted on every container start, keeps both databases converged.
TL;DR: Hand-typed knowledge entries lived only in the local database, so the VPS was missing four. The fix is a seed file plus a small seeder running on every container start, using INSERT ... ON DUPLICATE KEY UPDATE keyed on slug.
#mariadb#docker#python