Building AI Agent Memory From Scratch With Just Python, Ollama and SQLite — No LangChain
_jaydeepkarale · x · 2026-09-17
Part 3 of a 7-part series on agent memory shows how to build a memory-equipped agent from scratch using only Python, Ollama, SQLite, an embedding model, and an LLM — no LangChain, LangGraph, or managed memory services.
The finished agent can:
- Remember useful user info and persist it across conversations
- Retrieve relevant memories and inject them into the LLM context
- Decide what's worth remembering, tagging each memory with type, importance, and confidence
- Perform semantic memory retrieval
The implementation is intentionally simple; the goal is understanding fundamentals before applying them.
More from coding & agent
- Common ML pitfall: trusting external benchmarks over product-grounded evals — yunta_tsai · 2026-09-17
- TypeSafe's Jev ditches text generation for instant, calibrated numerical answers — and it plays Doom at 7 req/s — JnBrymn · 2026-09-17
- PostHog: Agent-Opened PRs Jumped From 20% to 70%, So What Do Engineers Do? — rseroter · 2026-09-17
- Non-developer builds GreekSoup, an open-source AI equity research desk, mostly by prompting Claude — Practical-Rise-1188 · 2026-09-17
- Google ships full agent lifecycle stack: context layers, self-heal, one-command deploy — blaizedsouza · 2026-09-17
- tldraw split its mascot favicon into three and serves one at random per page load — max__drake · 2026-09-17