Python

Extensive application of Python for AI agent frameworks, RAG retrieval engines, distributed caches, and FastAPI/Django backends.

1 / From Scripting to Systems

Python started as my prototyping language — quick scripts, algorithmic problem solving, the usual entry path. But over time it became a core engineering language in my work, primarily because the AI and LLM ecosystem is fundamentally Python-first. When I needed to build RAG pipelines, multi-agent workflows, and retrieval engines, Python was not optional — it was where the libraries lived.

2 / AI Agent Frameworks

The most demanding Python work I have done was in Vigil and Foundry. Vigil is an AI agent safety harness that executes agent tool calls inside ephemeral Docker containers, with custom Pytest plugins intercepting system calls and enforcing resource quotas. Building Vigil required careful management of Python's concurrency model — the GIL demanded leveraging asyncio for I/O-heavy sandbox coordination while keeping CPU-bound verification tasks isolated.

In Foundry, Python powered stateful multi-agent evaluation workflows using LangGraph. The state machine graphs coordinated three specialized AI agents evaluating startup architectures, with PostgreSQL-backed checkpointing for decision histories and Celery worker clusters handling heavy async evaluation routines.

3 / Hybrid Retrieval Engineering

Phoenix was a Hybrid RAG engine that combined dense vector search via pgvector with sparse BM25 keyword matching. The Python implementation used SentenceTransformers for embedding generation, FastAPI async endpoints for low-latency retrieval, and Redis caching layers. Managing concurrency limitations under CPU-bound vector similarity scoring was a genuine challenge — the solution was offloading compute-heavy matrix calculations to vectorized NumPy extensions and native database extensions.

4 / Backend Engineering

Beyond AI systems, Python served as the backend language for several web applications. StudyLink used Django with PostgreSQL and pgvector for semantic search across educational documents. Shard — a distributed in-memory caching cluster — was built entirely in Python using non-blocking asyncio event loops and Consistent Hashing ring topology.

5 / What I Have Learned

Python's typing annotations with Pydantic in 3.11+ eliminate a class of dynamic typing bugs that used to plague production APIs. Poetry dependency management prevents the virtual environment conflicts that once cost me hours of debugging across deployment targets. And the honest limitation: Python's GIL means that for CPU-heavy workloads, you either reach for multiprocessing, native extensions, or a different language entirely — which is exactly why I built the same distributed cache in both Python and Java.