rr.
Open for systems advisory — Q4 2026

Systems architecture for AI products and the infrastructure underneath them.

I build support and RAG platforms, construction-ops systems, and context-slim, a cache-aware controller that stops LLM agent loops from paying for context management they didn't need.

Selected work

Three systems, one belief

A cost model, a support platform, and a project operating system — each one exists because the honest answer to “can AI just do this?” is “yes, with a human confirming the parts that matter.”

context-slim

A cost-aware controller for LLM agent context — pure Python, zero VRAM, sub-5ms.

Python 3.9+Zero depsblake2b block dedupeOpenAI + Anthropic wire adapters

Problem

Prompt caches are prefix caches: an un-pruned agent loop is append-only, so the whole prompt stays reusable. Naive compaction breaks that prefix — and the re-write can cost more than the tokens it removes. Most context-management tools assume trimming is free. It isn't.

Solution

context-slim is a decision layer, not a summarizer. doctor() finds cache pathologies (lookback overruns, missing breakpoints) before they cost you silently. plan()/apply() compute whether a prune is even profitable — comparing the rewrite cost against the cache savings over a horizon — before touching a single message. "Don't prune" is a first-class, inspectable outcome, not a fallback.

Python 3.9+Zero depsblake2b block dedupeOpenAI + Anthropic wire adapters

Sole author — built in public over 14 days, benchmarked against a live API.

GitHub

Telely

Docs-powered AI support for solo developers — chat widget, RAG, human escalation via Telegram.

NestJSPrismaFastAPIpgvector

Problem

Solo founders can't staff a support inbox, but a pure AI bot that hallucinates or stonewalls a frustrated visitor is worse than no bot at all. The gap is a system that answers confidently from the founder's own docs and knows exactly when to hand off to a human, on the founder's phone.

Solution

A four-service architecture with one integration rule (widget → core only, dashboard → core only, core → ai only): a Preact embed widget, a NestJS + Prisma core that's the system of record, a FastAPI service doing RAG ingest/retrieval over Postgres + pgvector, and a Next.js founder dashboard. Escalation triggers on low grounding confidence or an explicit request for a human, routed to Telegram so the founder can reply from anywhere.

NestJSPrismaFastAPIpgvectorNext.jsPreactTelegram Bot APIDocker Compose

Architecture, backend (core + ai), and the escalation/notification pipeline.

GitHub

Yeksaz

A localized project operating system for construction — from site reports to an AI employer assistant.

Localized UIVoice transcriptionRAG over project memoryWallet/ledger engine

Problem

Construction projects fail quietly: decisions live in phone calls, voice notes, and WhatsApp threads instead of one record. The project owner is paying for everything but learns about problems last, and Tuesday's decision gets silently overwritten by Thursday's group chat.

Solution

Yeksaz holds the whole project — team, tasks by phase/operation, meetings, daily site reports, warehouse and procurement, the money ledger, and plan uploads — as one searchable record. On top of that sits an Employer Assistant that orients, surfaces decision cards, and drafts actions in the team's own language, and an Agent Hub the wider team can talk to in natural language. Both are built around one non-negotiable: nothing sends, pays, or commits without an explicit human confirmation.

Localized UIVoice transcriptionRAG over project memoryWallet/ledger engineRole-based permissions

Product and systems architecture for the Employer Assistant and Agent Hub confirm-before-commit pattern.

Private — no public repo

Experience

Where the systems thinking comes from

  1. Founding Engineer · Raw

    A health and nutrition tracking platform with intelligent personalization — a React Native (Expo) app on the front end, backed by a food-recommendation and dietary-insight system on the back end.

    • React Native + Expo app with real-time health-metric visualization and camera-based food analysis
    • Dynamic food recommendation system adapting to individual health profiles
    • RAG-based retrieval for personalized dietary insights, plus NLP for automated food analysis
    • Phone-verified auth and an adaptive learning system for surfacing health patterns
    Dec 2024 – Aug 2025
    United States
  2. Frontend Developer · micro1

    3.5 years at a fast-growing AI company, across five high-impact projects — React.js front-end work applying generative AI, AWS, and adaptive-learning technologies.

    Jun 2021 – Jan 2025
    United States
  3. Full-Stack Developer · Megastudio

    A full-stack yoga and Lagree app (Tailwind, Express, MongoDB, TypeScript) with a multi-role panel system for admins, users, and coaches, a secure payment module, and an internal gamification feature.

    Apr 2024 – Aug 2024
  4. Frontend Developer · Maven: The Serendipity Network

    Feb 2023 – Sep 2023
    United States
  5. React Developer · Udefy

    Aug 2022 – Mar 2023
  6. React / Django Developer · Stock Sniper Trading Corp

    Nov 2021 – Dec 2021
    Canada

Open-source infrastructure · flagship

context-slim: is pruning even worth it?

Measured against a live API, n=5 arms per condition, bootstrap 95% confidence intervals. Prompt caches are prefix caches — an un-pruned agent loop is append-only, so the whole prompt stays reusable. Pruning breaks that prefix, and the re-write can cost more than the tokens it removes.

installbash
pip install git+https://github.com/Ramtin2000/context-slim
usagepython
from context_slim import doctor, plan, apply

# 1. Find cache pathologies that cost money silently.
for d in doctor(messages, model="openai/gpt-5.6-luna"):
    print(d.code, d.message)

# 2. Decide what is worth pruning. Pure — no I/O, no mutation.
p = plan(messages, model="openai/gpt-5.6-luna", horizon=30)
for v in p.verdicts:
    print(v.decision.value, v.reason)

# 3. Execute only the approved edits.
messages, report = apply(messages, p)
print(report)

Zero runtime dependencies. No model, no GPU, no network. Python 3.9+. Not on PyPI yet — install from source.

StrategyTokens sentCache hitCost / armvs. no pruning
don't prune928,40092.2%$0.007053
prune oldest-first735,79075.5%$0.011239+59.4%
prune newest-first735,77081%$0.009376+32.9%

Cache hit rate by turn

60708090100t2t5t8t11t14t17t20don't prune — turn 2: 95%don't prune — turn 5: 96%don't prune — turn 8: 96%don't prune — turn 11: 96%don't prune — turn 14: 77%don't prune — turn 17: 97%don't prune — turn 20: 97%97%oldest-first — turn 2: 95%oldest-first — turn 5: 96%oldest-first — turn 8: 63%oldest-first — turn 11: 77%oldest-first — turn 14: 76%oldest-first — turn 17: 77%oldest-first — turn 20: 75%75%newest-first — turn 2: 95%newest-first — turn 5: 96%newest-first — turn 8: 93%newest-first — turn 11: 91%newest-first — turn 14: 76%newest-first — turn 17: 77%newest-first — turn 20: 60%60%
don't pruneoldest-firstnewest-first

Why the dedupe is built the way it is

A byte-level rolling hash is one interpreter iteration per byte in pure Python. str.split + blake2b does the same job at block granularity with both halves running in C — measured on ~93 KB.

  • rejected: 64-byte rolling hash (per-byte Python loop)25.26ms
  • shipped: str.split + blake2b (per-block loop)0.24ms
  • shipped: full dedupe_blocks pass0.54ms
  • shipped: collapse_whitespace1.06ms

104× faster on the hashing step. The rejected implementation ships in the repo so the comparison is measured, not asserted.

The cost model is checkable

This predicts how much of a request the API will report as cached before the call, then diffs against usage.prompt_tokens_details. Measured over 24 live requests.

MetricRawCalibrated
prompt-token error (median)26.11%0.64%
cached-token error (median)25.80%0.84%

No dollar figure in the repo comes from the estimator — those all read the provider's usage counters.

Caveat this properly

  • 8k-token prefixes, 20-turn loops, synthetic conversations — one model (gpt-5.6-luna), one account.
  • Larger contexts over longer horizons are untested and may behave differently.
  • Three earlier revisions of this experiment produced confident numbers that turned out to be artifacts — see METHODS.md for what went wrong and how it was caught.