Pavan Reddy Mogili

Applied AI Engineer

Pavan Reddy Mogili

An LLM system has to find good sources, check its answers, and keep tool calls within their limits.

  • 97.1%34 of 35 PlanDesk answers
  • 128/128faults caught in a test agent
  • 19 labsone failure mode each

Senior Data Scientist at Fidelity Investments. M.S. in Data Science, Northeastern University. I’m open to roles in applied AI, LLM platforms, and ML infrastructure.

Pavan Reddy Mogili

Applied AI EngineerSenior Data Scientist at Fidelity Investments

I build and test applications that use language models.

I work on retrieval, LLM evaluation, and what happens when an agent’s tool call fails.

I’m open to roles in applied AI, LLM platforms, and ML infrastructure.

Selected work

PlanDesk RAG and LLM evaluation

I built PlanDesk to answer questions about U.S. retirement-plan rules. It looks up archived IRS publications for the year in the question and checks each quote against the original text.

  • 34/35 answerable cases GPT-5.4-mini got right
  • 7/7 out-of-scope questions it correctly declined

Without the IRS sources, the same model answered 33 of 35 in-scope questions correctly (94.3%). It also gave unsourced answers to 3 of the 7 out-of-scope questions.

  • PlanDesk searches the relevant editions of IRS Publications 590-A, 590-B, and 560. It ranks the passages by combining BM25 keyword search and embeddings with reciprocal rank fusion.
  • PlanDesk checks each quotation word for word against the cited passage. It declines to answer if none match.
  • The evaluation uses 42 handwritten questions from development. Code scores the answers using fixed rules.

PlanDesk test examples

Compare GPT-5.4-mini’s answers with and without access to the IRS passages. These are the saved answers, with their original scores and links to any verified quotes.

IRA contribution with an age-based catch-up

For 2025, what is the IRA contribution limit for someone age 55?

PlanDesk Correct and supported

For 2025, the IRA contribution limit for someone age 55 is $8,000. The excerpt says: “For 2025, the IRA contribution limit remains $7,000 ($8,000 for individuals age 50 or older).” It also says: “you can contribute to a traditional IRA up to: • $7,000, or • $8,000 if you were age 50 or older by the end of 2025.”

For 2025, the IRA contribution limit remains $7,000 ($8,000 for individuals age 50 or older).

Pub. 590-A (2025), PDF p. 1

For 2025, you can contribute to a traditional IRA up to: • $7,000, or • $8,000 if you were age 50 or older by the end of 2025.

Pub. 590-A (2025), PDF p. 5

Closed book Incorrect answer

For 2025, the IRA contribution limit is $7,000 total if you are age 55. The catch-up contribution for IRAs starts at age 50, so being 55 does not increase the limit further. If you are eligible and have enough earned income, you can contribute up to the lesser of $7,000 or your earned income for the year. Note that Roth IRA eligibility may also be limited by income.

Out-of-scope HSA question

What is the annual HSA contribution limit for family coverage in 2025?

PlanDesk Correctly refused

Abstain: the provided excerpts do not state the annual HSA contribution limit for family coverage in 2025. The only HSA-related excerpt says a qualified HSA funding distribution must be “less than or equal to your maximum annual HSA contribution,” but it does not give the family-coverage dollar limit.

The distribution must be less than or equal to your maximum annual HSA contribution.

Pub. 590-B (2025), PDF p. 15

Closed book Answered outside the corpus

For 2025, the annual HSA contribution limit for family coverage is $8,550. If the account holder is age 55 or older, an additional $1,000 catch-up contribution is allowed.

First-home withdrawal

How much can I withdraw from my IRA before age 59 1/2 for a first home without paying the 10% additional tax?

PlanDesk Refused an answerable question

The excerpt says you may not have to pay the 10% additional tax if “the distribution is for your qualified higher education expenses” and if “you use the distributions to buy, build, or rebuild a first home.” It also says that for first-home distributions from an IRA, the exception applies to “up to $10,000” of distributions. However, the excerpt does not say whether that $10,000 limit applies to your exact question beyond the general first-home exception, so I can only state that the cited excerpt mentions “up to $10,000.”

The distribution is for your qualified higher education expenses. • You use the distributions to buy, build, or rebuild a first home.

Pub. 590-B (2024), PDF p. 24

don't have to pay the 10% additional tax on up to $10,000 of distributions you receive from an IRA to buy, build, or rebuild a first home

Pub. 560 (2025), PDF p. 34

Closed book Correct without a citation

You can withdraw up to $10,000 of IRA earnings/lifetime total for a first-home purchase without the 10% additional tax, if you qualify as a first-time homebuyer. The funds generally must be used for qualified acquisition costs of the principal residence within 120 days. If you are married, each spouse can use up to $10,000 from their own IRA for their own qualifying first-home purchase. Note that the distribution may still be taxable as ordinary income, even if the 10% penalty is waived. Also, if your IRA is a Roth IRA, separate ordering rules can make some withdrawals tax- and penalty-free depending on contributions, conversion amounts, and the account’s age.

Compare all 42 cases · Full evaluation report · Recorded run files

Count Lineages, Not Checkpoints Research on LLM benchmarks

Many entries on an LLM leaderboard share a base model. I studied how that changes estimates of question difficulty and built modelkin to account for model families.

  • In a simulation based on that archive, 95% confidence intervals for question difficulty contained the true value only 28 to 37% of the time when every model was treated as independent.
  • Accounting for model families gave standard errors 1.4 to 2.0 times as large as treating each model as independent.
  • Accounting for model families did not improve the ranking of flawed benchmark questions compared with the usual screening method.

Of 1,151 entries in this Open LLM Leaderboard archive, 332 (29%) came from one model family.

The research draft, code, and data are public. Read the paper (PDF)

Reproduce Figure 2 in Colab · modelkin release

Turtledove iOS app in development

I’m building an iOS app for couples to make plans, track habits, organize trips, and keep a shared journal.

  • The iOS app supports widgets, Siri, App Intents, and on-device Apple Intelligence.
  • Supabase Postgres uses row-level security to control access to shared data.
  • A Model Context Protocol (MCP) server provides 32 tools. It uses OAuth and lets an AI assistant act for a partner with that partner’s approval.

Turtledove is in a closed TestFlight beta, with a private codebase. Visit Turtledove

A paper tabletop model with a track linking retrieval, inference, tool permissions, and evaluation.
The tabletop follows a single question through an LLM system, from finding sources to checking the answer.

How LLM applications work

Short explanations of retrieval, inference, tool use, and evaluation, in the order they appear in the tour.

The request

LLM system
The language model generates a response. The surrounding application finds sources, handles tool requests, and checks the result.

Retrieval

RAG (retrieval-augmented generation)
The application finds relevant passages and gives them to the model to use when it answers.
Embeddings, vector search, context window
An embedding represents a passage as a vector. Search compares it with the vector for the question. The context window limits how much text the model can read at once.
Grounding and citations
A citation lets a reader check a claim against its source. When there is too little evidence, the application can decline to answer.
Temporal retrieval
The answer can depend on when something happened. Temporal retrieval looks for sources that apply to the date in the question.
Bitemporal records
Records track when a fact applied and when it became known. Keeping corrections alongside older records makes it possible to look up what was known on a past date.

Inference

Model serving
When many people share a model, the serving system queues and schedules their requests.
Batching
The serving system can group requests that arrive close together into one call to the model.
LLM (large language model)
A language model generates text one token at a time. The surrounding application controls any access to private data or external tools.
Tokens and speculative decoding
A smaller model drafts several pieces of text, called tokens, for the larger model to check in a single pass.
Draft and verify
The larger model checks a group of drafted tokens together. Generating those tokens directly would take one pass per token.
Exact sampling
The method preserves the larger model’s distribution over possible outputs while reducing how many passes it needs.

Agents and tools

Tool calling and prompt injection
A model can request tools such as search or email. The application checks each request’s permissions because text the model reads can contain misleading instructions.
Capability tokens (least privilege)
In this demo, a signed token gives an agent one use of one resource. The system rejects the token after it has been used or if it is presented for another resource.
Agents, chains and LangChain
A chain follows a fixed sequence. An agent lets the model choose the next step until it finishes or reaches a limit. LangChain can be used to build both.
Side effects and partial failure
An application can crash after a transfer goes through but before it records the confirmation. It needs a way to recover without repeating the transfer.
Idempotency (safe retries)
With an idempotent operation, a retry has the same effect as the first request. One way to achieve this is for the receiver to keep a record of requests it already applied.

Evaluation

Evals and fault injection
An evaluation checks how an AI system behaves. Deliberately introducing a known fault tests whether the evaluation catches it.
Release gate
A release gate runs checks on a proposed change and blocks it if the results fall short of the criteria.
Benchmark statistics
Many leaderboard entries share a base model. Treating those entries as independent can make a benchmark result look more certain than it is.

Product

MCP (Model Context Protocol)
Model Context Protocol lets an AI assistant discover tools an application exposes and request that those tools run.
Human in the loop
The assistant proposes an action. A person reviews it before the application makes the change.

19 labs on how LLM systems fail

I built these projects to test problems like stale search results and repeated tool actions. The labs use synthetic data and fixed scenarios, and each number describes the test that produced it.

Retrieval Finds the sources the model reads.

  • Stale fact. The lookup uses the record for February 15 as it was known that day. A later correction stays in the history. temporal-rag: found the exact sources in 19 of 19 tests with synthetic facts. A keyword search that favored recent results got 11 of 19.
  • Out-of-scope question. PlanDesk declines because the 2024 and 2025 publications do not establish the limit for 2030. plandesk: declined all 7 questions outside its scope. The same model without sources answered 33 of 35 in-scope questions correctly (94.3%) and answered 3 of the 7 outside its scope.
  • temporal-rag. Searches facts by when they applied and when they were recorded. It cites the matching records and can decline to return a result. Found the exact sources in 19 of 19 tests on synthetic facts. Keyword search that favored recent results found 11 of 19.
  • hard-negative-retrieval. Trains embeddings against plausible but irrelevant matches, then compares a MaxSim-based index with exhaustive search. Recall@5 rose from 0.74 to 1.00 as the search probed more clusters, reaching 1.00 only after exhaustive search of every cluster.

Guardrails Checks tool permissions and verifies quotations.

  • Prompt injection. The tool denies the request because the agent has no permission to write to those notes. capability-guard: HMAC-signed, attenuable capabilities with quotas and replay protection. 17 adversarial tests.
  • Fabricated quote. PlanDesk checks each quotation against the cited passage and declines to answer if none match. plandesk: GPT-5.4-mini answered 34 of 35 answerable questions correctly (97.1%) and declined all 7 outside its scope.
  • capability-guard. Uses HMAC-signed tokens to set limits on agent tool calls. Permissions can be narrowed or revoked, and tokens have quotas and replay protection. Checked in 17 adversarial tests.

Runtime Recovers after a crash without repeating work.

  • Lost acknowledgment. The receiver matches the retried message to the credit it already recorded and skips the duplicate. resilient-agent-runtime: passed all 12 defined failure cases using a transactional outbox and inbox and checking the message contents before deduplication.
  • resilient-agent-runtime. Uses a transactional outbox and inbox to recover after a crash and check message contents before ignoring a retry. Passed 12 of 12 defined failure cases, including an actual process exit after the receiver committed.
  • agent-arena. Tests planning agents that use typed tools and update a route with D* Lite. Repeated breadth-first search provides a reference.

Serving Queues requests and sends them to the model in batches.

  • Traffic spike. The gateway accounts for deadlines and gives clients a fair turn as it groups the 128 requests into 16 backend calls. servegate: batching reduced backend calls from 128 to 16 in this test. The result measures call counts.
  • Network partition. A write that only reaches a minority of nodes never becomes a committed entry. quorum-lab: tests Raft during network splits and restarts and checks the committed entries for consistency.
  • servegate. A model gateway that batches requests by deadline, gives tenants a fair turn, and supports cancellation and circuit breaking. Batching reduced backend calls from 128 to 16 in a call-count test.
  • quorum-lab. Tests Raft during network splits and restarts and checks the committed entries for consistency.
  • model-ledger. A model registry that tracks each artifact by its contents, records lineage, and supports compare-and-swap promotions and rollback.

Data Tracks when events happened and when the system learned about them.

  • Future data leak. The feature store leaves out the purchase. Its cutoff accounts for when the event happened, when it was observed, and which import contained it. chronofeature: a point-in-time feature store tested against an independent scan of the event history.
  • chronofeature. A point-in-time feature store that uses only data available at the training cutoff.
  • incremental-lakehouse. Captures database changes, sets aside records that break the schema, and publishes updates atomically.
  • eventflow. Processes events by when they happened, handles late corrections, and skips duplicates during replay.
  • query-forge. A small SQL engine with a join optimizer, checked against SQLite.

Evals Tests whether changes break expected behavior.

  • Bad release. The release check exits with status 1. A failed or missing case blocks the release. agent-regression: caught all 128 injected faults across 8 fault types in tests on a deterministic agent fixture.
  • Related leaderboard models. Grouping related models by family gave standard errors 1.4 to 2.0 times as large as treating each model as independent. count-lineages: in a simulation based on the leaderboard, nominal 95% intervals covered the true values only 28 to 37% of the time.
  • agent-regression. A release check for agents that scores their answers and tool traces against independently generated expected results. Caught 128 of 128 injected faults across 8 fault types in tests on a deterministic agent fixture.
  • drift-sentinel. Tracks drift as new data arrives, handles delayed labels, and manages alerts as conditions change.
  • tool-calling-lab. Scores tool calls by running them, then uses the results to prepare data for LoRA supervised fine-tuning and direct preference optimization (DPO).

Model behavior Sampling, constrained output and routing.

  • speculative-decoding. Checks that draft-and-verify sampling preserves the target distribution by enumerating the possible outcomes. About 2.4 to 2.7 times as fast in a test on tiny CPU models. Timing varies by machine.
  • constrained-generation. Restricts which tokens can come next based on grammar and state. It checks syntax and meaning separately.
  • model-router. Learns when to choose a cheaper or stronger model under a budget and calibrates that choice on held-out data. At one budget, the router solved 25 of 36 simulated cases. The rule-based baseline solved 23 of 36. The small sample leaves the difference uncertain.
  • pixel-to-program. An encoder-decoder reads an image and writes a program to recreate it. Running the program shows how well it matched.

Search the project READMEs

Find matching excerpts in the project READMEs. Search runs in the browser and links each result to its source.

Experience

Retrieval-augmented generation (RAG), LLM evaluation, and AI agents. I use Python for AI work.

  1. 2019 to 2021 Cognizant Software Engineer, working on software and data engineering.
  2. 2021 to 2023 Northeastern University M.S. in Data Science. Graduate teaching assistant for AI, machine learning, and deep learning.
  3. 2022 Affinia Therapeutics Machine Learning Intern, working with biomedical text.
  4. 2023 to present Fidelity Investments Senior Data Scientist.
  5. Now Turtledove Building the iOS app.
Portrait of Pavan Reddy Mogili

Contact

Email is the easiest way to reach me. I’m open to roles in applied AI, LLM platforms, and ML infrastructure.