Skip to content

Memlayer v0.1.8 - Plug and Play Memory for LLMs

Latest

Choose a tag to compare

@divagr18 divagr18 released this 22 Nov 00:48
· 4 commits to main since this release

Memlayer Release Notes - v0.1.8

"Ollama Stability Update"

This patch release focuses on significantly improving the stability of the Ollama wrapper, specifically addressing issues with JSON parsing and support for local models that output internal thought processes.

Key Improvements

Support for "Thinking" Models (<think> tags)

Many modern local models output an internal monologue wrapped in <think>...</think> tags before providing the final JSON response. Previously, this caused JSONDecodeError because the parser attempted to read the thought process as data.

  • Fix: The Ollama wrapper now identifies and strips <think> tags via Regex before attempting to parse tool calls or knowledge extraction.
  • Result: You can now use models with "Chain of Thought" capabilities for memory operations without crashing.

Robust JSON Extraction

Local models are chatty. They often wrap JSON in Markdown code blocks (```json) or add conversational filler ("Here is the data...").

  • Fix: Replaced strict json.loads with a robust Regex extraction strategy (_clean_and_parse_json). Memlayer now surgically locates the JSON object ({...}) inside the model's raw output, ignoring surrounding noise.
  • Addressed Errors: Fixes Expecting value: line 1 column 1 and Extra data errors that occurred when models "thought out loud."

Bug Fixes

  • Trace Event Error: Fixed an AttributeError: 'TraceEvent' object has no attribute 'event_type' in examples/05_providers/ollama_example.py. The script now correctly uses event.name.
  • Default Model Updates: Updated docstrings and examples to default to llama3.2, ensuring examples run smoothly out of the box with standard Ollama setups.

Upgrade Instructions

Update your package to apply these fixes:

pip install --upgrade memlayer