

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# Memory Management Guidelines67## Purpose of Memory89Memory in AI applications allows agents to process, store, and effectively recall information from past interactions, enabling learning and adaptation to user preferences.1011* **Short-term Memory (Thread-scoped):** Persists conversational turns (`messages`) within a single session for context and continuity. Managed as part of the agent's state.12* **Long-term Memory (Cross-thread):** Retains information across different conversations or users. Stored in custom namespaces via the `Store` interface.13* **Checkpointing:** Saves snapshots of the graph state at every "super-step" for continuity, debugging, and fault tolerance.1415## Implementation Details (`src/memory/`)1617* **MongoDB Integration:** MongoDB is the primary backend for memory persistence, including chat history, vector stores, and checkpoints.18* **`MongoDBSaver` (`@langchain/langgraph-checkpoint-mongodb`):** Used for LangGraph checkpointing, ensuring graph state can be saved and reloaded.19* **`MongoDBStore`:** Provides a generic key-value store interface over MongoDB for various data types, supporting long-term memory.20* **`MongoDBChatMessageHistory`:** Manages the storage and retrieval of chat messages in MongoDB.21* **`MongoDBAtlasVectorSearch`:** Integrates with MongoDB Atlas Vector Search for efficient semantic search over embeddings. Uses Google embeddings.2223## Best Practices for Memory2425* **Session Management:** Ensure unique `sessionId`s are used for different conversations to maintain isolated contexts.26* **Environment Variables:** `MONGODB_ATLAS_URI` must be set for database connection.27* **Vector Indexing:** Ensure vector search indexes are properly created and maintained for efficient vector lookups (e.g., `vector_index` in `src/memory/storage.ts`). Note that Google embeddings are typically 768 dimensions.28* **Data Consistency:** Be mindful of data consistency when updating and retrieving memory components.29* **Scalability:** Consider the implications of memory storage on scalability for large-scale deployments.30* **Managing Conversation History:** Implement strategies to manage long conversation histories (e.g., trimming, summarizing) to prevent context window overflow and reduce costs. The `MessagesAnnotation` with `messagesStateReducer` is crucial for handling message updates and deletions.31* **Memory Store Usage:** Use the `Store` interface for cross-thread persistence. Define clear namespaces and keys for organizing memories. Implement semantic search for natural language retrieval.32* **Writing Memories:** Decide whether to write memories "on the hot path" (real-time, potentially impacting latency) or "in the background" (as a separate task).33* **Memory Representation:** Consider how memories are presented to the LLM (e.g., as updated instructions, few-shot examples) to optimize its performance.34
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| ssdeanx/langgraph-dm.clinerules/agents.md · 0 | Cline rules | typesagent-behaviour | 44/100 | 14 days ago | |
| ssdeanx/langgraph-dm.clinerules/development_guidelines.md · 0 | Cline rules | setupbuildtestlint-format+3 | 83/100 | 14 days ago | |
| ssdeanx/langgraph-dm.clinerules/docs-technical-style.md · 0 | Cline rules | setuplint-formatstyledocs | 53/100 | 14 days ago | |
| ssdeanx/langgraph-dm.clinerules/langgraphjs.md · 0 | Cline rules | arch | 52/100 | 14 days ago | |
| ssdeanx/langgraph-dm.clinerules/project_overview.md · 0 | Cline rules | testlint-formatstylearch | 75/100 | 14 days ago | |
| ssdeanx/langgraph-dm.clinerules/subgraphs.md · 0 | Cline rules | agent-behaviour | 48/100 | 14 days ago | |
| ssdeanx/langgraph-dm.github/copilot-instructions.md · 0 | Copilot instructions | setupsecuritydeploymentdo-not+2 | 57/100 | 14 days ago | |
| ssdeanx/langgraph-dm.windsurf/rules/graphs.md · 0 | Windsurf rules | do-not | 55/100 | 14 days ago | |
| ssdeanx/langgraph-dm.windsurf/rules/langsmith.md · 0 | Windsurf rules | do-notagent-behaviour | 55/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 32k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | 12 days ago | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 14 days ago | |
| tsongglod123/excel-formula-visualizer.clinerules/development.md · 0 | Cline rules | setupbuildtestarch+2 | 86/100 | today | |
| cline/cline.clinerules/general.md · 66k | Cline rules | setupbuildstylearch+2 | 86/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/ssdeanx-langgraph-dm-clinerules-memory)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.