{"id":39169353,"url":"https://github.com/sammyne/langmem0","last_synced_at":"2026-01-20T16:58:44.725Z","repository":{"id":331613552,"uuid":"1128078286","full_name":"sammyne/langmem0","owner":"sammyne","description":"LangChain memory toolkit powered by https://mem0.ai","archived":false,"fork":false,"pushed_at":"2026-01-10T12:21:29.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T03:26:57.643Z","etag":null,"topics":["agentic-memory","ai-agents","langchain"],"latest_commit_sha":null,"homepage":"https://sammyne.github.io/langmem0/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammyne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-05T05:30:07.000Z","updated_at":"2026-01-10T12:21:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sammyne/langmem0","commit_stats":null,"previous_names":["sammyne/langmem0"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sammyne/langmem0","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyne%2Flangmem0","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyne%2Flangmem0/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyne%2Flangmem0/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyne%2Flangmem0/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammyne","download_url":"https://codeload.github.com/sammyne/langmem0/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammyne%2Flangmem0/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28519900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-memory","ai-agents","langchain"],"created_at":"2026-01-17T22:18:21.885Z","updated_at":"2026-01-17T22:18:22.423Z","avatar_url":"https://github.com/sammyne.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LangMem0\n\n📚 [Documentation](https://sammyne.github.io/langmem0/)\n\n[![PyPI version](https://badge.fury.io/py/langmem0.svg)](https://pypi.org/project/langmem0/)\n![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)\n[![Lint with Ruff](https://github.com/sammyne/langmem0/actions/workflows/lint.yml/badge.svg)](https://github.com/sammyne/langmem0/actions/workflows/lint.yml)\n\n## Installation\n\nInstall via `uv`\n\n```bash\nuv add langmem0\n```\n\nInstall via `pip`\n\n```bash\npip install langmem0\n```\n\n## Examples quickstart\n\n### 0. Environment\n\n- uv \u003e= 0.9\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/sammyne/langmem0.git\ncd langmem0\n```\n\n### 2. Install dependencies\n\n```bash\nuv pip install -e .\n```\n\n### 3. Set up environment variables\n\nCreate a `.env` file in the project root with your OpenAI configuration:\n\n```bash\nOPENAI_API_KEY=your_api_key_here\nOPENAI_API_BASE_URL=https://api.openai.com/v1\nOPENAI_MODEL=gpt-4o-mini\n```\n\n### 4. Run examples\n\nLangMem0 provides two main ways to integrate memory into your LangChain applications:\n\n#### Middleware Examples\n\nUse `Mem0Middleware` to enable memory in LangChain agent conversations. This approach provides fine-grained control over memory operations.\n\n```bash\n# Synchronous example\nuv run examples/middleware/helloworld.py\n\n# Asynchronous example\nuv run examples/middleware/helloworld_async.py\n```\n\nThese examples demonstrate:\n- Using `Mem0Middleware` to intercept and augment agent messages with memories\n- How agents can remember and retrieve information across conversations\n- Different thread contexts for separate conversation memories\n- Integration with LangGraph checkpoints\n\n#### Chat Examples\n\nUse `ChatOpenAI` with built-in Mem0 memory capabilities for a simpler integration path.\n\n```bash\n# Basic synchronous example\nuv run examples/chat/helloworld.py\n\n# Basic asynchronous example\nuv run examples/chat/helloworld_async.py\n\n# Advanced synchronous with RunnableConfig:**\nuv run examples/chat/runnable_config.py\n\n# Advanced asynchronous with RunnableConfig:**\nuv run examples/chat/runnable_config_async.py\n```\n\nThese examples demonstrate:\n- Direct integration with OpenAI-compatible chat models\n- Memory-enabled conversations with minimal setup\n- Using `RunnableConfig` for thread management\n- Both sync and async API patterns\n\n## FAQ\n### Why not provide tool-based API like langmem\nTool-based API has a problem: system prompt needs augumenting with memories using a separate middleware as demonstrated\nby [LangMem's Hot Path Quickstart](https://langchain-ai.github.io/langmem/hot_path_quickstart/#agent).\n\n## References\n- [LangChain Chatbot](https://chat.langchain.com/?threadId=e7011d54-12ce-4c14-8d2a-324996e0d0de)\n- [LangChain forum](https://forum.langchain.com/c/oss-product-help-lc-and-lg/langchain/14)\n- [Mem0 Open Source](https://docs.mem0.ai/open-source/overview)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammyne%2Flangmem0","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammyne%2Flangmem0","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammyne%2Flangmem0/lists"}