Skip to content

Releases: AmritaBot/AmritaCore

V0.8.6

03 May 08:23
97cbc4b

Choose a tag to compare

Release v0.8.6

This patch release refactors the internal matcher execution logic for improved clarity and performance. Runtime dependency resolution has been moved from _simple_run to the public trigger_event method, making the internal API stricter and easier to reason about.

🚀 Improvements

  • Dependency injection refinement: Runtime Depends factories are now resolved exclusively in trigger_event. _simple_run no longer handles them and will raise a clear ValueError if any are passed.
  • Simplified method signature: _simple_run removed the event and config parameters, reducing coupling and unnecessary argument passing.
  • Better type annotation: extra_args now uses Iterable[Any] for more flexibility.

🧪 Testing

  • Updated unit tests to align with the new _simple_run signature.
  • Removed obsolete test for runtime dependency injection inside _simple_run (now covered by trigger_event).

🧰 Maintenance

  • Version bumped to 0.8.6.
  • Lockfile regenerated.

No breaking changes for public APIs.


Full Changelog: 0.8.5...0.8.6

V0.8.5

02 May 03:37
dead5e3

Choose a tag to compare

Release Abstract – amrita_core v0.8.5

This release delivers important concurrency and lifecycle improvements, critical bug fixes, and expanded test coverage. The main focus is on making the event handling and chat manager more robust under concurrent use, adding connection management for MCP tools, and fixing a streaming output bug in model adapters.

🔧 Bug Fixes

  • Adapter Streaming: Fixed missing text yield in OpenAIAdapter and AnthropicAdapter streaming responses. The raw text content (text_resp.getvalue()) is now explicitly yielded before the final UniResponse, ensuring downstream consumers receive text before the response wrapper (fixes #…).
  • Agent Tool Loop: Corrected the exit logic in _execute_tool_loop so that a single failed tool call no longer prematurely aborts the entire loop; the agent now correctly processes remaining tools and returns an aggregated result.
  • ChatManager Thread Safety: Replaced the global LOCK with a per-instance _lock field, preventing contention across separate ChatManager instances. ChatObject now accepts an optional chat_man parameter to bind to a specific manager instead of always relying on the module-level global.

✨ New Features

  • MCP Client Connection TTL: MCP clients now support an automatic connection close after an idle timeout (connection_ttl). The new close() method schedules a graceful shutdown, while close_no_wait() allows immediate closure. This prevents resource leaks in long-lived sessions.
  • Matcher Deadlines: Matchers can now be created with a dead_at timestamp; expired matchers are automatically skipped and cleaned up during event processing, enabling time‑limited event handlers.
  • WeakLRU Cache: Introduced WeakValueLRUCache – a thread‑safe, weak‑reference‑based LRU cache with optional “loose mode” that allows temporary oversizing. Used internally for matcher lock pools, preventing memory leaks from accumulating locks.

🧱 Architecture & Refactoring

  • Matcher System:
    • FunctionData converted from Pydantic BaseModel to a standard dataclass for lower overhead.
    • Matcher is now hashable (using UUID) and supports equality checks.
    • Event processing uses per‑event‑type locks (MatcherFactory._repo_lock) backed by the new weak‑reference cache, replacing global locking and improving parallelism.
    • Dead matchers are removed from handler lists during execution, avoiding memory growth from stale entries.
  • Chat Manager Binding: ChatObject can now be explicitly associated with a specific ChatManager, enabling easier testing and multi‑context deployments.

🧪 Testing & CI

  • CI Matrix: Expanded CI to test against Python 3.10, 3.11, 3.12, and 3.13 with fail‑fast: false. A new all-matrix-jobs-passed gate ensures all combinations succeed before merge.
  • Test Coverage:
    • Added comprehensive tests for AnthropicAdapter (streaming, non‑streaming, tool conversion).
    • Brand‑new test suite for WeakValueLRUCache covering all operations, edge cases, and garbage‑collection behaviour.
    • Updated existing adapter tests to align with the updated streaming logic.

📦 Dependencies & Packaging

  • Version bumped to 0.8.5.
  • uv.lock refreshed to reflect the new version and dependency changes.

Upgrade Notes: This release maintains backward compatibility for most public APIs. The global LOCK removal in ChatManager and the new chat_man parameter are entirely opt‑in. Users who rely on MCP clients will benefit from the new TTL feature, but existing code continues to work unchanged.


Full Changelog: 0.8.4.1...0.8.5

V0.8.4.1

26 Apr 06:37
9d0b83c

Choose a tag to compare

What's Changed

Full Changelog: 0.8.4...0.8.4.1

V0.8.4

25 Apr 12:19
e9421a0

Choose a tag to compare

Update Summary

  • Version bump: amrita_core updated from 0.8.3.1 to 0.8.4 (pyproject.toml).
  • Agent module (builtins/agent.py):
    • Reordered and clarified abstract methods (_append_reasoning, _append_tool_result_to_context) with improved docstrings.
    • Expanded __all__ to export additional strategy classes: AmritaAgentStrategy, BaseReActAgentStrategy, HybridReActAgentStrategy, NoActionAgentStrategy, ReActAgentStrategy.
  • Hook system:
    • Removed BlockException (no longer used) from exception.py.
    • Refactored MatcherFactory:
      • _simple_run now takes config as an optional last argument (default None), with clearer keyword‑only parameters.
      • trigger_event overloads and implementation updated: config is no longer a mandatory positional argument, can be omitted or passed as None.
      • Removed the check that required a config; improved argument passing to _simple_run.
  • Chat library (libchat.py):
    • _call_with_reflection no longer forwards arbitrary *args, **kwargs to the adapter call (only preset, call_func, config).
    • call_completion now accepts **kwargs and forwards them to the adapter.
    • Added call_embedding function to support embedding requests, returning a sequence of EmbeddingChunk.
  • MCP tools: Removed unused NOT_GIVEN sentinel class.
  • Tests:
    • Removed outdated test for _call_with_reflection (due to signature change).
    • Updated test_matcher.py calls to _simple_run to match the new parameter order.
    • Removed NOT_GIVEN import and its test in test_mcp.py.

Full Changelog: 0.8.3.1...0.8.4

V0.8.3.1

25 Apr 04:30
3161e90

Choose a tag to compare

What's Changed

Full Changelog: 0.8.3...0.8.3.1

V0.8.3

25 Apr 04:00
fd6890a

Choose a tag to compare

Release v0.8.3

Highlights

  • Anthropic Tool Calling – The Anthropic adapter is now fully supported and includes complete tool/function calling capabilities.
  • Richer @simple_tool – The decorator now infers JSON Schema from Pydantic models, List[T], and Optional[T]; unsupported types are rejected with clear errors.
  • Developer Experience – New and improved helper scripts with check/fix flags, plus a docs linter.

New Features

  • Anthropic Adapter (src/amrita_core/builtins/adapter.py)

    • Added call_tools() method with full Anthropic tool-use support.
    • Automatic conversion of internal messages, tool definitions, and tool choice parameters.
    • Removed experimental status; now supports streaming and tool calling.
  • Enhanced @simple_tool Decorator

    • Automatic schema generation for Pydantic BaseModel parameters (including nested models).
    • Support for List[T] (single-level) and Optional[T].
    • Validation that rejects unsupported types: Dict, nested containers, multi-type Union, and Any.
    • Return values of list/dict are now JSON-serialized for consistent output.

Improvements

  • Scripts & Workflow

    • format.sh now supports --check for dry-run formatting.
    • lint.sh supports --fix for auto-fixing issues.
    • New docs-lint.sh script using Prettier for documentation formatting.
    • clean.sh now also removes __pycache__ directories and root build/ folder.
    • CONTRIBUTING.md updated with detailed script descriptions and recommended pre‑PR checks.
  • Documentation

    • Both English and Chinese docs updated to reflect the new Anthropic capabilities and tool system improvements.
    • Clarified tool registration behaviour: decorators register to the global container; use ToolsManager for per-session tools.
    • Added note on supported types and limitations of @simple_tool.
    • Community channel now includes QQ group.
    • Fixed formatting issues (markdown syntax, italics for abstract methods, etc.).
  • Code Quality

    • Fixed indentation in chatmanager.py.
    • FunctionParametersSchema.properties now defaults to an empty dict instead of None, simplifying usage.
    • Updated existing tests and added comprehensive test suite for the new @simple_tool types.

Changes from Unstable

  • README.md now lists Built-in Anthropic support as a stable feature.
  • Removed “Anthropic Supporting” from the Unstable Features section (now fully implemented).

Summary

v0.8.3 brings first-class Anthropic tool calling, a significantly smarter @simple_tool decorator, and a smoother developer workflow. Documentation and community channels have been expanded, and the codebase continues to mature with improved consistency and testing.

Full Changelog: 0.8.2.1...0.8.3

V0.8.2.1

22 Apr 15:30
50167b1

Choose a tag to compare

What's Changed

Full Changelog: 0.8.2...0.8.2.1

V0.8.2

19 Apr 14:38
6a30baa

Choose a tag to compare

🚀 AmritaCore v0.8.2

This release focuses on architectural refactoring, enhanced streaming control, improved validation for tool schemas, and significant updates to the built-in reasoning system.

Major Features & Refactoring

  • New Base Class: SuspendObjectStream

    • Introduced a new generic base class SuspendObjectStream[ObjectTypeT] in src/amrita_core/streaming.py.
    • Encapsulates all suspend/resume logic and streaming queue management (AnyIO memory object streams).
    • Impact: ChatObject now inherits from SuspendObjectStream, centralizing the streaming and flow-control mechanisms previously embedded directly in the chat manager.
  • Enhanced Tool Schema Validation (FunctionPropertySchema)

    • Added comprehensive JSON Schema constraint support:
      • Numeric: minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf.
      • String: minLength, maxLength, pattern, format.
      • Array: minItems, maxItems, uniqueItems.
      • Object: additionalProperties, const, default.
    • Added strict type-specific validation to ensure schemas are well-formed.
  • Refined Reasoning Loop (think_and_reason)

    • Schema Update: The think_and_reason tool parameters changed from content to last_step and summary.
    • Behavior Change: The agent now makes a secondary completion call to generate a full reasoning paragraph based on the summary, rather than using the tool response directly as the reasoning content.
    • Templates: Updated REASONING_TEMPLATE and added REASONING_CONTENT_TEMPLATE to support the new two-step reasoning generation process.

API & Documentation Updates

  • get_last_response Enhancement:

    • Added yield_to and yield_to_wrapper parameters to allow streaming intermediate chunks to a target stream while capturing the final UniResponse.
  • Python Version Support:

    • Documentation updated to officially support Python 3.10 to 3.13 (previously stated up to 3.14).
  • Comprehensive Documentation Added:

    • Added new documentation files for SuspendObjectStream in both English and Chinese guides.
    • Updated ChatObject documentation to reflect inheritance from SuspendObjectStream and removal of overflow_queue_size parameter.

Internal Improvements & Fixes

  • Code Organization: Moved streaming logic (_put_to_queue, get_response_generator, etc.) out of chatmanager.py and into the new SuspendObjectStream class.
  • Usage Tracking: Added extra_usage property to ChatObject and gather_usage utility to aggregate token usage from internal operations (e.g., memory limiting, reasoning calls).
  • Test Restructuring: Moved suspend-related tests from test_chatobject.py to a dedicated test_object_stream.py.
  • Configuration: Bumped version in pyproject.toml to 0.8.2.

What's Changed

Full Changelog: 0.8.1...0.8.2

V0.8.1

12 Apr 08:47
fc66afb

Choose a tag to compare

Release Summary: amrita_core v0.8.1

We are pleased to announce the release of amrita_core 0.8.1 – a maintenance update focusing on thread safety improvements, a critical bug fix in agent reasoning, and better CI reliability.

Highlights

  • Thread‑safe asynchronous locks – Replaced asyncio.Lock with aiologic.Lock throughout the codebase (chatmanager, threadsafe, mcp). This provides more robust, context‑aware locking for concurrent operations.
  • Reasoning tool fix – The REASONING_TOOL is now added only when agent_thought_mode starts with "reasoning" during tool‑calling execution, instead of unconditionally at initialization. This eliminates unnecessary tool exposure and aligns with expected behaviour.
  • CI pipeline hardening – Added a 30‑minute timeout to GitHub Actions workflows to prevent hung jobs.
  • Singleton initialisationAdapterManager now uses an __inited flag to avoid re‑initialising the singleton instance.
  • Documentation & testing – Improved docstring for ContextThreadsafe and added a comprehensive test for lock contention.

Dependency update

  • Added aiologic>=0.16.0 as a new dependency (transitively brings wrapt and sniffio).

Version

0.8.00.8.1

Upgrade via uv or pip as usual. For full details, see the changelog and the diff above.

What's Changed

  • Refine async thread safety with aiologic locks and reasoning tools by @JohnRichard4096 in #50

Full Changelog: 0.8.0...0.8.1

V0.8.0

11 Apr 13:33
88f4c2c

Choose a tag to compare

🚀 AmritaCore v0.8.0

We're excited to announce AmritaCore v0.8.0! This release marks a significant step forward as a lightweight, infrastructure‑level agent framework. We've focused on improving core stability, introducing new capabilities, and refining the developer experience with better tooling and safety mechanisms.

✨ Highlights

  • 🧩 Embedding Support: Added EmbeddingChunk and "embed" adapter type for standardized embedding generation.
  • ⏸️ Standardized Breakpoints: Introduced SuspendEnum with built‑in tags (MEMORY, SINGLE_TOOL, PRECOMPLE, COMPLE) for precise control over execution flow.
  • 🌊 Streaming Overhaul: Replaced the dual‑queue overflow system with an AnyIO memory object stream providing automatic backpressure, simpler logic, and better memory efficiency.
  • 🔌 MCP Client Binding: Added bound_to() method to MCPClient for atomic, safe registration with the client manager.
  • 🧵 Thread‑Safety: Introduced ContextThreadsafe base class to ensure thread‑safe operations across shared managers.

💥 Breaking Changes

  • ChatObject: The overflow_queue_size parameter has been removed. Backpressure is now handled automatically via the new stream mechanism.
  • ChatObject: The signature of wait_to_suspend has changed from (timeout, tag) to (*tags, timeout). Please update your external controller code accordingly.
  • AgentStrategy: The default on_exception method no longer raises an exception. It now passes silently. Custom strategies that relied on NoExceptionHandler must override this method explicitly.
  • Logging: Internal logger initialization has been refactored. If you were relying on specific loguru internals, verify your logging setup.

🎉 New Features

  • Adapter Type Validation: call_completion now checks that the adapter type matches the intended use ("text-gen" vs "embed"), preventing silent misuse.
  • Template Security: User input in the default Jinja2 template now uses the |escape filter automatically to prevent prompt injection.
  • Monitoring Decorator: Added @monitoring to track the last call time of critical methods in ChatObject.
  • New API Documentation: Added dedicated pages for EmbeddingChunk and SuspendEnum in both English and Chinese docs.

🔧 Improvements

  • Backpressure: The new AnyIO stream eliminates the need for complex overflow logic and improves reliability under load.
  • Exception Handling: The silent default in AgentStrategy.on_exception prevents unexpected crashes in production; custom logic can be added as needed.
  • Python 3.14+ Readiness: Updated requires-python to <3.15 to allow testing with the upcoming no‑GIL version of Python.
  • Tooling: Added a full suite of quality scripts (format, lint, typecheck, release) to streamline development and contributions.

🐛 Fixes

  • Fixed potential race conditions in MCP client registration via bound_to().
  • Corrected docstring inconsistencies and outdated queue size references.

📚 Documentation

  • Extensive updates to reflect new features, security enhancements (template escaping, adapter validation), and revised API signatures.
  • VitePress configuration updated with new pages and adjusted theme colors.

🔗 Full Changelog & Upgrade Guide

  • Upgrade Steps:

    1. Update any code that sets overflow_queue_size in ChatObject (remove the argument).
    2. Update wait_to_suspend calls to use wait_to_suspend(*tags, timeout).
    3. If you relied on NoExceptionHandler being raised, override on_exception in your custom strategy.
    4. Run pip install -U amrita_core to get the latest dependencies.
  • Release 0.8.0 with embedding adapters and streaming refactor by @JohnRichard4096 in #48

  • Full Changelog: 0.7.3...0.8.0


This release is the result of contributions from the AmritaCore community. Thank you for your continued support!