|
| 1 | +## INITIAL IDEA PROPOSAL |
| 2 | + |
| 3 | +### **CONTACT INFORMATION** |
| 4 | + |
| 5 | +* Name: Udhay Adithya J |
| 6 | + |
| 7 | +* [Github](https://github.com/Udhay-Adithya) |
| 8 | +* [Website](https://udhay-adithya.me) |
| 9 | +* [LinkedIn](https://www.linkedin.com/in/udhay-adithya/) |
| 10 | +* Location: Amravati, Andhra Pradesh, India, UTC+5:30 |
| 11 | +* University: Vellore Institute of Technology, Andhra Pradesh |
| 12 | +* Major: Computer Science & Engineering |
| 13 | +* Degree: Bachelor of Technology |
| 14 | +* Year: Sophomore, 2nd Year |
| 15 | +* Expected graduation date: 2027 |
| 16 | + |
| 17 | + |
| 18 | +### **PROJECT TITLE: [mem0](https://github.com/mem0ai/mem0) for Dart** |
| 19 | + |
| 20 | +### **PROJECT DESCRIPTION:** |
| 21 | + |
| 22 | +mem0 is the goto memory layer for developing personalized AI Agents in Python. It offers comprehensive memory management, self-improving memory capabilities, cross-platform consistency, and centralized memory control. It leverages advanced LLMs and algorithms to detect, store, and retrieve memories from conversations and interactions. It identifies key information such as facts, user preferences, and other contextual information, smartly updates memories over time by resolving contradictions, and supports the development of an AI Agent that evolves with the user interactions. When needed, mem0 employs a smart search system to find memories, ranking them based on relevance, importance, and recency to ensure only the most useful information is presented. |
| 23 | + |
| 24 | +However, a critical gap exists in the Flutter ecosystem for a dedicated memory layer tailored for AI agent development. Flutter, with its cross-platform capabilities and vibrant community, is increasingly becoming a platform of choice for building mobile and embedded AI applications. |
| 25 | + |
| 26 | +This project proposes to bridge this gap by porting the powerful [mem0](https://github.com/mem0ai/mem0) library from Python to Dart, thereby making its advanced memory management features accessible to Flutter developers. |
| 27 | + |
| 28 | +### **PROJECT GOALS:** |
| 29 | + |
| 30 | +The primary goal of this project is to create a fully functional Dart port of the `mem0` library. |
| 31 | + |
| 32 | +Upon successful completion of this project, we will have: |
| 33 | + |
| 34 | +* `mem0_dart` as a standalone package in [pub.dev](https://pub.dev/). |
| 35 | +* Seamless integration of `mem0_dart` into Flutter applications, enabling developers to build personalized AI agents on mobile, web, and desktop platforms. |
| 36 | + |
| 37 | +### **IMPLEMENTATION PROCESS** |
| 38 | + |
| 39 | +Porting `mem0` from Python to Dart is a incremental process and features can be added in a sequence, we have the flexibilty to build block-by-block. |
| 40 | + |
| 41 | +I have also opened a discussion([#2373](https://github.com/mem0ai/mem0/discussions/2373)) about this in mem0’s GitHub Discussions |
| 42 | + |
| 43 | + |
| 44 | +**These are some of the packages that are required and will be used in this project:** |
| 45 | + |
| 46 | +**→ LLM and Embedding Support Packages** |
| 47 | + |
| 48 | +- [anthropic_sdk_dart](https://pub.dev/packages/anthropic_sdk_dart) |
| 49 | +- [aws_client](https://pub.dev/packages/aws_client) |
| 50 | +- [googleai_dart](https://pub.dev/packages/googleai_dart/versions) |
| 51 | +- [groq](https://pub.dev/packages/groq) |
| 52 | +- [openai_dart](https://pub.dev/packages/openai_dart) |
| 53 | +- [ollama_dart](https://pub.dev/packages/ollama_dart) |
| 54 | +- [vertex_ai](https://pub.dev/packages/vertex_ai) |
| 55 | +- [together_ai_sdk](https://pub.dev/packages/together_ai_sdk) |
| 56 | + |
| 57 | + |
| 58 | +**→ Vector Store Packages** |
| 59 | + |
| 60 | +- [chromadb](https://pub.dev/packages/chromadb) |
| 61 | +- [elastic_client](https://pub.dev/packages/elastic_client) |
| 62 | +- [pgvector](https://pub.dev/packages/pgvector) |
| 63 | +- [qdrant](https://pub.dev/packages/qdrant) |
| 64 | +- [redis](https://pub.dev/packages/redis) |
| 65 | + |
| 66 | +**→ Other packages** |
| 67 | + |
| 68 | +- [http](https://pub.dev/packages/http)/[dio](https://pub.dev/packages/dio) |
| 69 | +- [neo4j_http_client](https://pub.dev/packages/neo4j_http_client) |
| 70 | +- [huggingface_dart](https://pub.dev/packages/huggingface_dart) |
| 71 | +- [posthog_flutter](https://pub.dev/packages/posthog_flutter) |
| 72 | + |
| 73 | + |
| 74 | +**Note**: The following are some of the packages used in the original `mem0` project that are currently unavailable in the Dart ecosystem. I am actively searching for alternatives, and this list will be updated as suitable replacements are found. |
| 75 | + |
| 76 | +- **litellm** – N/A |
| 77 | +- **azure-search-documents** – N/A |
| 78 | +- **opensearch** – N/A |
| 79 | +- **milvus** – No direct Dart package, but it can be accessed via HTTP APIs. |
| 80 | + |
| 81 | +### **USAGE** |
| 82 | + |
| 83 | +The `mem0_dart` library will be designed to be intuitive and easy to integrate into Flutter applications. Here's a basic example illustrating its intended usage: |
| 84 | + |
| 85 | +**Initialization:** |
| 86 | + |
| 87 | +```dart |
| 88 | +import 'package:mem0_dart/mem0_dart.dart'; |
| 89 | +
|
| 90 | +void main() async { |
| 91 | + // Initialize Mem0 with default configurations or custom settings |
| 92 | + final memory = Memory(); // Using default configurations |
| 93 | +
|
| 94 | + // Or with custom configurations (example - Qdrant vector store) |
| 95 | + final memoryWithQdrant = Memory( |
| 96 | + vectorStoreConfig: VectorStoreConfig( |
| 97 | + provider: 'qdrant', |
| 98 | + config: { |
| 99 | + 'collection_name': 'my_flutter_memories', |
| 100 | + 'embedding_model_dims': 1536, // Example dimension |
| 101 | + 'path': '/path/to/qdrant/db', // Example path for local Qdrant |
| 102 | + }, |
| 103 | + ), |
| 104 | + llmConfig: LlmConfig( // Example - OpenAI LLM for memory processing |
| 105 | + provider: 'openai', |
| 106 | + config: { |
| 107 | + 'model': 'gpt-4o-mini', |
| 108 | + 'apiKey': 'YOUR_OPENAI_API_KEY', |
| 109 | + }, |
| 110 | + ), |
| 111 | + embedderConfig: EmbedderConfig( // Example - OpenAI Embedding model |
| 112 | + provider: 'openai', |
| 113 | + config: { |
| 114 | + 'model': 'text-embedding-3-small', |
| 115 | + 'apiKey': 'YOUR_OPENAI_API_KEY', |
| 116 | + }, |
| 117 | + ), |
| 118 | + ); |
| 119 | +
|
| 120 | + // ... rest of your Flutter app code |
| 121 | +} |
| 122 | +``` |
| 123 | + |
| 124 | +**Adding Memories:** |
| 125 | + |
| 126 | +```dart |
| 127 | +// ... inside your Flutter widget or logic |
| 128 | +
|
| 129 | + String userMessage = "I love Flutter and Dart!"; |
| 130 | + String userId = "flutter_dev_123"; |
| 131 | +
|
| 132 | + try { |
| 133 | + final memoryResult = await memory.add( |
| 134 | + messages: userMessage, |
| 135 | + userId: userId, |
| 136 | + ); |
| 137 | + print('Memory Added: ${memoryResult}'); |
| 138 | + } catch (e) { |
| 139 | + print('Error adding memory: $e'); |
| 140 | + } |
| 141 | +``` |
| 142 | + |
| 143 | +## **MILESTONES AND DELIVERABLES** |
| 144 | + |
| 145 | + |
| 146 | +I propose to divide the project into four milestones/deliverables to produce a sequential progress report through the GSoC. |
| 147 | + |
| 148 | +*They are NOT of equal sizes/time* requirements. |
| 149 | + |
| 150 | +#### **Milestone #1: Create a Bare-bone `package: mem0_dart`.** |
| 151 | + |
| 152 | +This milestone will lay the foundation of `mem0_dart` library, porting core configuration classes and setting up testing frameworks. |
| 153 | + |
| 154 | +This milestone will be the first deliverable but it will take the least amount of time and effort to build. |
| 155 | + |
| 156 | +#### **Milestone #2: Vector Store Integrations** |
| 157 | + |
| 158 | +This milestone will integrate and implement multiple Vecotor DB providers available in Dart. |
| 159 | + |
| 160 | +Implementation efforts will concentrate more on the core methods (insert, search, delete, and get). |
| 161 | + |
| 162 | +#### **Milestone #3: LLM and Embedding Model Integration with Basic Functionality** |
| 163 | + |
| 164 | +This Milestone is divided into two parts. The first path will aim at adding integrations for multiple Embedding models. |
| 165 | + |
| 166 | +The second part will add integrations for LLMs and additionally the core memory operations for addition, retrieval, and updating will be ported and tested. |
| 167 | + |
| 168 | +#### **Milestone #4: Add Graph Memory Capabilty** |
| 169 | + |
| 170 | +The final milestone of the project proposes to add Graph memory capabilities by implementing Neo4j integration. |
| 171 | + |
| 172 | +## **[GSOC 2025 TIMELINE](https://developers.google.com/open-source/gsoc/timeline) FOR REFERENCE** |
| 173 | + |
| 174 | + |
| 175 | +**May 8 - 18:00 UTC** |
| 176 | +* Accepted GSoC contributor projects announced |
| 177 | + |
| 178 | +**May 8 - June 1** |
| 179 | +* Community Bonding Period | GSoC contributors get to know mentors, |
| 180 | +read documentation, and get up to speed to begin working on their |
| 181 | +projects |
| 182 | + |
| 183 | +**June 2** |
| 184 | +* Coding officially begins! |
| 185 | + |
| 186 | +**July 14 - 18:00 UTC** |
| 187 | +* Mentors and GSoC contributors can begin submitting midterm evaluations |
| 188 | + |
| 189 | +**July 18 - 18:00 UTC** |
| 190 | +* Midterm evaluation deadline (standard coding period) |
| 191 | + |
| 192 | +**July 14 - August 25** |
| 193 | +* Work Period | GSoC contributors work on their project with guidance from Mentors |
| 194 | + |
| 195 | +**August 25 - September 1 - 18:00 UTC** |
| 196 | +* Final week: GSoC contributors submit their final work product and |
| 197 | +their final mentor evaluation (standard coding period) |
| 198 | + |
| 199 | +## **PREDICTED PROJECT TIMELINE** |
| 200 | +* **Community Bonding Period (May 8 - June 1)** |
| 201 | + |
| 202 | + This is the period where I will get to know my mentors better. I will also ask questions and attempt to clarify the doubts and queries in my mind, to get a clear understanding of the project. Although Google recommends this 3-week bonding period to be entirely for the introduction of GSoC Contributors into their projects, since we are going to build a brand new package, I propose to begin coding from the 2nd or 3rd week of this period, thus adding a headstart. |
| 203 | + |
| 204 | +* **Coding Period (June 2 - July 14)** |
| 205 | + * **Week 1 (June 2 - June 8)** |
| 206 | + |
| 207 | + <u>M#1 is delivered, comprising of a bare-bones package.</u> |
| 208 | + |
| 209 | + Work on M#2 begins in the latter half of the week. |
| 210 | + * **Week 2 (June 9 - June 15)** |
| 211 | + |
| 212 | + Integration of first two chosen vector database and implementation of basic vector operations(insert, search, delete, and get) are done, along with unit tests. |
| 213 | + |
| 214 | + * **Week 3 (June 16 - June 22)** |
| 215 | + |
| 216 | + Building upon the previous week, the integration of the other remaining vector databases will be done. |
| 217 | + |
| 218 | + * **Week 4 (June 16 - June 22)** |
| 219 | + |
| 220 | + Based on the implementation experience and testing feedback from the Vector Database integrations, refinements will be made to ensure robustness and efficiency. |
| 221 | + |
| 222 | + * **Week 5 (June 23 - June 29)** |
| 223 | + |
| 224 | + Start of M#3 by integrating OpenAI and Gemini's LLM and embedding models. |
| 225 | + |
| 226 | + This week will also contain steps of documenting the package for initial public release. |
| 227 | + |
| 228 | + Mentor Reviews are requested. |
| 229 | + |
| 230 | + *`The first public release of package mem0_dart:0.0.1 is made.`* |
| 231 | + |
| 232 | + * **Week 6 (June 30 - July 6)** |
| 233 | + |
| 234 | + Changes follow, from Mentor Review, if required. |
| 235 | + |
| 236 | + Add support for other LLM and Embedding model providers(Since the same process has been done earlier this must be fairly easy to implement). |
| 237 | + |
| 238 | + Final Mentor Review before Mid-term Evaluation is submitted. |
| 239 | + |
| 240 | +* **Midterm Evaluation Submission (July 14 - July 18)** |
| 241 | + * Projects are submitted to the mentors and the GSoC portal. |
| 242 | + |
| 243 | +* **Work Period (July 14 - August 25)** |
| 244 | + * **Week 7 (July 14 - July 20)** |
| 245 | + |
| 246 | + A significant portion of the week will be dedicated to testing all integrations thoroughly and addressing any bugs or issues identified. |
| 247 | + |
| 248 | + Documentation is enhanced in the if no issues arise. |
| 249 | + <u>Milestone #3 is delivered.</u> |
| 250 | + |
| 251 | + *`Second public release of package at 0.0.2`* |
| 252 | + |
| 253 | + * **Week 8 (July 21 - July 27)** |
| 254 | + |
| 255 | + Classes for graph database connections using Neo4j are created. |
| 256 | + |
| 257 | + * **Week 9 (July 28 - August 3)** |
| 258 | + |
| 259 | + Implementation of basic graph operations to store memories as graphs. |
| 260 | + |
| 261 | + * **Week 10 (August 4 - August 10)** |
| 262 | + |
| 263 | + Continuation of the work done in Week 9. |
| 264 | + |
| 265 | + Mentor Reviews are requested. |
| 266 | + |
| 267 | + * **Week 11 (August 11 - August 17)** |
| 268 | + |
| 269 | + The former half of the week acts as a buffer period in case any issues are confronted. |
| 270 | + |
| 271 | + Documentation is enhanced in the buffer period if no issues arise. |
| 272 | + |
| 273 | + <u>Milestone #4 is delivered.</u> |
| 274 | + |
| 275 | + *`Third public release of the package at 0.0.3`* |
| 276 | + |
| 277 | + * **Week 12 (August 18 - August 24)** |
| 278 | + |
| 279 | + Final checks are made, and any supporting documents (such as example markdown files) are written. |
| 280 | + |
| 281 | + The project Report is written and all tracking issues are labelled appropriately. |
| 282 | + |
| 283 | +* **Final Week (August 25 - September 1)** |
| 284 | + * The final project and the report are submitted to the mentors and on the GSoC portal. |
0 commit comments