agent-recall 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agent_recall-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +19 -0
- agent_recall-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +14 -0
- agent_recall-0.1.0/.github/workflows/publish.yml +20 -0
- agent_recall-0.1.0/.github/workflows/tests.yml +21 -0
- agent_recall-0.1.0/.gitignore +18 -0
- agent_recall-0.1.0/CHANGELOG.md +68 -0
- agent_recall-0.1.0/CONTRIBUTING.md +41 -0
- agent_recall-0.1.0/LICENSE +21 -0
- agent_recall-0.1.0/PKG-INFO +496 -0
- agent_recall-0.1.0/README.md +458 -0
- agent_recall-0.1.0/agent_recall/__init__.py +28 -0
- agent_recall-0.1.0/agent_recall/cli.py +246 -0
- agent_recall-0.1.0/agent_recall/config.py +237 -0
- agent_recall-0.1.0/agent_recall/context.py +221 -0
- agent_recall-0.1.0/agent_recall/context_gen.py +892 -0
- agent_recall-0.1.0/agent_recall/dedup.py +137 -0
- agent_recall-0.1.0/agent_recall/hierarchy.py +50 -0
- agent_recall-0.1.0/agent_recall/hooks.py +219 -0
- agent_recall-0.1.0/agent_recall/mcp_bridge.py +271 -0
- agent_recall-0.1.0/agent_recall/mcp_server.py +139 -0
- agent_recall-0.1.0/agent_recall/py.typed +0 -0
- agent_recall-0.1.0/agent_recall/store.py +598 -0
- agent_recall-0.1.0/agent_recall/vault_gen.py +203 -0
- agent_recall-0.1.0/examples/llm_anthropic.py +28 -0
- agent_recall-0.1.0/examples/llm_ollama.py +18 -0
- agent_recall-0.1.0/examples/llm_openai.py +22 -0
- agent_recall-0.1.0/examples/memory.yaml +49 -0
- agent_recall-0.1.0/examples/quickstart.py +29 -0
- agent_recall-0.1.0/pyproject.toml +55 -0
- agent_recall-0.1.0/templates/agency.md +25 -0
- agent_recall-0.1.0/templates/client.md +27 -0
- agent_recall-0.1.0/templates/orchestrator.md +34 -0
- agent_recall-0.1.0/templates/personal.md +22 -0
- agent_recall-0.1.0/templates/system.md +22 -0
- agent_recall-0.1.0/templates/topic.md +26 -0
- agent_recall-0.1.0/tests/conftest.py +9 -0
- agent_recall-0.1.0/tests/test_cli.py +130 -0
- agent_recall-0.1.0/tests/test_config.py +355 -0
- agent_recall-0.1.0/tests/test_context.py +172 -0
- agent_recall-0.1.0/tests/test_context_gen.py +885 -0
- agent_recall-0.1.0/tests/test_dedup.py +209 -0
- agent_recall-0.1.0/tests/test_hierarchy.py +61 -0
- agent_recall-0.1.0/tests/test_hooks.py +268 -0
- agent_recall-0.1.0/tests/test_mcp_bridge.py +315 -0
- agent_recall-0.1.0/tests/test_store.py +294 -0
- agent_recall-0.1.0/tests/test_vault_gen.py +229 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Report a bug in agent-recall
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Describe the bug**
|
|
8
|
+
A clear description of what went wrong.
|
|
9
|
+
|
|
10
|
+
**To reproduce**
|
|
11
|
+
Steps or code to reproduce the behavior.
|
|
12
|
+
|
|
13
|
+
**Expected behavior**
|
|
14
|
+
What you expected to happen.
|
|
15
|
+
|
|
16
|
+
**Environment**
|
|
17
|
+
- Python version:
|
|
18
|
+
- agent-recall version:
|
|
19
|
+
- OS:
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest a new feature
|
|
4
|
+
labels: enhancement
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Problem**
|
|
8
|
+
What problem does this solve?
|
|
9
|
+
|
|
10
|
+
**Proposed solution**
|
|
11
|
+
How should it work?
|
|
12
|
+
|
|
13
|
+
**Alternatives considered**
|
|
14
|
+
Any other approaches you've thought about.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
- run: pip install build
|
|
19
|
+
- run: python -m build
|
|
20
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
- run: pip install -e ".[dev]"
|
|
21
|
+
- run: pytest --tb=short -q
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Per-agent model override via `agents.<slug>.model` in config
|
|
11
|
+
- Per-agent template override via `agents.<slug>.template` (type name or inline text)
|
|
12
|
+
- Agent enabled/disabled toggle via `agents.<slug>.enabled`
|
|
13
|
+
- Adaptive cache invalidation with `.stale` markers
|
|
14
|
+
- Cross-agent triggers — writes to child scope invalidate parent and orchestrator
|
|
15
|
+
- `context_files` — load external files into briefing context
|
|
16
|
+
- `get_agent_status()` — query cache metadata (freshness, size, timestamps)
|
|
17
|
+
- `get_all_statuses()` — batch status for all agents
|
|
18
|
+
- `get_generation_logs()` — read generation history per agent
|
|
19
|
+
- `LLMResult` dataclass for structured LLM responses with token tracking
|
|
20
|
+
- Generation logging with rotation (last 10 entries per agent)
|
|
21
|
+
- ISO 8601 timestamps in status responses (`generated_at_iso`)
|
|
22
|
+
- Comprehensive docstrings on `MemoryStore`, `MCPBridge`, `assemble_context`
|
|
23
|
+
- `py.typed` marker for PEP 561 type checking support
|
|
24
|
+
- Configurable briefing backend: `cli` (default, free) or `api` (Anthropic SDK)
|
|
25
|
+
- `MemoryStore.rollback()` public method for error recovery
|
|
26
|
+
- MCP server instructions — agents proactively save facts without prompting
|
|
27
|
+
- Cold-start message when memory is empty (hooks)
|
|
28
|
+
- Model aliases: `opus`, `sonnet`, `haiku` resolve to full model IDs
|
|
29
|
+
- CHANGELOG.md
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
- `build_prompt()` crash on `{` in slug or raw context (both now escaped before `.format()`)
|
|
33
|
+
- Path traversal in vault `_safe_filename()` — uses `Path.name` to strip directory components
|
|
34
|
+
- Git auto-commit race condition — commit now blocks before push starts
|
|
35
|
+
- MCP bridge input validation — missing/malformed fields return errors instead of crashing
|
|
36
|
+
- `merge_entities()` uses public `store.rollback()` instead of private `_conn.rollback()`
|
|
37
|
+
- Unused `MemoryConfig` import removed from MCP server
|
|
38
|
+
- CLI model parameter validated against safe character set
|
|
39
|
+
- `_load_context_files()` skips non-regular files (directories, devices)
|
|
40
|
+
- Fragile dict key access in log assembly (uses `.get()` with defaults)
|
|
41
|
+
- `get_agent_briefing()` now merges `min_cache_age` and `adaptive` per-agent
|
|
42
|
+
- `get_agent_status()` caches `stat()` call (was calling twice)
|
|
43
|
+
- `load_config()` raises `ValueError` on malformed YAML (was unhandled `ParserError`)
|
|
44
|
+
- `get_agent_status()` raises `ValueError` on empty slug
|
|
45
|
+
- Hardcoded `/tmp/` paths replaced with `tempfile.gettempdir()` (symlink attack prevention)
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
- `mcp` is now an optional dependency: `pip install 'agent-recall[mcp]'`
|
|
49
|
+
- `api` optional dependency added: `pip install 'agent-recall[api]'`
|
|
50
|
+
- MCP server singleton documents single-threaded assumption
|
|
51
|
+
|
|
52
|
+
### Removed
|
|
53
|
+
- Dead modules: `episodes.py` (episodic memory) and `schema.py` (unused schema definitions)
|
|
54
|
+
|
|
55
|
+
## [0.1.0] - 2026-02-15
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
- Initial release
|
|
59
|
+
- SQLite memory store with bitemporal slots, observations, relations
|
|
60
|
+
- Scope hierarchy with inheritance and enforcement
|
|
61
|
+
- MCP server (FastMCP) for Claude Code integration
|
|
62
|
+
- AI briefing generation with configurable LLM and prompt templates
|
|
63
|
+
- 6 built-in prompt templates: client, agency, personal, topic, system, orchestrator
|
|
64
|
+
- SessionStart hook with cache-first strategy
|
|
65
|
+
- PostToolUse hook for vault regeneration
|
|
66
|
+
- YAML configuration system
|
|
67
|
+
- CLI: `agent-recall init / set / get / search / generate / status`
|
|
68
|
+
- 249 tests
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Contributing to agent-recall
|
|
2
|
+
|
|
3
|
+
## Quick start
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/mnardit/agent-recall.git
|
|
7
|
+
cd agent-recall
|
|
8
|
+
pip install -e ".[dev]"
|
|
9
|
+
pytest
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## What we're looking for
|
|
13
|
+
|
|
14
|
+
- Bug fixes (always welcome)
|
|
15
|
+
- New prompt templates for AI briefings
|
|
16
|
+
- Documentation improvements
|
|
17
|
+
- Integration examples (other MCP clients, other LLMs)
|
|
18
|
+
- CLI improvements
|
|
19
|
+
|
|
20
|
+
## Development
|
|
21
|
+
|
|
22
|
+
- Python 3.10+
|
|
23
|
+
- All tests must pass: `pytest`
|
|
24
|
+
- Type hints on public API
|
|
25
|
+
- Docstrings for public functions
|
|
26
|
+
|
|
27
|
+
## Running tests
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# All tests
|
|
31
|
+
pytest
|
|
32
|
+
|
|
33
|
+
# Without editable install
|
|
34
|
+
PYTHONPATH=. pytest
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Not accepting (for now)
|
|
38
|
+
|
|
39
|
+
- Breaking API changes
|
|
40
|
+
- Cloud/hosted features
|
|
41
|
+
- Dependencies on specific LLM providers
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Max Nardit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|