Skip to content

guide: Agent memory and context for apps#184

Open
rishi-raj-jain wants to merge 5 commits into
tyaga001:mainfrom
rishi-raj-jain:main
Open

guide: Agent memory and context for apps#184
rishi-raj-jain wants to merge 5 commits into
tyaga001:mainfrom
rishi-raj-jain:main

Conversation

@rishi-raj-jain
Copy link
Copy Markdown

@rishi-raj-jain rishi-raj-jain commented May 12, 2026

Summary by CodeRabbit

  • Documentation
    • Published a new blog article by Rishi Raj Jain (2026-05-12) on agent memory and contextual retrieval for applications. Covers layered context models, pitfalls of naive RAG chunking, how contextual retrieval differs from memory, an operational checklist (distillation, scoping/thresholds, compression, updates, testing), lightweight vs supermemory trade-offs, benchmarking guidance, and practical product recommendations.

Review Change Stack

@rishi-raj-jain rishi-raj-jain changed the title Create page.mdx guide: Agent memory and context for apps May 12, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

@rishi-raj-jain is attempting to deploy a commit to the Ankur 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

Walkthrough

Adds a new MDX blog post at src/app/blog/agent-memory-and-context-for-apps/page.mdx with exported route metadata, a BlogHeader, and sections on context layers, RAG limitations, contextual retrieval vs memory, an operable memory checklist, Mem0 vs Supermemory comparison, benchmarking guidance, and a conclusion. Also prepends the post entry to src/app/blog/data.ts's allBlogs array.

Changes

Agent Memory and Context Blog Post

Layer / File(s) Summary
Route metadata and article header
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Route exports metadata with path, title, and description; BlogHeader renders title, author, and publication timestamp.
Introduction and context layers
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Adds opening framing and layered context model (local, session, long-term); defines memory as durable, scoped information.
RAG limitations and contextual retrieval
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Explains why naive RAG chunking fails and describes contextual retrieval and hybrid retrieval (enrichment, embedding, reranking).
Hybrid retrieval pseudocode
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Adds pseudocode integrating hybrid retrieval with memory identity filtering and conflict resolution.
Identity, Mem0 and Supermemory examples
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Frames memory as identity maintenance, includes Mem0 example for scoped preferences and a Supermemory profile retrieval example.
Operable memory checklist
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Operational checklist: distillation with metadata, scoped reads/thresholds, compression/summarization, updates/overrides, and Mem0 testing guidance.
Mem0 vs Supermemory comparison
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Expands comparison across product surfaces, workflow examples, and provides a practical rule of thumb.
Benchmarking and conclusion
src/app/blog/agent-memory-and-context-for-apps/page.mdx
Adds LongMemEval benchmarking guidance with score table and concludes by contrasting contextual retrieval vs memory for continuity.
Blog index entry
src/app/blog/data.ts
Prepends a new allBlogs entry for agent-memory-and-context-for-apps with author, slug, title, excerpt, publishedAt, category, and flags.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • tyaga001
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author. The template requires multiple sections including Summary, Type of Change, Changes Made, and Testing checklist. Please add a comprehensive PR description following the template, including Summary, Type of Change (Content update), Changes Made, Testing confirmation, and any relevant notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new guide blog post about agent memory and context for applications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx`:
- Around line 33-35: The example rows contain non-printable separators and
escaped artifacts (e.g., the variables document, chunks, split_into_chunks,
embed, embeddings, vector_search) which break rendering and copy/paste; replace
those single-cell table rows with a fenced code block containing a clean,
unescaped snippet (preserve identifiers like document, split_into_chunks, embed,
vector_search and the suggested hybrid_search pseudocode) and remove hidden
control characters so the code renders and copies correctly; apply the same
conversion to the other listed locations (rows around lines containing similar
snippets) to ensure consistent, readable fenced code blocks instead of table
cells.
- Line 52: Update the copy for consistent hyphenation and grammar: replace
occurrences of "two stage" with "two-stage", "semi stable" with "semi-stable",
"first class" with "first-class", "long term" with "long-term", and "category
level" with "category-level", and change "emphasizes on filters" to "emphasizes
filters" wherever these appear (notably in the sentence about hybrid
search/reranking and the other flagged lines). Ensure all replacements are
applied consistently across the page content so punctuation and spacing remain
correct.
- Line 1: The file calls getMetadata(...) but that function is not defined or
imported in page.mdx, causing a runtime/compile error; add an import for
getMetadata from the module where it's implemented (or replace the call with a
plain metadata object) and ensure the exported const metadata = getMetadata(...)
in page.mdx references that imported symbol; search for the implementation
(e.g., a helper like getMetadata in your utils/ or lib/metadata) and import it
at the top of the MDX so the symbol is available.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 95c9f989-929e-459a-9a7d-8f5757d22591

📥 Commits

Reviewing files that changed from the base of the PR and between bed3a91 and 14d71fc.

📒 Files selected for processing (1)
  • src/app/blog/agent-memory-and-context-for-apps/page.mdx

Comment thread src/app/blog/agent-memory-and-context-for-apps/page.mdx
Comment thread src/app/blog/agent-memory-and-context-for-apps/page.mdx Outdated
Comment thread src/app/blog/agent-memory-and-context-for-apps/page.mdx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (2)
src/app/blog/agent-memory-and-context-for-apps/page.mdx (2)

35-37: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace single-cell table pseudocode blocks with fenced code blocks.

The pseudocode rows still contain non-printable separators/escaped artifacts (for example at Line 35), which hurts rendering and copy/paste quality. Convert these to fenced code blocks directly.

Suggested pattern
-| function hybrid\_search query ... |
-| :---- |
+```text
+function hybrid_search(query):
+  keyword_results = keyword_search(query, corpus)
+  vector_results = vector_search(query, embedded_corpus)
+  combined = merge(keyword_results, vector_results)
+  ranked = rerank(combined, query)
+  return ranked
+```

Also applies to: 51-53, 60-62, 67-69, 72-74, 81-83, 86-88, 91-93, 96-98, 111-113, 118-120, 125-127, 132-134

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx` around lines 35 -
37, The pseudocode rows that define document, chunks, embeddings, query and
results (variables: document, split_into_chunks, embed, vector_search) contain
non-printable separators/escaped artifacts and are currently rendered as a
single-cell table; replace each of these pseudocode table fragments with proper
fenced code blocks (triple backticks) containing the raw code lines (document =
"""...""", chunks = split_into_chunks(...), embeddings = [embed(...)], query =
"...", results = vector_search(...)) and remove any hidden/escaped characters
(e.g., weird separators around the triple-quoted string and backslashes) so the
code renders and copies cleanly; apply the same replacement pattern to the other
similar snippets that use split_into_chunks/embed/vector_search or the
hybrid_search example.

54-55: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Normalize hyphenation and grammar for publication consistency.

Please apply consistent fixes such as two-stage, semi-stable, long-term, first-class, category-level, and change “emphasizes on filters” to “emphasizes filters” (for example around Line 105).

Also applies to: 70-71, 99-99, 103-106, 116-116, 130-130, 143-143, 151-151

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx` around lines 54 -
55, Normalize hyphenation and the one grammar fix across the MDX content:
replace unhyphenated or inconsistent forms with the canonical hyphenated
variants (`two-stage`, `semi-stable`, `long-term`, `first-class`,
`category-level`) wherever they appear (notably near the occurrences referenced
in the comment) and change the phrase `emphasizes on filters` to `emphasizes
filters`; search for each literal string (e.g., `two stage`, `semi stable`,
`long term`, `first class`, `category level`, and `emphasizes on filters`) and
update them in the same file so publication style is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx`:
- Around line 35-37: The pseudocode rows that define document, chunks,
embeddings, query and results (variables: document, split_into_chunks, embed,
vector_search) contain non-printable separators/escaped artifacts and are
currently rendered as a single-cell table; replace each of these pseudocode
table fragments with proper fenced code blocks (triple backticks) containing the
raw code lines (document = """...""", chunks = split_into_chunks(...),
embeddings = [embed(...)], query = "...", results = vector_search(...)) and
remove any hidden/escaped characters (e.g., weird separators around the
triple-quoted string and backslashes) so the code renders and copies cleanly;
apply the same replacement pattern to the other similar snippets that use
split_into_chunks/embed/vector_search or the hybrid_search example.
- Around line 54-55: Normalize hyphenation and the one grammar fix across the
MDX content: replace unhyphenated or inconsistent forms with the canonical
hyphenated variants (`two-stage`, `semi-stable`, `long-term`, `first-class`,
`category-level`) wherever they appear (notably near the occurrences referenced
in the comment) and change the phrase `emphasizes on filters` to `emphasizes
filters`; search for each literal string (e.g., `two stage`, `semi stable`,
`long term`, `first class`, `category level`, and `emphasizes on filters`) and
update them in the same file so publication style is consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7ef39ce4-f705-46e1-8f48-bf75f3d42830

📥 Commits

Reviewing files that changed from the base of the PR and between 14d71fc and f142bd9.

📒 Files selected for processing (1)
  • src/app/blog/agent-memory-and-context-for-apps/page.mdx

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx`:
- Around line 9-13: The MDX page uses the BlogHeader component but never imports
or registers it, causing a runtime render error; fix by either adding a local
import for BlogHeader at the top of this MDX page (so the BlogHeader symbol is
defined before usage) or register BlogHeader in the MDX components map
(mdx-components.tsx) so the MDX renderer can resolve it—update whichever
location you choose to export the BlogHeader symbol and ensure the name matches
exactly ("BlogHeader") where it's used in page.mdx.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 19a7af1f-4122-4426-98b5-9774421f3255

📥 Commits

Reviewing files that changed from the base of the PR and between f142bd9 and 1074833.

📒 Files selected for processing (1)
  • src/app/blog/agent-memory-and-context-for-apps/page.mdx

Comment thread src/app/blog/agent-memory-and-context-for-apps/page.mdx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
src/app/blog/agent-memory-and-context-for-apps/page.mdx (1)

70-70: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix compound adjective hyphenation for publication quality.

Several compound adjectives throughout the post need hyphens for correct grammar. Line 70 uses "two stage" but should be "two-stage". Similar issues appear with "semi stable" (line 114), "first class" (lines 238, 287), "entity scoped" (lines 196, 198), "long term" (lines 313, 321), "category level" (line 313), and "simulation style" (line 192). These corrections improve readability and professionalism for published content.

✏️ Proposed fixes
-and it is often described as a two stage retrieval pattern where a fast
+and it is often described as a two-stage retrieval pattern where a fast

Apply similar hyphenation fixes throughout:

  • "semi stable" → "semi-stable" (line 114)
  • "first class" → "first-class" (lines 238, 287)
  • "entity scoped" → "entity-scoped" (lines 196, 198)
  • "long term" → "long-term" (lines 313, 321)
  • "category level" → "category-level" (line 313)
  • "simulation style" → "simulation-style" (line 192)

As per static analysis hints: LanguageTool grammar check (QB_NEW_EN_HYPHEN).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx` at line 70, Replace
unhyphenated compound adjectives with hyphenated forms for publication-quality
grammar: change "two stage" to "two-stage", "semi stable" to "semi-stable", both
instances of "first class" to "first-class", both instances of "entity scoped"
to "entity-scoped", both instances of "long term" to "long-term", "category
level" to "category-level", and "simulation style" to "simulation-style" in the
article text so the compound modifiers are correctly hyphenated.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx`:
- Line 198: In the paragraph that begins "Mem0 is best understood as a memory
layer..." remove the incorrect preposition by changing "emphasizes on filters
and entity scoped memory" to "emphasizes filters and entity scoped memory" so
the sentence reads correctly; locate the sentence in page.mdx (the line
containing "emphasizes on filters") and delete the word "on".

In `@src/app/blog/data.ts`:
- Around line 29-41: The new blog entry in the allBlogs array for slug
"agent-memory-and-context-for-apps" is missing the image property; add a cover
image file (e.g., src/app/blog/agent-memory-and-context-for-apps/cover.png),
import it at the top alongside other images, and add an image: <importedName>
property to the entry in the allBlogs array so the object for slug
"agent-memory-and-context-for-apps" matches the other entries and components
that expect an image field.

---

Duplicate comments:
In `@src/app/blog/agent-memory-and-context-for-apps/page.mdx`:
- Line 70: Replace unhyphenated compound adjectives with hyphenated forms for
publication-quality grammar: change "two stage" to "two-stage", "semi stable" to
"semi-stable", both instances of "first class" to "first-class", both instances
of "entity scoped" to "entity-scoped", both instances of "long term" to
"long-term", "category level" to "category-level", and "simulation style" to
"simulation-style" in the article text so the compound modifiers are correctly
hyphenated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 05fa5abe-ca70-4edf-8684-3437d9a5340d

📥 Commits

Reviewing files that changed from the base of the PR and between 1074833 and 8da1fd3.

📒 Files selected for processing (2)
  • src/app/blog/agent-memory-and-context-for-apps/page.mdx
  • src/app/blog/data.ts

Comment thread src/app/blog/agent-memory-and-context-for-apps/page.mdx
Comment thread src/app/blog/data.ts
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
devtoolsacademy Error Error May 13, 2026 8:14am

Request Review

@tyaga001
Copy link
Copy Markdown
Owner

@nirnejak can you add a cover image pls

@rishi-raj-jain
Copy link
Copy Markdown
Author

Would love for this to be live :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants