# Memory Customization

**URL:** <https://community.crewai.com/t/memory-customization/2880>\
**Category:** General\
**Created:** [January 16, 2025, 2:19pm UTC](https://community.crewai.com/t/memory-customization/2880 "2025-01-16T14:19:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darshan\_Ravichandira](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/darshan_ravichandira/32/2067_2.png) [@Darshan\_Ravichandira](https://community.crewai.com/u/Darshan_Ravichandira)\
**Post date:** [January 16, 2025, 2:19pm UTC](https://community.crewai.com/t/memory-customization/2880/1 "2025-01-16T14:19:27Z")

</div>

Hi! Im trying to use the memory for Crew. But I get some unexpected errors.

from crewai import Crew, Process

```
indent preformatted text by 4 spaces

Rag_agent=Crew(
agents=[context_retriver_agent,senior_api_developer_agent],
tasks=[context_retrieval_task,api_development_task],
memory=True,
verbose=True,
embedder={
    "provider": "huggingface",
    "config": {
        "model": "sentence-transformers/all-mpnet-base-v2",
    }},
long_term_memory=LongTermMemory(
      storage=LTMSQLiteStorage(
          db_path="/content/long_term/mydatabase.db"
      )
  ),
  short_term_memory=ShortTermMemory(
      storage=RAGStorage(
          type='short_term',
          path="./short",
          embedder_config={"provider": "huggingface",
    "config": {
        "model": "sentence-transformers/all-mpnet-base-v2",
    }},
         
      ),
  entity_memory=EntityMemory(
      storage=RAGStorage(
          type="entity_storage",
          path="./entity",
        
          embedder_config={"provider": "huggingface",
              "config": {
              "model": "sentence-transformers/all-mpnet-base-v2",
    }},
         
      )

```

These are the errors I got.  
ERROR:root:Error during entity\_storage save: Request URL is missing an ‘http://’ or ‘https://’ protocol. in add.

MEMORY ERROR: An error occurred while saving to LTM: unable to open database file

For longterm memory do we need to create database?  
This might be a silly question but I cant figure this out.

---

<div class="post-metadata">

**Author:** ![Abdelrahman\_Khalil](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/abdelrahman_khalil/32/1361_2.png) [@Abdelrahman\_Khalil](https://community.crewai.com/u/Abdelrahman_Khalil)\
**Post date:** [January 17, 2025, 4:12pm UTC](https://community.crewai.com/t/memory-customization/2880/2 "2025-01-17T16:12:07Z")

</div>

1. regarding the long\_term memory make sure this directory exist “/content/long\_term/”.

2. for short\_term and entity memory, iam having the same issue of “Request URL is missing an ‘http://’ or ‘https://’ protocol. in add.”

---

<div class="post-metadata">

**Author:** ![Darshan\_Ravichandira](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/darshan_ravichandira/32/2067_2.png) [@Darshan\_Ravichandira](https://community.crewai.com/u/Darshan_Ravichandira)\
**Post date:** [January 19, 2025, 3:45pm UTC](https://community.crewai.com/t/memory-customization/2880/3 "2025-01-19T15:45:05Z")

</div>

i managed to overcome the issue of “Request URL is missing an ‘http://’ or ‘https://’ protocol. in add.” by configuring the embedder like this.

```
from crewai import Crew, Process
Rag_agent=Crew(
    agents=[context_retriver_agent,senior_api_developer_agent],
    tasks=[context_retrieval_task,api_development_task],
    memory=True,
    verbose=True,
    knowledge_sources=[string_source],
    embedder={"provider": "huggingface",
        "config": {
            "api_url": "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2",
            "headers":{"Authorization": f"Bearer {api_key}"}}},
    
    long_term_memory=LongTermMemory(storage=LTMSQLiteStorage(db_path="/content/long_term/mydatabase.db")),
        
    short_term_memory=ShortTermMemory(storage=RAGStorage(type='short_term',path="./short",
                                                                     embedder_config={"provider": "huggingface",
                                                                                      "config": { "api_url": "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2",
                                                                                                 "headers":{"Authorization": f"Bearer {api_key}"}}})),
    entity_memory=EntityMemory(storage=RAGStorage(type="entity_storage",path="./entity",
                                                    embedder_config={"provider": "huggingface",
                                                                     "config": {
                                                                         "api_url": "https://api-inference.huggingface.co/models/sentence-transformers/all-mpnet-base-v2",
                                                                         "headers":{"Authorization": f"Bearer {api_key}"}}})),
        
              
)

```

But I got three sets of error on three different run.

1. I got this at the first run. I think this is ok. It just say it needs time to load the model.

2. After this, I run the code again. This time there is no error in loading the embedding but I got the error from the huggingface embedder model.I used the StringKnowledgeSource as the knowledgesource.

Now I don’t know how to move past this. And one more thing, why can’t we use the same embedder for the short term and entity memory?
