Research line · Research journey

Agent memory and knowledge

The open questionWhat should an agent know before the first prompt, and how does knowledge persist and grow across sessions, machines and teams? Second brains, shared brains, and why full-document context replaced retrieval-augmented generation in my work. Knowledge accumulates; state supersedes.

  • 4 chapters
  • 2024–2026
  • 7 min read
  • 33 dated sources
Agent memory and knowledgeOutline

The question

What this journey asks#

What should an agent know before the first prompt, and how does knowledge persist and grow across sessions, machines and teams? Second brains, shared brains, and why full-document context replaced retrieval-augmented generation in my work. Knowledge accumulates; state supersedes.

4 experiments between 2024 and 2026: 3 supported, 1 refuted. 33 dated sources so far.

The chapters below are built from each experiment’s record. A written introduction is being prepared.

Chapter 1 of 42024 – Dec 2025ShelvedRefuted

Retrieval-augmented generation on hard documents#

Can retrieval-augmented generation (RAG) answer reliably enough from a business's own documents, such as 500-page building-law PDFs, to stand behind a product?

From 2024 to the end of 2025, RAG was tried from chat-with-your-PDF demos to open-source frameworks on Slovenian building law. The published figure is 80% accuracy overall and never above 85% on complex tables (author-reported, no formal test set), which is why Moj AI moved to whole documents in context.

What was tried

Successive builds on the same material, Slovenian building acts and municipal spatial plans (500+ page PDFs): chat-with-PDF prototypes; n8n agentic RAG workflows; then Moj AI on RAG, with Docling from October 2025. Varied chunk size and overlap, embedding models, chunk metadata, hybrid keyword and vector search, multiple retrieval passes and a second model checking answers. No formal test set; accuracy as reported by the author.

What was built (4)
  • Chat-with-your-PDF prototypes and n8n RAG demos (Supabase and Pinecone vector stores, OpenAI embeddings), 2024 to early 2025.
  • Moj AI on RAG: FastAPI and Next.js, with LangChain, LlamaIndex, pgvector and Weaviate listed as dependencies from July 2025; Docling for PDF tables from October 2025.
  • A second-model check on answers (anti-hallucination pass) and citation validation on top of retrieval.
  • Split services on DigitalOcean at nearly $300 a month for development and testing.

Key result

80%accuracy overall; never above 85% on complex tables (author-reported, A16)

Evidence · 9 dated facts from 8 sources

What it showed

  • In the first n8n demos roughly 20-30% of answers were hallucinated (author's account; demos, not a formal test).
  • The published figure: 80% accuracy overall, and nothing got past 85% on complex table data (A16, author-reported).
  • Three failure modes: tables flattened into prose with the numbers lost, chunks from different municipalities mixed, and cross-references split across chunks.
  • A logged case: four of ten retrieved chunks held the correct text, and the model ignored them and answered from general knowledge.
  • Docling was adopted for better table extraction (Oct 2025) and needed memory limits; in the author's account, frameworks and models were still early.

Outcome

RefutedThe evidence went against the hypothesis. By the author's account, no configuration got past 85% accuracy on complex legal tables; Moj AI moved to whole documents.

What came next

No direct link recorded. Retrieval-augmented generation on hard documents: 2024 to Dec 2025. Lumina: full document corpus in context, no RAG: Dec 2025 to Jan 2026.

Chapter 2: Lumina: full document corpus in context, no RAG

Chapter 2 of 4Dec 2025 – Jan 2026Graduated → LuminaSupported

Lumina: full document corpus in context, no RAG#

Can putting a business's whole knowledge base into the model's context on every question replace retrieval-augmented generation (RAG) in an assistant the business stands behind?

Lumina sends the whole knowledge base to the model with every question: no chunking, no vector search. It went from a prototype to production in about 30 days and has run with real customers since January 2026; accuracy has not been measured against RAG.

What was tried

Gen-1: prototype in Google AI Studio, production on Firebase with Gemini Flash models; text extracted from uploaded files and placed whole in the prompt, with an instruction to answer only from the documents and say so when the answer is absent. Gen-2: one-month rebuild with orchestrated coding agents, EU inference endpoint, token limits in code, assertion-to-test conversion and a six-agent security audit. Longitudinal design-science case study (B22).

What was built (3)
  • Gen-1 (Dec 2025 to Jan 2026): a website assistant on Firebase and Gemini; uploaded documents are extracted to text and read whole on each question.
  • Gen-2 (July 2026): multi-channel (web, Telegram, Discord, WhatsApp), teams and roles, analytics, data-subject-rights tooling and EU data residency.
  • Token limits: a safe ceiling of 750K and a hard limit of 900K in a 1M window; above the limit the assistant declines rather than truncating.

Key result

30 daysfrom prototype to production, launched 5 Jan 2026 (A14)

Evidence · 9 dated facts from 9 sources

What it showed

  • Whole-document reads avoid chunking by design; accuracy has not been measured against a RAG baseline.
  • The limit is corpus size: in July 2026 three knowledge bases were over the safe ceiling and two over the hard limit, so those assistants stopped answering until reduced.
  • The largest knowledge base stored was 701K tokens (A45); it had not been queried, so it is a size, not a served load.
  • Explicit context caching was evaluated and not adopted (July 2026); the prompt puts the knowledge base first so the provider's automatic caching can apply.
  • The paper (B22) lists 21 gaps between what Lumina claimed and what it evidenced, almost all in documents; 985 new tests were added in the last five days of the Gen-2 rebuild (A45).
  • Hallucination is not measured; no client has reported one. Absence of complaints is a floor, not a rate (A45).

Outcome

SupportedThe evidence supports the hypothesis. It became Lumina.

This led to

Lumina: full document corpus in context, no RAG led to Moj AI: from RAG to full-document context.

Chapter 3: Moj AI: from RAG to full-document context

Why this step?

Lumina: corpus in contextled toMoj AI: full documents

Lumina: corpus in context: Graduated, first seen Dec 2025Moj AI: full documents: Graduated, first seen Dec 2025the same month

The record says that Lumina: full document corpus in context, no RAG led to Moj AI: from RAG to full-document context. A note on what carried over has not been written yet.

In the journey: Agent memory and knowledge →

Chapter 3 of 4Dec 2025 – Jan 2026Graduated → Moj AISupported

Moj AI: from RAG to full-document context#

What happens to Moj AI's accuracy when RAG is replaced by full-document context?

Moj AI, an assistant for Slovenian building legislation, was rebuilt so that a lightweight router picks up to three documents and the model reads them whole in a 1M-token window. In the author's informal tests, the table and cross-reference errors that capped RAG did not recur.

What was tried

Rebuild on Firebase with Gemini 2.5 Flash (1M tokens). A metadata index in Firestore lets a router choose up to three PDFs per question; the whole PDFs go into the context window (A16 puts a 500-page PDF at about 400,000-600,000 tokens). Tested informally on Slovenian building acts and municipal spatial plans: a first query, then the same query on fifteen other PDFs.

What was built (4)
  • A Firebase rebuild (React, Cloud Functions, Firestore) on Gemini 2.5 Flash with a 1M-token window.
  • A 'Librarian' router: reads a metadata index (municipality, document type, keywords), picks at most three PDFs and loads them whole, just in time.
  • Two modes: Lightning (documents only, 5-30 s) and Frontier (documents plus web search).
  • Answers that cite page numbers; documents over 1M tokens split by volume.

Key result

15 of 15repeat test queries on different PDFs answered correctly (author-reported, informal; A16)

Evidence · 7 dated facts from 6 sources

What it showed

  • A first attempt in the new generation used Gemini's managed File Search (retrieval); it was replaced by the router plus whole-document reads.
  • With whole documents, tables and cross-references are read intact: the three RAG failure modes did not recur in the reported tests.
  • This is not whole-corpus injection: the router narrows the corpus to a few documents first.
  • File Search and Google Search could not run in the same API call, which forced agent orchestration inside Frontier mode.
  • No formal benchmark was run; the accuracy claim rests on the author's test queries.

Outcome

SupportedThe evidence supports the hypothesis. It became Moj AI.

What came next

No direct link recorded. Moj AI: from RAG to full-document context: Dec 2025 to Jan 2026. The Curator: from Apr 2026.

Chapter 4: The Curator

Chapter 4 of 4Apr 2026Graduated → The CuratorSupported

The Curator#

How does what an agent knows carry across sessions, machines and harnesses?

Hand-written handoffs between agent sessions became an open-source context engine: knowledge accumulates in a local wiki, working state supersedes, and canonical documents are read verbatim, all reachable from any harness over MCP. This experiment became The Curator, with its own home at mycurator.xyz and its code on GitHub.

What was tried

Design study of an open-source tool built in public under the MIT licence from April 2026. Small headless experiments with N of 4 or 8 per condition, on the author's own and seeded projects, across several models and harnesses, plus live handover tests between harnesses and computers. The author is designer, developer and principal user; the measurements show direction, not rates.

What was built (4)
  • A local, markdown second brain: sources compiled into linked summary, entity and concept pages, readable in Obsidian.
  • An MCP server and CLI so any harness can read and write it (24 tools by September 2026).
  • An agent working-state layer (v3.17, Aug 2026): a standing brief, handoffs and decisions saved by the agent during the session.
  • Mac app (v3.45, Sep 2026) and Windows app (v4.0, Nov 2026); 137 releases by December 2026.

Key result

0 of 4 → 8 of 8runs naming the correct next priority without vs with carried state; one model, one project (B23)

Evidence · 8 dated facts from 8 sources

What it showed

  • The session boundary, not the window size, is the binding constraint: a new session starts empty whatever the window holds.
  • Three kinds of context need three write rules: knowledge accumulates, working state supersedes, canonical documents are replaced whole.
  • Carrying working state raised correct next-priority identification from 0 of 4 runs to 8 of 8 (one model, one project, small N).
  • On Claude Code, a skill alone saved 0 of 4 times and an instruction block 3 of 4; opencode saved 4 of 4 either way.
  • A handover worked live between Claude Code and Antigravity and across two computers; a harness without the instruction block overwrote another's handoff, which led to per-tool scopes.

Outcome

SupportedThe evidence supports the hypothesis. It became The Curator.

So far

Where each experiment landed#

  1. RAG on hard documents80% accuracy overall; never above 85% on complex tables (author-reported, A16). The evidence went against the hypothesis.

    RefutedChapter 1
  2. Lumina: corpus in context30 days from prototype to production, launched 5 Jan 2026 (A14). The evidence supports the hypothesis.

    SupportedChapter 2
  3. Moj AI: full documents15 of 15 repeat test queries on different PDFs answered correctly (author-reported, informal; A16). The evidence supports the hypothesis.

    SupportedChapter 3
  4. The Curator0 of 4 → 8 of 8 runs naming the correct next priority without vs with carried state; one model, one project (B23). The evidence supports the hypothesis.

    SupportedChapter 4

A written summary of what this journey has answered, and what is still open, is being prepared.

From two minutes to the full papers

Read deeper#

Ordered by depth. Start at the top and stop when you have what you need.

Depth 1: The 2-minute summary2 min

The whole journey in a few lines, built from the record.

What should an agent know before the first prompt, and how does knowledge persist and grow across sessions, machines and teams? Second brains, shared brains, and why full-document context replaced retrieval-augmented generation in my work. Knowledge accumulates; state supersedes.
  1. Retrieval-augmented generation on hard documents (2024–2026). 80% (accuracy overall; never above 85% on complex tables (author-reported, A16)). Refuted.
  2. Lumina: full document corpus in context, no RAG (2025–2026). 30 days (from prototype to production, launched 5 Jan 2026 (A14)). Supported.
  3. Moj AI: from RAG to full-document context (2025–2026). 15 of 15 (repeat test queries on different PDFs answered correctly (author-reported, informal; A16)). Supported.
  4. The Curator (2025–2026). 0 of 4 → 8 of 8 (runs naming the correct next priority without vs with carried state; one model, one project (B23)). Supported.
Depth 2: Essays12 items · ~129 min

From Lab to Life: the story in plain language, written while it happened.

Depth 4: Field Notes sections7 items · 20 min

How to do it yourself: the practical chapters this research feeds.

A time marked ~ is an estimate by type and has not been counted from the text yet.

Bibliography

Sources and citation#

  1. Why I Ditched RAG Pipelines for 1M Token Context Windowsessay · 21 Jan 2026 · cited in chapter 1, 2, 3
  2. Lumina: An AI Agent Your Business Can Stand Behindessay · 31 Jul 2026 · cited in chapter 2
  3. From Google AI Studio to Production: Building Lumina v1 in 48 Hoursessay · 11 Dec 2025 · cited in chapter 2
  4. From Prototype to Production: Building Lumina an AI Widget Platform in 30 Daysessay · 5 Jan 2026 · cited in chapter 2
  5. I Could Tell You My AI Has Never Lied. I'm Not Going To.essay · 6 Aug 2026 · cited in chapter 2
  6. Six Months After I Shipped Lumina; Here's What Actually Happenedessay · 10 Jul 2026 · cited in chapter 2
  7. The Second Brain That Grows Smarter and Lives on Your Computeressay · 15 Apr 2026 · cited in chapter 4
  8. Building Knowledge Immortality Through the Second Brain Architecture and The Curator Appessay · 23 Apr 2026 · cited in chapter 4
  9. The Handoff Writes Itselfessay · 30 Aug 2026 · cited in chapter 4
  10. Where Your Context Livesessay · 3 Sep 2026 · cited in chapter 4
  11. The Context Engineessay · 20 Sep 2026 · cited in chapter 4
  12. The Right Context, Not All of Itessay · 30 Sep 2026 · cited in chapter 4
  13. Context as Architecture: Full-Corpus Grounding, Orchestrated Agentic Development, and Compliance-by-Design in a Production AI Assistant Platformpaper · 1 Aug 2026 · cited in chapter 1, 2
  14. Chasing Jarvis: Can Technically Sophisticated Non-Programmers Deploy SaaS Applications Using AI Coding Agents? An Empirical Investigation Through Context Engineering and the Lumina AI Case Studypaper · 15 Mar 2026 · cited in chapter 2
  15. Law = Code; Research Paperpaper · 2 Mar 2026 · cited in chapter 3
  16. Knowledge Accumulates, State Supersedes: Structuring and Carrying Context for Multi-Session, Multi-Harness AI Agent Work — A Design Study of The Curator, an Open-Source Context Enginepaper · 30 Sep 2026 · cited in chapter 4
  17. A16, Why I Ditched RAG Pipelines (Medium, 21 Jan 2026) ↗Article · Nov 2024 · cited in chapter 1, 3
  18. A13, From Google AI Studio to Production (Medium, 11 Dec 2025) ↗Article · 11 Dec 2025 · cited in chapter 2
  19. A14, From Prototype to Production (Medium, 5 Jan 2026) ↗Article · 5 Jan 2026 · cited in chapter 2
  20. B18, Chasing Jarvis (ResearchGate, 15 Mar 2026) ↗Paper · 15 Mar 2026 · cited in chapter 2
  21. A42, Six Months After I Shipped Lumina (Substack, 10 Jul 2026) ↗Article · 10 Jul 2026 · cited in chapter 2
  22. A44, Lumina: An AI Agent Your Business Can Stand Behind (31 Jul 2026) ↗Article · 31 Jul 2026 · cited in chapter 2
  23. B22, Context as Architecture (ResearchGate, 1 Aug 2026) ↗Paper · 1 Aug 2026 · cited in chapter 2
  24. A45, I Could Tell You My AI Has Never Lied (6 Aug 2026) ↗Article · 6 Aug 2026 · cited in chapter 2
  25. B17, Law = Code (ResearchGate, 2 Mar 2026) ↗Paper · 2 Mar 2026 · cited in chapter 3
  26. A01, The Claude Desktop Coding Agent Experiment (Medium, 11 Aug 2025) ↗Article · 11 Aug 2025 · cited in chapter 4
  27. github.com/talirezun/the-curator, first commit 7 Apr 2026 ↗Code repository · 7 Apr 2026 · cited in chapter 4
  28. A24, The Second Brain That Grows Smarter (15 Apr 2026) ↗Article · 15 Apr 2026 · cited in chapter 4
  29. A48, The Handoff Writes Itself (30 Aug 2026) ↗Article · 30 Aug 2026 · cited in chapter 4
  30. A51, The Context Engine (20 Sep 2026) ↗Article · 20 Sep 2026 · cited in chapter 4
  31. B23, Knowledge Accumulates, State Supersedes (ResearchGate, 30 Sep 2026) ↗Paper · 30 Sep 2026 · cited in chapter 4
  32. github.com/talirezun/the-curator, GitHub API, 4 Dec 2026 ↗Release · 3 Dec 2026 · cited in chapter 4

12 more dated facts rest on sources with no public link: author’s account (2), document (1), code repository (9). Each is named in its chapter’s evidence.

Cite this journey

APA

Režun, T. (2026). Agent memory and knowledge [Research journey, research line]. Block Labs. https://talirezun.com/lab/journeys/memory-context

BibTeX

@misc{rezun2026memorycontext,
  author = {Re{\v{z}}un, T.},
  title = {Agent memory and knowledge},
  year = {2026},
  howpublished = {Block Labs, research journey},
  url = {https://talirezun.com/lab/journeys/memory-context}
}