Skip to content
Nirav Vaghasiya

Work

Case studies in agents, memory and evaluation.

Three flagship systems with full write-ups — problem, architecture, decisions, results and limitations — followed by supporting projects. Every claim links to the repository that backs it.

Flagship

MEMORY STORE · 8 TYPESsuperseded → current, never deletedrecallRETRIEVALmulti-signal · budgetedtoken budget≤ capobserve → filter → attend → retrieve → reason → storeconsolidate · forget every N turns

Cognitive runtime for AI agents

Published on PyPI · runtime in alpha

BrainOS

A neuroscience-inspired cognitive runtime that gives long-lived agents typed memory, budget-aware retrieval, working memory, consolidation and safety behind one small Python API.

50-turn prompt-token benchmark

Source (opens in a new tab)

424,361 → 79,381

Author-reported simulated conversation; counted with tiktoken (cl100k_base).

  • Memory systems
  • Retrieval
  • Continual learning
  • Agent safety
100%0%18.Bd6 · BLUNDER74% → 50%LLM COACH NOTEfree prosecheck_faithfulnessnumbers must match

Grounded LLM annotation

Live demo on Hugging Face Spaces

Chess Analysis Engine

Paste a game and get Stockfish evaluations, move labels, accuracy and ACPL — plus coach notes whose selected numerical and move-label claims are checked against engine output before display.

Immortal Game regression · 18.Bd6

Source (opens in a new tab)

74.3% → 50.0% · Blunder

Depth-16 Stockfish fixture; 288 centipawns lost; engine preferred Re1.

  • LLM evaluation
  • Faithfulness
  • LangGraph
  • RAG
THINKllmACTtoolOBSERVEresultLLM3 providersMEMORYwindow+summaryTOOLS@tool → schemaRAGtf-idf / embedone file · two dependencies · fail closed

Single-file agentic framework

v0.4.0 · pre-1.0

Unchained

An agentic AI framework — tools, memory, RAG, structured output and multi-agent routing — written as one readable Python file with exactly two dependencies.

Offline test surface

Source (opens in a new tab)

488 test functions

Counted from three public test modules; CI spans Python 3.9–3.13.

  • Agents
  • Tool calling
  • RAG
  • Multi-agent orchestration

Supporting

ROUTERCONVERSATIONGRAMMARVOCABULARYCULTURALEVALaccept · revise · abstain → learner model → FSRS reviewLANGGRAPH · 7 SKILLS · CEFR

Multi-agent adaptive tutor

2026

Polyglot Swarm

A self-hostable multi-agent language tutor that turns conversation into per-skill mastery evidence, schedules review with FSRS and plans the next most valuable thing to practise.

5-arm ablation · 30 ADRs

Deterministic fake-LLM mode; no study with real learners and CEFR is not human-validated.

  • Multi-agent systems
  • Learner modelling
CONDITIONS × CATEGORIESABCDEsingle · multi · temporal · conflict · distractor · x-session · abstainRecall@Kevidence-in-promptpaired t · ddegradation AUC9-label failures

Context-engineering experiments

2026

BrainOS Context Lab

An experimental platform for testing whether external cognitive memory can shrink prompt context in long conversations without losing task performance — with controlled baselines, ablations and a failure taxonomy.

Controlled comparison design

Source (opens in a new tab)

5 conditions · 4 ablations

Current observations use one seed/length tier, an estimated token counter and no model in the loop.

  • Evaluation design
  • Benchmarks
14 MODULES · 104 NOTEBOOKSsoftmax(QKᵀ / √dₖ) VW′ = W + BA (LoRA, r ≪ d)

Mathematics curriculum

2026

Maths for AI

104 Jupyter notebooks across 14 modules — from linear algebra and calculus to information theory, statistical learning theory and the mathematics behind transformers, LoRA and diffusion — each with a from-scratch NumPy or PyTorch implementation.

Verified curriculum footprint

Source (opens in a new tab)

104 notebooks · 14 modules

Counted from numbered curriculum folders; excludes template and test-fixture notebooks.

  • Deep learning foundations
  • Optimisation
HNSW · TRIES · KV CACHE · BEAM SEARCH>>> run in browser · pyodide worker

Interactive knowledge base

2026

Algorithms for AI

43 in-depth guides connecting classic data structures and algorithms to where they appear in AI/ML/LLM systems, with in-browser Python via Pyodide/WebAssembly and step-by-step algorithm animations.

Verified repository content

Source (opens in a new tab)

43 guides · 43 practice pages

Repository count; the currently deployed GitHub Pages build still serves the earlier 31-guide version.

  • Algorithms
  • Interactive learning

Also on GitHub

Software projects outside the AI/ML focus of this portfolio, listed for completeness.

  • Local-first personal CRM and network-graph analyser with community detection, betweenness centrality and warm-introduction pathfinding over a LinkedIn connections export.

    TypeScript monorepo · Drizzle · SQLite/Postgres · Next.js

  • A client-side study site for the CCDV-F exam with blueprint-mapped notes, quizzes and a timed practice exam. No backend, no affiliation with Anthropic.

    Next.js · MDX · TypeScript