← Latest papers
💻 computer science

MEMRES: A Memory-Augmented Resolver with Confidence Cascade for Agentic Python Dependency Resolution

MEMRES is an agentic system that significantly outperforms standard LLMs in Python dependency resolution by employing a multi-level confidence cascade and a self-evolving memory, reserving the LLM as a last resort only after leveraging curated knowledge bases, semantic analysis, and heuristic detectors.

Original authors: Dao Sy Duy Minh, Tran Chi Nguyen, Trung Kiet Huynh, Pham Phu Hoa, Nguyen Lam Phu Quy, Vu Nguyen

Published 2026-04-21
📖 4 min read☕ Coffee break read

Original authors: Dao Sy Duy Minh, Tran Chi Nguyen, Trung Kiet Huynh, Pham Phu Hoa, Nguyen Lam Phu Quy, Vu Nguyen

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to cook a complex recipe, but you've lost the ingredient list. You know the dish requires "flour," "eggs," and "a secret spice," but you don't know which brand of flour, how many eggs, or what the secret spice is called.

In the world of programming, this is called Dependency Resolution. When a programmer writes a piece of Python code, it often relies on other pre-made pieces of code (packages) to work. The problem is: there are over 500,000 of these "ingredients" (packages), and they change names, break, or stop working with new versions of Python.

Previously, the best way to solve this was to ask a super-smart AI (a Large Language Model or LLM) to guess the right ingredients. But this was like asking a genius chef to guess the recipe every single time: it was slow, expensive, and often wrong because the chef didn't have a reference book.

MemRes is a new, smarter system that acts like a super-organized kitchen assistant who knows exactly what to do before even waking up the genius chef.

Here is how MemRes works, using simple analogies:

1. The "Confidence Cascade" (The 6-Step Checklist)

Instead of immediately calling the expensive AI chef, MemRes runs through a 6-step checklist. It only calls the AI if all the other steps fail. Think of it like troubleshooting a car:

  1. Did we fix this exact car before? (Intra-Session Memory)
  2. Is there a manual for this specific model? (Static Compatibility Map)
  3. Do other people with this car use the same parts? (Ecosystem Templates)
  4. What parts do people usually buy together? (Co-occurrence Mining)
  5. Does the mechanic have a rule of thumb? (Heuristic Rules)
  6. Okay, call the AI Chef. (LLM Selection)

By doing this, MemRes solves 86.6% of problems without ever waking up the AI, whereas the old method (PLLM) only solved 54.7%.

2. The "Memory" (The Sticky Note System)

  • Intra-Session Memory: Imagine you are fixing 100 similar cars in a row. If you figure out that Car #1 needs a specific type of spark plug, MemRes writes a sticky note and uses that same plug for Car #2, #3, and #4 immediately. It doesn't re-solve the problem; it just reuses the answer.
  • Self-Evolving Memory: If MemRes encounters a tricky problem and figures it out, it writes a "Tip" (a rule) and a "Shortcut" (a quick fix) into its permanent notebook. Next time it sees a similar problem, it reads the notebook instead of guessing. It's like a student who learns from their mistakes and gets smarter every day.

3. The "Detective Work" (Spotting the Traps)

The old AI often got confused by two specific traps:

  • The "Old Language" Trap: Some code was written in "Python 2" (an old version) but the AI tried to run it in "Python 3" (the new version), causing a crash. MemRes has a special detector that spots the old language immediately and switches the engine to the right version.
  • The "Name Game" Trap: Sometimes code says import cv2, but the actual package is called opencv-python. The old AI got confused. MemRes has a Knowledge Base (a dictionary) with 200+ of these name mismatches, so it instantly knows, "Ah, cv2 means opencv-python!"

4. The "Reality Check" (The Sandbox)

MemRes doesn't just guess; it tests. It builds a tiny, isolated "sandbox" (a digital test kitchen) to see if the ingredients actually work together.

  • If the code needs a specific physical part (like a graphics card driver) that doesn't exist in the test kitchen, MemRes knows it can't fix it and stops wasting time.
  • If the code fails to compile, MemRes tries different versions of the ingredients (like trying a different brand of flour) until it finds one that works.

The Result

  • Speed: The old method took 2 to 3 minutes per code snippet. MemRes takes about 15 seconds.
  • Success Rate: The old method failed on nearly half the code. MemRes fixes 86.6% of them.
  • Cost: Because it rarely calls the expensive AI, it saves a massive amount of computing power and money.

In short: MemRes is a smart, memory-equipped assistant that uses logic, history, and quick rules to solve 9 out of 10 problems instantly. It only calls the "genius AI" for the 1 problem it truly can't solve, making the whole process faster, cheaper, and much more reliable.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →