SijanNotes
Research & Engineering
All Notes
March 20268 min read
Cutting LLM Token Cost 74% with Hybrid Retrieval
Why stuffing an LLM's context with everything is expensive and imprecise — and how BM25 + pgvector fused with Reciprocal Rank Fusion fixed it.
RAGpgvectorBM25LLM Cost
April 20269 min read
Guardrails for a 25-Tool Clinical Agent
Designing a LangGraph dual-agent system that's useful in a healthcare setting without ever hallucinating a clinical claim.
LangGraphAgentic SystemsHealthcare AIGuardrails
May 20267 min read
The N+1 Tax: Rewriting Python Loops as SQL Views
A benchmark-driven walkthrough of replacing N+1 query patterns with set-based PostgreSQL views — 2.64× faster, measured across 18 runs.
PostgreSQLPerformanceSQLAlchemy
June 202610 min read
QLoRA Economics: What 4-Bit Fine-tuning Actually Buys You
The real numbers behind fine-tuning Llama, Mistral, HyperCLOVA X, and Qwen2 on consumer and Kaggle-grade GPUs.
QLoRAPEFTFine-tuningLLM
July 20267 min read
Gating Prompt Changes in CI
Prompts are code. Here's the offline LLM-as-judge evaluation harness that stops a prompt tweak from shipping a regression.
LLM EvaluationCI/CDLLM-as-Judge