Skip to content

using LMStudio, search returns no results #3788

@MatthiasHowellYopp

Description

@MatthiasHowellYopp

🐛 Describe the bug

Running the mem0 OSS getting started sample with LMStudio,Ollama,Valkey - results are empty:

python main.py
{'results': []}

code is :

from mem0 import Memory

def main():
    config = {
       "vector_store": {
           "provider":"valkey",
           "config": {
               "collection_name":"mem0test",
               "valkey_url":"valkey://192.168.5.111:6380",
               "embedding_model_dims":1024,
               "index_type":"flat"
               }
       },
       "llm":  {
              "provider":"lmstudio",
              "config": {
                "model":"lmstudio-community/Meta-Llama-3.1-70B-Instruct-GGUF/Meta-Llama-3.1-70B-Instruct-IQ2_M.gguf",
                "temperature":0.2,
                "max_tokens":2000,
                "lmstudio_base_url":"http://192.168.5.24:1234/v1",
                "lmstudio_response_format": {"type": "json_schema", "json_schema": {"type": "object", "schema": {}}},
                }       
        },
        "embedder": {
            "provider":"ollama",
            "config": {
                "model":"mxbai-embed-large:latest",
                "ollama_base_url":"http://192.168.5.111:11434"
                
            }
        }
    }
        
    m:Memory = Memory.from_config(config)
    messages = [
    {"role": "user", "content": "Hi, I'm Alex. I love basketball and gaming."},
    {"role": "assistant", "content": "Hey Alex! I'll remember your interests."}
    ]
    m.add(messages, user_id="alex")
    results = m.search("What do you know about me?", user_id= "alex")
    print(results)


if __name__ == "__main__":
    main()

When I tried with gpt-oss the contents came back as a floating point value. With this llm the result look like:

 "id": "chatcmpl-lvjf4hppwvnjv1m4yci4l",
  "object": "chat.completion",
  "created": 1764107940,
  "model": "meta-llama-3.1-8b-instruct",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "{\n  \"memory\": [\n    {\n      \"id\": \"0\",\n      \"text\": \"Name is Alex\",\n      \"event\": \"ADD\"\n    },\n    {\n      \"id\": \"1\",\n      \"text\": \"Love basketball\",\n      \"event\": \"ADD\"\n    },\n    {\n      \"id\": \"2\",\n      \"text\": \"Love gaming\",\n      \"event\": \"ADD\"\n    }\n  ]\n}",
        "tool_calls": []
      },
      "logprobs": null,
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 1511,
    "completion_tokens": 89,
    "total_tokens": 1600
  },
  "stats": {},
  "system_fingerprint": "meta-llama-3.1-8b-instruct"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumAnnoying but has workaroundsbugSomething isn't workingsdk-pythonPython SDK specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions