Skip to content

chore(release): prepare v0.1.71#22

Merged
kargarisaac merged 55 commits intomainfrom
feat/dspy-react-migration
Apr 13, 2026
Merged

chore(release): prepare v0.1.71#22
kargarisaac merged 55 commits intomainfrom
feat/dspy-react-migration

Conversation

@kargarisaac
Copy link
Copy Markdown
Contributor

Summary

  • bump package version to 0.1.71
  • add release notes for status/telemetry improvements and maintain fix in CHANGELOG.md
  • align docs with current CLI behavior (status --live, scope flags, queue filtering, unscoped)
  • add a CLI compatibility wrapper _render_status_output(...) to keep existing tests/callers stable after renderer modularization

Docs updated

  • README.md
  • docs/cli/status.md
  • docs/cli/ask.md
  • docs/cli/memory.md
  • docs/cli/overview.md
  • docs/guides/querying-memories.md
  • docs/quickstart.md
  • src/lerim/skills/cli-reference.md
  • docs/changelog.md

Validation

  • uv run python -m pytest tests/unit/test_cli.py tests/unit/test_cli_commands.py tests/unit/test_cli_queue.py tests/unit/test_project_scope.py tests/unit/test_api_functions.py -q
  • uv run mkdocs build --strict
  • uv run ruff check src/lerim/server/cli.py
  • uv run lerim --version (reports 0.1.71)

kargarisaac and others added 30 commits April 1, 2026 15:38
Replace OAI-based agent stack with ask/sync/maintain agents, shared
context and tools, and consolidated runtime. Remove legacy OAI modules,
prompts, and their tests. Update app wiring, config, tracing, and
memory schema references.

Made-with: Cursor
Refresh root and package READMEs, changelog, configuration docs, and
concepts to match the new runtime and model roles.

Made-with: Cursor
…ucture

Major refactoring of the memory system based on Claude Code's leaked architecture:

Schema:
- 4-type taxonomy (user/feedback/project/reference) replaces primitive/kind
- 3-field frontmatter (name, description, type) replaces 9-field schema
- Flat memory directory (no decisions/learnings subdirs)

Agents:
- ExtractAgent reads traces directly via tools (no separate pipeline)
- MaintainAgent simplified to 4-phase dream (Orient/Gather/Consolidate/Prune)
- AskAgent uses manifest-based retrieval (no FTS/vector search)
- New tools: scan_memory_manifest, update_memory_index, write_summary

Deleted:
- extract_pipeline.py (replaced by ExtractAgent reading trace directly)
- summarization_pipeline.py (ExtractAgent writes summaries)
- memory_index.py (FTS5+vector search — manifest scan replaces it)
- access_tracker.py (decay formula replaced by staleness caveats)
- fastembed + sqlite-vec dependencies (~500MB)
- 10+ small files inlined into callers

Restructured:
- runtime/ → agents/ (agents, tools, schemas, context, contracts)
- app/ → server/ (httpd, api, daemon, cli, runtime) + cloud/ (shipper, auth)
- runtime/providers.py → config/providers.py

Net: -7,600 lines, -2 heavy deps, cleaner architecture

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
748 new tests across 8 new test files + 6 expanded files:

- test_transcript.py (118 tests): full coverage for trace formatting
- test_auth.py (32): OAuth flows, token management
- test_api_functions.py (54): server API logic, docker, agent detection
- test_daemon_functions.py (50): lock management, window bounds, sync/maintain
- test_httpd_routes.py (70): all HTTP API routes via test server
- test_runtime_orchestrator.py (43): DSPy runtime, retry/fallback, cost tracking
- test_shipper.py (45): cloud sync, memory push/pull, session shipping
- test_cli_commands.py (138): all CLI command handlers

Expanded: cursor adapter (56→88%), opencode adapter (56→82%),
codex adapter (73→98%), schemas, repo, adapter common helpers.

1,259 unit tests total, 84% line coverage.
The ExtractAgent handles summarization itself via the write_summary
tool within its ReAct loop — no separate LLM call needed. Remove the
dead summarize role from Config dataclass, provider capabilities,
default.toml, server serialization, and all test fixtures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e traces

- Plain functions with ctx as first arg (no closures, no _impl indirection)
- functools.partial binds ctx, _bind() preserves __name__/__doc__ for DSPy
- New read_trace(offset, limit) for paginated trace reading
- New grep_trace(pattern) for searching traces without full read
- read_file stays for small memory files
- Removed old _bind_tool hack and closure factories

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Transitioned to a flat memory structure with a unified taxonomy (user, feedback, project, reference) for improved clarity and organization.
- Simplified agent roles: ExtractAgent now directly handles memory extraction and summarization, while MaintainAgent focuses on offline refinement.
- Enhanced memory management with new tools for scanning, updating, and archiving memories, ensuring a more efficient maintain process.
- Updated documentation to reflect changes in memory types, directory layout, and agent functionalities.
- Transitioned from plain functions to a class-based structure for MemoryTools, encapsulating methods for memory management.
- Updated documentation to reflect the new architecture and clarify memory types (user, feedback, project, reference).
- Simplified context handling by integrating it within the MemoryTools class.
- Enhanced unit tests to align with the new MemoryTools structure, ensuring comprehensive coverage for all methods.
- Updated the scan method to return a more detailed manifest for memory files, including filename, description, and last modified time.
- Adjusted the handling of subdirectory scans to include modified time in the file listing.
- Revised documentation to clarify the output structure of the scan method.
- Enhanced unit tests to validate the new manifest format and ensure comprehensive coverage of the scan functionality.
- Updated AskAgent, ExtractAgent, and MaintainAgent to utilize the new MemoryTools class for improved memory management.
- Refined agent signatures and documentation to reflect changes in memory handling, including the transition to a unified memory structure.
- Enhanced the format and clarity of docstrings for better understanding of agent functionalities and memory operations.
- Streamlined the process of reading, writing, and managing memory files, ensuring a more efficient workflow across agents.
- Deleted the RuntimeContext class and associated tests to streamline memory management.
- Removed MemoryCandidate and MemoryRecord schemas, simplifying the memory architecture.
- Updated agent implementations to eliminate dependencies on the removed context and schemas.
- Adjusted related tests to reflect the removal of these components, ensuring cleaner and more maintainable code.
- Modified the `pyproject.toml` to adjust Vulture settings, changing the paths and minimum confidence for unused code detection.
- Updated the README and documentation to reflect changes in memory file management, replacing references to `MEMORY.md` with `index.md`.
- Enhanced the `ExtractAgent` and `MaintainAgent` descriptions to clarify their use of `MemoryTools` for reading, writing, and managing memory files.
- Introduced a new `vulture_whitelist.py` to handle false positives from dynamic dispatch and framework methods.
- Refined the configuration settings for maximum iterations in sync and maintain flows, ensuring optimal performance.
- Removed deprecated functions and improved error handling in `MemoryTools` for better robustness and clarity.
…istency checks

- Introduced a new `verify_index` method in `MemoryTools` to ensure that `index.md` accurately reflects the current state of memory files.
- Updated `ExtractSignature` and `MaintainSignature` documentation to include the new verification process for index consistency.
- Adjusted agent toolsets to incorporate `verify_index`, enhancing their capabilities for managing memory files.
- Refactored related tests to cover various scenarios for index verification, ensuring comprehensive validation of memory file integrity.
- Removed the separate extract role from the configuration and streamlined the architecture to focus solely on the lead role.
- Updated ExtractAgent to include a self-test feature for running on fixture traces, improving usability and debugging.
- Refined memory management processes, ensuring consistency in memory file handling and summarization.
- Adjusted related tests to validate the new structure and functionality, enhancing overall test coverage and reliability.
- Updated documentation to reflect changes in roles and agent capabilities, ensuring clarity for future development.
- Updated configuration and codebase to replace references from 'lead' to 'agent', streamlining the role structure for improved clarity and functionality.
- Adjusted ExtractAgent and related components to utilize the new agent role, enhancing their operational capabilities.
- Refined tests and documentation to reflect the transition, ensuring consistency and clarity in the agent's functionality and configuration.
- Enhanced memory management processes to align with the new role structure, improving overall system performance and maintainability.
- Updated the run_tests.sh script to include additional API keys for MINIMAX and OPENCODE, enhancing the test environment setup.
- This change ensures that all relevant API keys are printed and their statuses checked during test execution.
Switch from Pydantic Logfire (OpenTelemetry) to MLflow for tracing.
MLflow's dspy.autolog() captures all DSPy module calls automatically,
removing the need for manual span instrumentation. Controlled by
LERIM_MLFLOW env var (enabled by default in .env).
…ities

Enhanced the tracing documentation to clarify the features captured by MLflow when tracing is enabled. Added details on input prompts, outputs, token counts, and latency for DSPy LM calls, as well as the inclusion of module executions as nested spans within each run.
…cking path

Move dspy.XMLAdapter() into each agent's forward() method so the adapter
is set once per agent, not scattered across callers. MLflow traces now
write to ~/.lerim/mlruns/ so they persist across Docker restarts.
- Added a new RetryAdapter that wraps the main adapter to provide retry functionality on parse failures, allowing the system to recover from formatting errors in LLM responses.
- Updated AskAgent, ExtractAgent, and MaintainAgent to utilize the RetryAdapter, ensuring consistent error handling across agents.
- Enhanced documentation in signatures to specify required XML tag names for output.
- Introduced unit tests for RetryAdapter to validate its behavior and error feedback mechanism.
… error handling

- Introduced field-name normalization in the RetryAdapter to address known mismatches in LLM responses, enhancing the adapter's ability to recover from formatting errors.
- Updated the retry logic to first attempt normalization before retrying with error feedback, improving efficiency and reducing unnecessary LLM calls.
- Added comprehensive unit tests to validate the normalization functionality and ensure robustness against various input scenarios.
- Refactored related components to streamline the integration of normalization within the existing retry mechanism.
- Introduced a new `temperature` parameter in the configuration files to control the randomness of LLM outputs, enhancing the flexibility of model responses.
- Updated the `providers.py` and `settings.py` files to accept and propagate the `temperature` setting through various functions and classes.
- Modified the `default.toml` and test configuration to include the `temperature` setting, ensuring consistency across environments.
- This change allows users to fine-tune the behavior of the language models based on their specific needs.
- Updated `AskSignature`, `ExtractSignature`, and `MaintainSignature` docstrings to include structured XML tags for roles, tasks, contexts, rules, and steps, improving clarity and usability.
- Enhanced the documentation to specify the expected behavior and processes for each agent, ensuring consistency across the system.
- Refactored related unit tests to validate the presence of new structured elements in the signatures, ensuring comprehensive coverage of the updated documentation.
- Replaced `lerim memory search` with `lerim memory list` for better usability in querying memories.
- Updated documentation across multiple files to reflect the new command structure and emphasize reading memory files directly from `.lerim/memory/index.md`.
- Enhanced guides and CLI references to clarify the usage of memory commands, ensuring users can efficiently access and utilize stored memories without requiring a server.
- Removed deprecated references to `memory search` in favor of a more streamlined approach to memory management.
…figuration

- Updated documentation across multiple files to replace references from `[roles.lead]` to `[roles.agent]`, clarifying the role structure for ExtractAgent and MaintainAgent.
- Adjusted configuration examples and descriptions to reflect the new agent role, ensuring consistency in usage and understanding.
- Enhanced CLI and API documentation to guide users on the updated role structure and its implications for memory management and agent functionality.
- Deleted the SKILL.md file, which contained information about the Lerim persistent memory feature for coding agents. This change reflects a shift in documentation strategy or feature deprecation.
- Updated the memory management system to clearly separate global infrastructure from project-specific knowledge. Global directories now include workspace, index, cache, and logs, while project directories contain only memory files.
- Refactored related functions to ensure proper creation and management of these directories, enhancing clarity and usability.
- Adjusted CLI commands to reflect the new structure, ensuring users can reset memory and infrastructure appropriately.
- Added comprehensive tests to validate the new directory structure and memory management functionality.
- Enhanced the ExtractSignature documentation to clarify the body format for feedback and project memories, emphasizing inline bold usage and structure.
- Fixed a bug in MemoryTools to verify that all linked files exist on disk, adding checks for broken links and updating the output accordingly.
- Adjusted the filename handling in MemoryTools to ensure correct paths for summaries, improving index.md link resolution.
- Updated the capture_dspy_cost function to handle cost extraction from both top-level and fallback response attributes, ensuring accurate cost tracking across DSPy versions.
- Modified runtime methods to return additional information (used_lm and hist_start) for better tracking of model usage and history during predictions.
- Updated the error message structure in RetryAdapter to provide actionable feedback, detailing the exact XML tags expected for successful parsing.
- Introduced a new helper function, _build_error_feedback, to generate concise error messages based on parsing errors.
- Adjusted the error handling in retry logic to utilize the new feedback mechanism, improving clarity for users on how to resolve issues.
- Refactored related tests to ensure coverage of the updated error handling and feedback functionality.
…ality

- Updated AskAgent, ExtractAgent, and MaintainAgent to utilize ChatAdapter with native function calling support, enhancing the agents' interaction capabilities.
- Removed references to the deprecated RetryAdapter, streamlining the codebase and improving clarity.
- Enhanced MaintainSignature documentation with new rules for managing memory quality and structure, ensuring better adherence to best practices.
kargarisaac and others added 23 commits April 7, 2026 17:40
- Added a new LerimReact module as a drop-in replacement for dspy.ReAct, enabling native function calling to enhance tool selection and execution.
- Updated ExtractAgent to utilize LerimReact, improving its interaction capabilities with non-OpenAI models and reducing parsing errors.
- Commented out the previous dspy.ReAct implementation for clarity and future reference.
- Updated ExtractSignature documentation to emphasize the importance of the orientation phase and tool selection, ensuring agents do not skip necessary steps.
- Modified LerimReact to enforce mandatory tool calls and treat empty calls as implicit finishes, improving the agent's operational flow and clarity in logging.
- Enhanced configure_tracing function to accept an experiment name parameter, allowing for better organization of MLflow logs and clearer separation of production and evaluation runs.
- Deleted the RetryAdapter implementation and its unit tests, streamlining the codebase as part of the transition to improved error handling and retry logic in the main agent framework.
- This change reflects the ongoing effort to enhance agent functionality and reduce redundancy in the code.
- Introduced a hard cap on lines returned per `read("trace", ...)` call to enforce chunked reading, ensuring the agent's trajectory remains within the model's context window.
- Updated `MemoryTools` to automatically apply this cap and provide pagination headers for trace reads, improving clarity on remaining lines.
- Enhanced `ExtractSignature` documentation to reflect the new chunked reading process and its implications for memory extraction.
- Adjusted tests to validate the new behavior of trace reading, ensuring consistency with the updated logic.
- Added PydanticAI dependencies to `pyproject.toml` for improved agent functionality.
- Introduced a new Jupyter notebook for framework comparison, showcasing three modes of operation: DSPy ReAct (text-based), DSPy ReAct (native function calling), and PydanticAI Agent.
- Refactored the agent architecture to utilize a three-pass extraction pipeline, replacing the previous ExtractAgent with a more robust implementation.
- Updated documentation and tests to reflect the new extraction process and ensure quality across memory files and summaries.
- Updated `build_extract_agent` to utilize the new `Model` type from PydanticAI, replacing the previous `OpenAIChatModel` reference.
- Moved model construction logic to `lerim.config.providers`, introducing `build_pydantic_model` for improved clarity and maintainability.
- Refactored `run_extraction` to accommodate the new model structure, ensuring compatibility with the updated agent architecture.
- Enhanced documentation to reflect changes in model handling and extraction processes.
- Refactored the extraction pipeline to improve clarity and efficiency, ensuring that the orientation and deduplication steps utilize existing memory references without unnecessary calls to scan().
- Updated the PydanticAI agent to enforce stricter usage limits, with configurable parameters sourced from the configuration file, enhancing control over resource utilization.
- Introduced byte and line limits for trace reading to prevent context window overflow, ensuring robust handling of large trace files.
- Enhanced documentation and tests to reflect these changes, ensuring consistency and reliability across the extraction process.
…ry management

- Replaced the three-pass extraction pipeline with a single-pass PydanticAI agent, streamlining the extraction process to read session traces in one loop while managing context dynamically.
- Updated the agent to utilize `note()` and `prune()` tools for efficient memory management, allowing for structured findings and context pruning during execution.
- Removed the deprecated `ExtractAgent` and associated files, ensuring a cleaner codebase and improved maintainability.
- Enhanced the request budget auto-scaling mechanism based on trace size, eliminating static usage limits and improving resource efficiency.
- Updated documentation and tests to reflect the new single-pass architecture and its implications for memory extraction quality.
- Increased the tool-call argument validation retries from 5 to 10 to accommodate MiniMax-M2.5's stochastic behavior, allowing for better recovery from early-run tool-call failures.
- Updated the default configuration for temperature, top_p, and top_k to align with MiniMax-M2's official sampling recommendations, enhancing the agent's performance in tool-calling tasks.
- Adjusted the model settings to incorporate the new configuration parameters, ensuring consistency across the extraction process.
- Introduced several new packages including `ag-ui-protocol`, `aiofile`, `anthropic`, `argcomplete`, `authlib`, `backports-tarfile`, `beartype`, and others to enhance functionality and support.
- Updated the extraction agent configuration to utilize the MiniMax-M2.7 model, ensuring improved performance and compatibility with the latest API endpoints.
- Disabled fallback models to enforce strict model usage, enhancing predictability in agent behavior.
- Enhanced the Jupyter notebook for framework comparison, updating the content to reflect the new single-pass extraction approach and improved memory management.
- Changed model references in the Jupyter notebook from `minimax-m2.7` to `ollama-gpt-oss-20b`, and updated the model configuration for `nemotron`.
- Adjusted the execution counts in the notebook to reflect the latest runs.
- Enhanced the base URL handling in the provider configuration to ensure compatibility with Ollama's OpenAI-compat endpoint, appending `/v1` when necessary.
- Updated memory extraction outputs to reflect the new implementation of per-project memory isolation.
…example | neg_prec=0.111 forbidden=0.676

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…parison notebook

- Updated model references from `ollama-gpt-oss-20b` to `glm-5.1` and adjusted the trace file to `claude_028`.
- Enhanced memory extraction outputs to reflect new session details, including additional memories and summaries.
- Adjusted execution counts for code cells to align with the latest runs.
- Revised the documentation for the extraction agent to clarify the distinction between durable and implementation findings in the NOTES section.
- Enhanced the structure of findings to include a 'level' field, allowing for better classification of results.
- Updated test cases to replace deprecated MemoryTools with new context-building and verification functions, ensuring alignment with recent changes in the extraction process.
- Removed the deprecated MemoryTools class to simplify the codebase, encouraging direct use of module-level functions for memory operations.
- Updated documentation to clarify the usage of theme labels in findings, changing examples to reflect current terminology.
- Added a warning for potential command/runbook notes in memory body submissions to ensure clarity in memory capturing.
- Revised changelog entries to reflect updates in the extraction pipeline and memory management.
- Clarified documentation regarding the removal of deprecated components and the introduction of new runtime features.
- Enhanced descriptions for memory operations and project management to improve user understanding and experience.
- Introduced new functions to list and normalize service runs, improving the tracking of recent activities.
- Added detailed metrics for service runs, including duration and project-specific statistics, to enhance reporting capabilities.
- Refactored the status output rendering to incorporate new metrics and improve clarity in the terminal interface.
- Updated the CLI commands to utilize the new status rendering functions, ensuring a more informative user experience.
@kargarisaac kargarisaac merged commit 26c15f9 into main Apr 13, 2026
4 checks passed
@kargarisaac kargarisaac deleted the feat/dspy-react-migration branch April 13, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant