[GH-ISSUE #67] Feature Request: Implement Session Memory/Persistent Context #55

Closed
opened 2026-10-26 21:12:28 +00:00 by bsakaguchi · 20 comments
Owner

Originally created by @prdai on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/67

Hi,

I’d like to propose adding persistent memory/session context functionality to DeepSeek-R1, similar to ChatGPT’s ability to retain conversation history and user-specific preferences across interactions. This would significantly enhance usability for developers and end-users by:

  • Maintaining continuity in multi-turn conversations.
  • Remembering user preferences (e.g., tone, formatting) or key details (e.g., names, use-case context).
  • Reducing redundant input repetition.

Current Limitation:
As of now, DeepSeek-R1 resets context after each session, requiring users to re-provide information in every new interaction.

Proposed Solution:

  1. Session-Based Memory:
    • Allow the model to retain context within a session (e.g., via token-efficient caching or summarization).
  2. Optional Long-Term Memory:
    • Add a user-controlled setting to persist key details (e.g., via secure, opt-in storage linked to anonymized identifiers).
  3. API/Integration Support:
    • Expose memory controls in the API (e.g., enable_memory=True, reset_memory()).
  4. Privacy-First Design:
    • Ensure memory retention complies with data privacy regulations (e.g., GDPR) and allows easy deletion.

Why This Matters:

  • User Experience: Reduces friction in extended interactions (e.g., chatbots, tutoring, or project assistance).
  • Personalization: Enables tailored responses over time (e.g., “Remember my name is Ranuga”).
  • Developer Flexibility: Empowers builders to create stateful applications without external databases.

Additional Context:

  • ChatGPT-like memory could be implemented via:
    • Context Summarization: Compress prior interactions into a smaller token footprint.
    • Secure Caching: Store session data temporarily server-side (with user consent).
    • Hybrid Approach: Combine model-side context retention with lightweight external storage.

Thanks!

Originally created by @prdai on GitHub (Jan 24, 2025). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/67 Hi, I’d like to propose adding **persistent memory/session context** functionality to DeepSeek-R1, similar to ChatGPT’s ability to retain conversation history and user-specific preferences across interactions. This would significantly enhance usability for developers and end-users by: - Maintaining **continuity** in multi-turn conversations. - Remembering **user preferences** (e.g., tone, formatting) or key details (e.g., names, use-case context). - Reducing redundant input repetition. **Current Limitation:** As of now, DeepSeek-R1 resets context after each session, requiring users to re-provide information in every new interaction. **Proposed Solution:** 1. **Session-Based Memory:** - Allow the model to retain context within a session (e.g., via token-efficient caching or summarization). 2. **Optional Long-Term Memory:** - Add a user-controlled setting to persist key details (e.g., via secure, opt-in storage linked to anonymized identifiers). 3. **API/Integration Support:** - Expose memory controls in the API (e.g., `enable_memory=True`, `reset_memory()`). 4. **Privacy-First Design:** - Ensure memory retention complies with data privacy regulations (e.g., GDPR) and allows easy deletion. **Why This Matters:** - **User Experience:** Reduces friction in extended interactions (e.g., chatbots, tutoring, or project assistance). - **Personalization:** Enables tailored responses over time (e.g., “Remember my name is Ranuga”). - **Developer Flexibility:** Empowers builders to create stateful applications without external databases. **Additional Context:** - ChatGPT-like memory could be implemented via: - **Context Summarization:** Compress prior interactions into a smaller token footprint. - **Secure Caching:** Store session data temporarily server-side (with user consent). - **Hybrid Approach:** Combine model-side context retention with lightweight external storage. Thanks!
bsakaguchi 2026-10-26 21:12:28 +00:00
Author
Owner

@justinlietz93 commented on GitHub (Jan 25, 2025):

Hi,

I’d like to propose adding persistent memory/session context functionality to DeepSeek-R1, similar to ChatGPT’s ability to retain conversation history and user-specific preferences across interactions. This would significantly enhance usability for developers and end-users by:

  • Maintaining continuity in multi-turn conversations.
  • Remembering user preferences (e.g., tone, formatting) or key details (e.g., names, use-case context).
  • Reducing redundant input repetition.

Current Limitation: As of now, DeepSeek-R1 resets context after each session, requiring users to re-provide information in every new interaction.

Proposed Solution:

  1. Session-Based Memory:

    • Allow the model to retain context within a session (e.g., via token-efficient caching or summarization).
  2. Optional Long-Term Memory:

    • Add a user-controlled setting to persist key details (e.g., via secure, opt-in storage linked to anonymized identifiers).
  3. API/Integration Support:

    • Expose memory controls in the API (e.g., enable_memory=True, reset_memory()).
  4. Privacy-First Design:

    • Ensure memory retention complies with data privacy regulations (e.g., GDPR) and allows easy deletion.

Why This Matters:

  • User Experience: Reduces friction in extended interactions (e.g., chatbots, tutoring, or project assistance).
  • Personalization: Enables tailored responses over time (e.g., “Remember my name is Ranuga”).
  • Developer Flexibility: Empowers builders to create stateful applications without external databases.

Additional Context:

  • ChatGPT-like memory could be implemented via:

    • Context Summarization: Compress prior interactions into a smaller token footprint.
    • Secure Caching: Store session data temporarily server-side (with user consent).
    • Hybrid Approach: Combine model-side context retention with lightweight external storage.

Thanks!

I am currently working on a kit for this right now. I have a suite of tools for Deepseek r1 on my GitHub and I’m implementing permanent memory / context management soon. Can you email me your thoughts and suggestions so I can help build this?

<!-- gh-comment-id:2614093620 --> @justinlietz93 commented on GitHub (Jan 25, 2025): > Hi, > > I’d like to propose adding **persistent memory/session context** functionality to DeepSeek-R1, similar to ChatGPT’s ability to retain conversation history and user-specific preferences across interactions. This would significantly enhance usability for developers and end-users by: > > * Maintaining **continuity** in multi-turn conversations. > * Remembering **user preferences** (e.g., tone, formatting) or key details (e.g., names, use-case context). > * Reducing redundant input repetition. > > **Current Limitation:** As of now, DeepSeek-R1 resets context after each session, requiring users to re-provide information in every new interaction. > > **Proposed Solution:** > > 1. **Session-Based Memory:** > > * Allow the model to retain context within a session (e.g., via token-efficient caching or summarization). > 2. **Optional Long-Term Memory:** > > * Add a user-controlled setting to persist key details (e.g., via secure, opt-in storage linked to anonymized identifiers). > 3. **API/Integration Support:** > > * Expose memory controls in the API (e.g., `enable_memory=True`, `reset_memory()`). > 4. **Privacy-First Design:** > > * Ensure memory retention complies with data privacy regulations (e.g., GDPR) and allows easy deletion. > > **Why This Matters:** > > * **User Experience:** Reduces friction in extended interactions (e.g., chatbots, tutoring, or project assistance). > * **Personalization:** Enables tailored responses over time (e.g., “Remember my name is Ranuga”). > * **Developer Flexibility:** Empowers builders to create stateful applications without external databases. > > **Additional Context:** > > * ChatGPT-like memory could be implemented via: > > * **Context Summarization:** Compress prior interactions into a smaller token footprint. > * **Secure Caching:** Store session data temporarily server-side (with user consent). > * **Hybrid Approach:** Combine model-side context retention with lightweight external storage. > > Thanks! I am currently working on a kit for this right now. I have a suite of tools for Deepseek r1 on my GitHub and I’m implementing permanent memory / context management soon. Can you email me your thoughts and suggestions so I can help build this?
Author
Owner

@tommykmusic commented on GitHub (Jan 27, 2025):

This would be amazing, also it would be nice to be able to export our memory bank from ChatGPT to DeepSeek! This would make it easier to transition from ChatGPT etc.

<!-- gh-comment-id:2616876086 --> @tommykmusic commented on GitHub (Jan 27, 2025): This would be amazing, also it would be nice to be able to export our memory bank from ChatGPT to DeepSeek! This would make it easier to transition from ChatGPT etc.
Author
Owner

@BenRacicot commented on GitHub (Jan 28, 2025):

If we could get it to watch a local Github repo's changes, to keep it in context, that would be incredible.

<!-- gh-comment-id:2617393334 --> @BenRacicot commented on GitHub (Jan 28, 2025): If we could get it to watch a local Github repo's changes, to keep it in context, that would be incredible.
Author
Owner

@justinlietz93 commented on GitHub (Jan 28, 2025):

If we could get it to watch a local Github repo's changes, to keep it in context, that would be incredible.

I am very close to finishing my next big merge to main, I am a full time student and full time software engineer, but believe me I am using every bit of time to continue this project, feel free to follow my page for updates on the agent_tools repo

<!-- gh-comment-id:2617579088 --> @justinlietz93 commented on GitHub (Jan 28, 2025): > If we could get it to watch a local Github repo's changes, to keep it in context, that would be incredible. I am very close to finishing my next big merge to main, I am a full time student and full time software engineer, but believe me I am using every bit of time to continue this project, feel free to follow my page for updates on the agent_tools repo
Author
Owner

@WillyamBradberry commented on GitHub (Feb 10, 2025):

Agree with that. The most wanted feature

<!-- gh-comment-id:2648106953 --> @WillyamBradberry commented on GitHub (Feb 10, 2025): Agree with that. The most wanted feature
Author
Owner

@feeleen commented on GitHub (Feb 10, 2025):

It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night).

So I could say: "remind me what we discussed two weeks ago on tuesday"
and it should tell me the exact dialog parts related to prompt or summarize it

<!-- gh-comment-id:2648418911 --> @feeleen commented on GitHub (Feb 10, 2025): It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night). So I could say: "remind me what we discussed two weeks ago on tuesday" and it should tell me the exact dialog parts related to prompt or summarize it
Author
Owner

@justinlietz93 commented on GitHub (Feb 10, 2025):

It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night).

So I could say: "remind me what we discussed two weeks ago on tuesday"
and it should tell me the exact dialog parts related to prompt or summarize it

This is something I am actively working on.

Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept.

The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime.

The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc.

I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase

<!-- gh-comment-id:2648438595 --> @justinlietz93 commented on GitHub (Feb 10, 2025): > It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night). > > So I could say: "remind me what we discussed two weeks ago on tuesday" > and it should tell me the exact dialog parts related to prompt or summarize it This is something I am actively working on. Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept. The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime. The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc. I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase
Author
Owner

@aandriamgit commented on GitHub (Feb 13, 2025):

The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime.

The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc.

my bro, that hella impressive, at this point just make it operate a paperclip factory

<!-- gh-comment-id:2657746468 --> @aandriamgit commented on GitHub (Feb 13, 2025): > The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime. > > The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc. my bro, that hella impressive, at this point just make it operate a paperclip factory
Author
Owner

@ChromiaCat commented on GitHub (Mar 5, 2025):

This would be an awesome feature to add to the web version of R1, last night I hit the chat limit & I couldn't get DeepSeek to either reference that chat or upload the chat as a file(it can't read all of it in file form) so this would be very useful.

Is there an estimate as to when will it be implemented on the site?

<!-- gh-comment-id:2701083716 --> @ChromiaCat commented on GitHub (Mar 5, 2025): This would be an awesome feature to add to the web version of R1, last night I hit the chat limit & I couldn't get DeepSeek to either reference that chat or upload the chat as a file(it can't read all of it in file form) so this would be very useful. Is there an estimate as to when will it be implemented on the site?
Author
Owner

@Saisankarwork123 commented on GitHub (Mar 7, 2025):

It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night).
So I could say: "remind me what we discussed two weeks ago on tuesday"
and it should tell me the exact dialog parts related to prompt or summarize it

This is something I am actively working on.

Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept.

The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime.

The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc.

I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase

Highly excited about this. Kudos to you, man.

<!-- gh-comment-id:2705463498 --> @Saisankarwork123 commented on GitHub (Mar 7, 2025): > > It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night). > > So I could say: "remind me what we discussed two weeks ago on tuesday" > > and it should tell me the exact dialog parts related to prompt or summarize it > > This is something I am actively working on. > > Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept. > > The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime. > > The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc. > > I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase Highly excited about this. Kudos to you, man.
Author
Owner

@jackbab0 commented on GitHub (Mar 15, 2025):

It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night).
So I could say: "remind me what we discussed two weeks ago on tuesday"
and it should tell me the exact dialog parts related to prompt or summarize it

This is something I am actively working on.

Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept.

The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime.

The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc.

I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase

For my academic research something like this would be huge, so eventually notice me if there are any updates!
Good luck with everything

<!-- gh-comment-id:2726107119 --> @jackbab0 commented on GitHub (Mar 15, 2025): > > It aso has to store and index all previous communications in a text form in a DB, and fine tune(retrain) itself with this daily chat data everyday (like we do when we sleep at night). > > So I could say: "remind me what we discussed two weeks ago on tuesday" > > and it should tell me the exact dialog parts related to prompt or summarize it > > This is something I am actively working on. > > Right now I have a fully autonomous system that lets either a local ollama deepseek, or any API run indefinitely until a goal is achieved. Think of a complex project that might require days of 24/7 development from an AI to finish a prototype or concept. > > The system currently uses a rolling context window extender that shows the LLM where it previously left off, it's also capable of using and building its own tools at runtime. > > The LLM can prompt itself, as well as prompt other agents to carry out tasks. It can browse the web, use your computer, write code, run shell commands, etc. > > I am working on making this stable and creating permanent memory at the moment as well as exploring ideas for fine tuning on your context and codebase For my academic research something like this would be huge, so eventually notice me if there are any updates! Good luck with everything
Author
Owner

@mercmobily commented on GitHub (Apr 21, 2025):

I can't express how helpful this would be. Sorry about the noise.

<!-- gh-comment-id:2817950146 --> @mercmobily commented on GitHub (Apr 21, 2025): I can't express how helpful this would be. Sorry about the noise.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 1, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:2926056649 --> @github-actions[bot] commented on GitHub (Jun 1, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@mercmobily commented on GitHub (Jun 1, 2025):

Please don't close this issue!

<!-- gh-comment-id:2926070958 --> @mercmobily commented on GitHub (Jun 1, 2025): Please don't close this issue!
Author
Owner

@github-actions[bot] commented on GitHub (Jul 14, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:3067418186 --> @github-actions[bot] commented on GitHub (Jul 14, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@AlyaGomaa commented on GitHub (Jul 17, 2025):

Hey any updates about this issue??

<!-- gh-comment-id:3084893307 --> @AlyaGomaa commented on GitHub (Jul 17, 2025): Hey any updates about this issue??
Author
Owner

@github-actions[bot] commented on GitHub (Aug 19, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:3198780405 --> @github-actions[bot] commented on GitHub (Aug 19, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@the-hottest-bulb commented on GitHub (Aug 26, 2025):

This issue is very much still relevent, the only reason I haven't switched to deepseek from ChatGPT is because of this missing feature. For power users this is a key issue and is definitely whats keeping many users from switching to it.

<!-- gh-comment-id:3225896288 --> @the-hottest-bulb commented on GitHub (Aug 26, 2025): This issue is very much still relevent, the only reason I haven't switched to deepseek from ChatGPT is because of this missing feature. For power users this is a key issue and is definitely whats keeping many users from switching to it.
Author
Owner

@github-actions[bot] commented on GitHub (Sep 27, 2025):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!

<!-- gh-comment-id:3340841568 --> @github-actions[bot] commented on GitHub (Sep 27, 2025): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
Author
Owner

@github-actions[bot] commented on GitHub (Oct 11, 2025):

false

<!-- gh-comment-id:3392630146 --> @github-actions[bot] commented on GitHub (Oct 11, 2025): false
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-R1#55
No description provided.