Introducing Virtual MCP Servers
LogoLogo
GithubJoin SlackSignupBook a Demo
  • Documentation
  • Self Hosted
  • Integrations
  • Guides
  • Enterprise
  • Examples
  • OpenAI
  • Vercel AI SDK
  • DeepSeek
  • Anthropic
  • LangChain
  • CrewAI
  • Gemini
  • Bedrock
  • xAI
  • TogetherAI
  • FireworksAI
  • DeepInfra
  • OpenRouter
  • Smithery
  • LlamaIndex
  • Supabase
  • Mem0
Powered by GitBook
LogoLogo

Social

  • LinkedIn
  • X
  • Youtube
  • Github

Platform

  • Pricing
  • Documentation
  • Blog

Company

  • Home
  • About

Legal

  • Privacy Policy
  • Terms of Service

2025 LangDB. All rights reserved.

On this page

Was this helpful?

Export as PDF

Mem0

Use LangDB with Mem0 to store memories, embed text, and streamline LLM interactions across scalable applications.

PreviousSupabase

Was this helpful?

LangDB seemlessly integrate with Mem0.

Check out the for more information.

1

Install mem0 Client

pip install mem0ai python-dotenv
2

Add LangDB into your code

from mem0 import Memory
from dotenv import load_dotenv
load_dotenv()
import os
langdb_api_key = os.getenv("LANGDB_API_KEY")
langdb_project_id = os.getenv("LANGDB_PROJECT_ID")
base_url =  f"https://api.us-east-1.langdb.ai/{langdb_project_id}/v1"  

config = {
    "llm": {
        "provider": "openai",
        "config": {
            "model": "gpt-4o",
            "temperature": 0.0,
            "api_key": langdb_api_key,
            "openai_base_url": base_url,
        },
    },
    "embedder": {
        "provider": "openai",
        "config": {
            "model": "text-embedding-ada-002",
            "api_key": langdb_api_key,
            "openai_base_url": base_url,
        },
    }
}
m = Memory.from_config(config_dict=config)

result = m.add(
    "I like to take long walks on weekends.",
    user_id="alice",
    metadata={"category": "hobbies"},
)

print(result)

Mem0 documentation