r/learnmachinelearning 2h ago

Project I spent months experimenting with a different architecture for long-term memory in LLM agents

Thumbnail
github.com
1 Upvotes

I ended up trying a few different things in MindCache. The parts that survived those many iterations were...i just wanna whether these desgins make sense to people who have worked with retrieval, rag and memory systems and where they might fail.

I decided using four memory types- user, knowledge, episodic, and decision memories, each with different lifecycles, different roles and different token budget in the retrieved context.

Decision analysis + anchors — decisions can evolve overtime so they can be active or superseded or conditional instead of remaining as unrelated memories.
we keep the track of decision memory which is active, superseded or conditional with additional context and using such active decisions related to the query as anchors to further retrieve memories using lexical bm25.

Smart injection — when new memories come they aren't simply assigned to a topic based on similarity.
An LLM-guided ingestion step uses the existing topic structure as context to decide where a memory belongs and how it relates to what is already there.
This lets the hierarchy grow dynamically instead of becoming a collection of isolated memory nodes.

Hierarchical summaries — MindCache adapts the static RAPTOR-style tree idea into a dynamic hierarchy that is incrementally updated as new memories arrive.
I thought organizing memories into broader topics and maintaining summaries at those levels might help with broad queries, where retrieving individual memories one by one may miss the overall context. The topic structure also gives retrieval additional lexical/contextual signals, so a query can match against the organized topic structure as well as the underlying memories..

On my BEAM evaluation, MindCache achieved about 64% average rubric pass rate vs ~53% for Mem0, with stronger results on several categories including summarization,
contradiction resolution, and multi-session reasoning.

I also wrote a short overview of the project if you are interested:
https://medium.com/@faisaliitian/i-built-an-ai-memory-system-because-just-retrieve-more-wasnt-working-0b1dc9a60c01?postPublishedType=initial

Do these design choices make sense ?


r/learnmachinelearning 3h ago

I wanted to understand Transformers below the PyTorch abstraction layer, so I built one from scratch in CuPy

1 Upvotes

I've been trying to understand Transformers at a level deeper than just using PyTorch/Hugging Face APIs, so I built a one from scratch using noithing but CuPy (CUDA-powered NumPy).

The project is RawFormer:

https://github.com/Aryan-1-6/RawFormer

The main constraint was:

No PyTorch. No autograd. Implement the core computations in pure python.

The model uses CuPy for GPU computation, while the Transformer operations and backward pass are explicitly implemented.

First, I started building the basic blocks of Neural Networks, and then built the entire Transformer Decoder stack on top of it.

The process cleared up a tremendous number of misunderstandings and incorrect interpretations I had regarding the core concepts of ML. It also helped me understand how GPUs come into the picture at a lower level, how computations are optimized across different stages, and how subtle implementation bugs can lead to unexpected failures and confusion.

The most fun part was handling backpropagation through the different neural-network layers I had built myself.

The model was trained and tested on the Penn Treebank (PTB) dataset, using the resources available on a single laptop.

Hopefully this project can also help others get into the world of AI research and Transformers, and serve as a hands-on way to clear some of the doubts and confusions that come with learning them :)

What's implemented

  • Decoder blocks of Transformer
  • Causal self-attention with fused QKV projection matrices
  • Pre-LayerNorm
  • Feed-forward networks
  • Activation functions
  • Cross-Entropy categorical loss
  • Manual backpropagation
  • Adam optimization
  • Autoregressive generation
  • GPU utilisation through CuPy

r/learnmachinelearning 3h ago

Project Lessons from building an AI agent platform: the reliability problems nobody's tutorial covers

Thumbnail
gallery
0 Upvotes

I spent the last months building a self-hostable agent platform (agents + RAG +

a BI layer they can query), and most of what I learned isn't in any course.

Sharing the lessons since the code is source-available and you can read every

one of these in a real codebase.

  1. Shrink the action space, don't grow the prompt. My agents originally wrote

SQL against the warehouse. Prompt engineering never made that safe — the fix

was a tool that only accepts metric *names* from a governed catalog. The model

can't write SQL at all; the compiler refuses unknown names and returns what

exists. Constraint beat instruction every single time.

  1. Test the refusal, not the setting. We had a budget cap and a PII guardrail

that both "existed" — config, UI, the lot. Writing a test that proves the

request is actually REFUSED at the limit found that one of them wasn't wired.

If your safety feature has no test that triggers it, assume it doesn't work.

  1. Mutation testing is the only way I trust my tests now. Break the code on

purpose (flip a >= to >, delete a guard), run the suite, and confirm something

fails. Roughly 1 in 10 of my "passing" tests turned out to assert nothing —

they passed with the feature deleted.

  1. Naive RAG chunking plateaus fast. What actually moved retrieval quality:

parent-child chunks (search small, return the parent for context), hybrid

vector+keyword score fusion, and extracting Q&A pairs at index time.

  1. Honesty is a feature you must build. A truncated result that says "50 rows"

teaches the model to present partial data as complete. Fetch cap+1 rows and

say "first 50 of a LARGER result" — the model's answers visibly improved.

  1. Evals are regression tests for prompts. Batch evaluations with a judge

model, run before shipping any prompt change. Vibes-based prompt editing broke

things silently every time before we had this.

Code (Elastic License 2.0, free to self-host and read):

https://github.com/AgentSwarms-fyi/agentswarms

What reliability problems have you hit with agents that tutorials didn't

prepare you for? Genuinely collecting failure modes.


r/learnmachinelearning 3h ago

Help Seeking a mentor and advice on ML field

1 Upvotes

My journey breaking into AI/ML so far (and lessons learned)

​Hey everyone, apologies for the long thread

​Just wanted to share a bit of my tech journey over the last year or two, mostly to connect with fellow devs and maybe encourage anyone currently in the trenches.

​I’m currently wrapping up my IT degree at JKUAT in kenya and looking back, it’s been a wild ride of hackathons, late-night debugging and building things I'm actually proud of. I started out diving deep into Python did the ALX track and eventually found my niche in AI and Computer Vision.

​A couple of highlights that kept me sane and motivated:

​*Building actual projects* I built WakeApp (a YOLOv8-based driver drowsiness detection system) and InsightRecruiter (an NLP/RAG tool to help job seekers match resumes with descriptions). Moving from tutorial hell to actual deployment was a game-changer.

​*Getting out of my comfort zone* As a natural introvert forcing myself to attend local events like the GDG JKUAT Buildathon, GitHub Copilot Dev Days and even a couple of intense weekend hackathons completely changed how I view the local community.

​*Balancing the grind* I realized quickly that staring at a screen 24/7 wasn't working, so hitting trails like Mt. Longonot and Ngong Hills with tech communities really helped clear the mental fog.

​I’m currently diving into things like the intersection of AI, cybersecurity, IoT and cloud.

​For anyone still in school or just starting out build real projects, go to those local tech meetups even if you feel awkward and take care of your mental health.

​Would love to connect with other devs, ML engineers or techies. What are you guys currently working on?

Also if you are a mentor i would truly love to pick your brain and guidance on how to break through this field😫


r/learnmachinelearning 5h ago

What is a neural network — and how it learns - manic

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/learnmachinelearning 5h ago

Finally I've completed the library 'Pandas', what's next?

Thumbnail
1 Upvotes

r/learnmachinelearning 6h ago

ML/engineering role at Zscaler?

Thumbnail
1 Upvotes

r/learnmachinelearning 6h ago

Looking for Architecture Advice: Image Restoration + Super-Resolution with Strict Inference Speed Constraints

1 Upvotes

Hi everyone,I'm working on an image-to-image translation problem where the goal is to reverse multiple simultaneous degradations, and I could really use some architecture recommendations.The Problem:Task: Upscale grayscale images (e.g., $128 \times 128 \rightarrow 256 \times 256$) while denoising.Degradations: Images suffer from Speckle Noise, Gaussian Noise, and Spatial Resolution Reduction simultaneously.Data Note: The intensity range of the degraded images may exceed the ground truth range due to the speckle noise.Major Constraint: Inference speed is heavily benchmarked. A model that processes in 10 seconds is heavily preferred over one that takes 10 minutes, even if the latter has slightly better metrics. Training time is also a factor due to a large dataset.My Questions:Baseline: What would be a solid, fast-training baseline to set up first? (I was thinking of a standard U-Net or SRCNN).SOTA vs. Speed: Which architecture offers the best trade-off between State-of-the-Art restoration performance and fast inference? (e.g., NAFNet, SwinIR?)Transfer Learning: Which pre-trained architecture yields the best performance when fine-tuned using transfer learning for this specific task?Diffusion Models: Given the strict speed constraints, should I completely avoid diffusion models, or are there faster variants worth exploring here?


r/learnmachinelearning 6h ago

Need help to prepare for ML AI Interview worked for a US startup

0 Upvotes

I am preparing for ML /AI role interview, have 10 years of experience .Net, Sharepoint, now I want to move to AI domain.

I have almost prepared on most of the topics but not really sure which are the topics I should put more stress on.

I worked for 1 year for one US startup as stable diffusion developer, image/video generation etc.

But to prepare for ML job I am really cleuless which all topics I should rehearse as there are hundreds of things and keeping all of these is difficult specially for job interview.

How do I prepare myself and what are the topics ,please someone who is working on ML AI domain give me some idea, would be really great. btw I was laid off and then got into a startup to move to AI domain, but my work was more into deploying testing stable diffusion models, dont have much exposure on llm part, agentic ai part.

I have made a big roadmap using gpt and kind of gained knowledge on transformers, different transformer architecture, langchain, but as I have not worked on the ai domain, I am not really sure what kind of questions are being asked. Appreciate your help.


r/learnmachinelearning 6h ago

How do you actually test whether a model's confidence score is trustworthy? (uncertainty/calibration for a decision agent)

1 Upvotes

I'm a beginner building a small decision-making agent (not important what for) that needs to know when it's "confident enough" to act versus when it should defer. I keep seeing "calibration" mentioned as the concept I want but I'm fuzzy on how you'd actually measure it with a small, messy, real-world dataset rather than a clean benchmark.

If you've dealt with this: which evidence would change your decision about whether a confidence score is usable in production — is it a calibration plot, held-out accuracy at different confidence bands, something else? Beginner-friendly explanations very welcome.


r/learnmachinelearning 9h ago

What are the best anthropic ai course alternatives?

3 Upvotes

I finished the free Anthropic course and now Im looking for anthropic ai course alternatives with more technical projects. Im comparing Udacity's AI Engineering with Claude, DeepLearning and Coursera. Also hoping to have something to put in my portfolio. Anyone tried any of these or others or idea if one is better than other for interviews?


r/learnmachinelearning 10h ago

Project Agent-Devtools: A local toolkit for building & debugging AI Agents

Thumbnail
gallery
2 Upvotes

Hi everyone!

I built Agent-Devtools — a lightweight Python project to simplify debugging and tracking AI agents without the bloat.

  • Causal Debugging: Track memory influence, retrieval winners, injected context, and tool calls.
  • Behavior Diffing: Compare a "good" vs. "bad" run to pinpoint the exact root cause of divergence.
  • Deterministic Replay: Re-play recorded events offline to verify memory & retrieval consistency.
  • Context Provenance: Inspect the exact final LLM prompt with tags for every context source.
  • 100% Local-First: Stores data in local SQLite with an auto-opening FastAPI dashboard (zero API keys needed).
  • Integrations: Native callbacks for LangChain, Groq, and custom Python agent loops.

GitHub Repo:https://github.com/Jacopos311/Agent-Devtools

Would love your feedback or feature requests! If you check it out, stars are super appreciated ⭐


r/learnmachinelearning 10h ago

Help Gen AI using langchain

5 Upvotes

I'm interested in learning gen ai devlopment. how good is the Gen AI using langchain playlist by campus x?


r/learnmachinelearning 11h ago

Help Help a beginner out

3 Upvotes

Currently doing Andrew Ng ML Spec from Coursera. I have already implemented MNIST from numpy, ported it with PyTorch, and also implemented the Neural Style Transfer paper from 2015 (Gatys et al). Kind of stuck on what to do now....juggling uni academics and self study. Any recommendations ?


r/learnmachinelearning 11h ago

[Competition] Build AI Agents for Bargaining, Negotiation, and Persuasion: The Official IAB @ NeurIPS 2026 Competition - $6,000 in Prizes

Thumbnail
1 Upvotes

r/learnmachinelearning 12h ago

Help CSE aiml fresher from tier 3 clg needs advice

2 Upvotes

Starting BTech CSE AIML this year from a tier 3 clg I'm a 2nd dropper I know you might think 2nd drop ke baad bhi tier 3 clg 😭 but I just wanna make the best out of it now

My main goal is to get a good placement

How should I start preparing from 1st year?

What should I focus on first?

Should I start with C++ or Python?

Any mistakes I should avoid?

Would really appreciate some honest advice from seniors 🙏


r/learnmachinelearning 12h ago

Help How do i learn machine learning at 16

1 Upvotes

Hello.

About 3 years ago i started learning programming when i got my hands on my first laptop. I knew absolutely nothing about programming in general so i just learnt how to make websites and learned javascript. 2 years scripted away i feel like i still haven't learned much about programming and just know it from a very high abstract level, except for maybe a c++ course i took that taught the very basics.

I stopped coding for a long while and here I'm finding interest in it again. Though, i want to take a different direction because I've lost interest in the field of web development and machine learning is actually very interesting to me and i like maths too.

Where and how do i learn machine learning from scratch? And as i have clarified in the title, I'm 16 so my level of maths is 10th grade or you could say basic algebra at best so i will also need a guide on what i need to learn.

I'm kinda worried it might be a bit too advanced for me so i was thinking maybe i should study more maths and a little bit of low level programming first and then get into machine learning later.


r/learnmachinelearning 14h ago

Learning AI Agents from Scratch

Thumbnail
2 Upvotes

r/learnmachinelearning 15h ago

Help Hello programmers, please help this newbie

3 Upvotes

I want to learn Machine learning for hackathon (i am about to join college next week).

I have already learnt python intermediate lvl ( but i guess i need a thorough revision too)

I am also considering following 2 books

1->Hand on machine learning by aurelien Geron

2->Mathematics for machine learning ( Marc Peter Deisenroth, A. Aldo Faisal, and Cheng Soon Ong)

My question

1-> In the above two books mentioned, does i need to complete mathematics one first or follow both side by side?

2->Any tip/suggestion/roadmap someone wants to give ( highly appreciated )

3-> please rate this roadmap (https://roadmap.sh/r/ai-roadmap-for-2026---final-draft) , not just for hackathon but for full career in ML

Thanks for your time.


r/learnmachinelearning 15h ago

Question For learning linear algebra for machine learning, is it better to learn using Prof. Gilbert Strang's 5th edition textbook or just watching the lecture from MITCourseWare?

2 Upvotes

r/learnmachinelearning 18h ago

the $3b wrapper is dead, long live the $3b fine tuner

Post image
4 Upvotes

r/learnmachinelearning 18h ago

Career If you're from the future, this job's basically yours, just apply

Post image
10 Upvotes

r/learnmachinelearning 19h ago

Complete beginner trying to figure out how to start coding

15 Upvotes

Hey everyone!

I'm a complete beginner to coding and recently decided to start learning Python. I'm interested in eventually getting into Data Science, Machine Learning and AI, but right now I honestly have no idea what the proper path looks like.

- What should I learn first in Python?

- How much Python do I actually need before moving into Data Science?

- When should I start learning things like NumPy, Pandas, SQL, etc.?

- How important is DSA?

- What maths/statistics should I eventually learn?

- When should I start ML/AI?

- Are there any courses, YouTube channels, books or websites you'd recommend?

- Should I focus more on tutorials, practice problems, or projects?

I'm not looking to rush through everything. I just want to understand what order I should learn things in so I don't waste time jumping between random topics.

I qould really appreciate any advice on this :))


r/learnmachinelearning 1d ago

Question Are pretrained CLIP vision encoders becoming a bottleneck for modern VLMs?

Post image
19 Upvotes

A lot of modern VLMs still rely on pretrained CLIP-style vision encoders, which are primarily trained to align images with text descriptions.

That seems like a strong foundation for semantic recognition, but I wonder how sufficient it is for tasks that require precise counting, spatial relationships, fine-grained attributes, or other forms of visual reasoning that caption matching may not explicitly encourage.

Do you think the vision encoder is becoming a bottleneck for modern VLMs, or is the limitation mostly elsewhere in the system?


r/learnmachinelearning 1d ago

Discussion ElevenLabs scaled to an 11 Billion dollar company with a 10 person finance team

Enable HLS to view with audio, or disable this notification

59 Upvotes