tessera-agent-memory 0.0.1__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.
- tessera_agent_memory-0.0.1/CONTRIBUTING.md +57 -0
- tessera_agent_memory-0.0.1/LICENSE +21 -0
- tessera_agent_memory-0.0.1/MANIFEST.in +11 -0
- tessera_agent_memory-0.0.1/PKG-INFO +548 -0
- tessera_agent_memory-0.0.1/README.md +517 -0
- tessera_agent_memory-0.0.1/pyproject.toml +48 -0
- tessera_agent_memory-0.0.1/setup.cfg +4 -0
- tessera_agent_memory-0.0.1/tessera/__init__.py +133 -0
- tessera_agent_memory-0.0.1/tessera/canonical.py +547 -0
- tessera_agent_memory-0.0.1/tessera/cli.py +1222 -0
- tessera_agent_memory-0.0.1/tessera/config.py +918 -0
- tessera_agent_memory-0.0.1/tessera/conflict.py +30 -0
- tessera_agent_memory-0.0.1/tessera/decomposer.py +315 -0
- tessera_agent_memory-0.0.1/tessera/diagnostics.py +286 -0
- tessera_agent_memory-0.0.1/tessera/display.py +499 -0
- tessera_agent_memory-0.0.1/tessera/engine.py +120 -0
- tessera_agent_memory-0.0.1/tessera/engine_core.py +1393 -0
- tessera_agent_memory-0.0.1/tessera/episode_boundary.py +136 -0
- tessera_agent_memory-0.0.1/tessera/evidence.py +334 -0
- tessera_agent_memory-0.0.1/tessera/hooks.py +254 -0
- tessera_agent_memory-0.0.1/tessera/init_flow.py +643 -0
- tessera_agent_memory-0.0.1/tessera/legacy_compat.py +124 -0
- tessera_agent_memory-0.0.1/tessera/llm_bridge.py +83 -0
- tessera_agent_memory-0.0.1/tessera/mcp_runtime.py +220 -0
- tessera_agent_memory-0.0.1/tessera/mcp_server.py +416 -0
- tessera_agent_memory-0.0.1/tessera/mcp_transport.py +154 -0
- tessera_agent_memory-0.0.1/tessera/models.py +185 -0
- tessera_agent_memory-0.0.1/tessera/orchestrator.py +238 -0
- tessera_agent_memory-0.0.1/tessera/security.py +337 -0
- tessera_agent_memory-0.0.1/tessera/skills.py +70 -0
- tessera_agent_memory-0.0.1/tessera/skills_library/sk_docker_environment.md +38 -0
- tessera_agent_memory-0.0.1/tessera/skills_library/sk_runtime_verification.md +39 -0
- tessera_agent_memory-0.0.1/tessera/skills_library/sk_schema_compliance.md +40 -0
- tessera_agent_memory-0.0.1/tessera/skills_library/sk_service_lifecycle.md +39 -0
- tessera_agent_memory-0.0.1/tessera/skills_library/sk_shell_execution.md +38 -0
- tessera_agent_memory-0.0.1/tessera/source_discovery.py +735 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/PKG-INFO +548 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/SOURCES.txt +40 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/dependency_links.txt +1 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/entry_points.txt +3 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/requires.txt +17 -0
- tessera_agent_memory-0.0.1/tessera_agent_memory.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Contributing to TESSERA
|
|
2
|
+
|
|
3
|
+
Start with an [issue](https://github.com/LuigiFerronatto/TESSERA/issues/new/choose).
|
|
4
|
+
For a bug, include the version, a minimal reproduction, expected behavior and
|
|
5
|
+
actual output. Remove credentials and private source content from examples.
|
|
6
|
+
|
|
7
|
+
For a behavior change, use the [Test Card template](.github/ISSUE_TEMPLATE/test-card.md)
|
|
8
|
+
to define one hypothesis, its baseline and its success criteria. Check the
|
|
9
|
+
[roadmap](docs/ROADMAP.md) for existing ownership, dependencies and selected work;
|
|
10
|
+
an open or READY card is not automatically selected for implementation.
|
|
11
|
+
|
|
12
|
+
## Develop and test
|
|
13
|
+
|
|
14
|
+
Use Python 3.9 or newer in a virtual environment. Keep the environment outside
|
|
15
|
+
the checkout so repository inventory checks do not scan installed dependencies:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
python -m venv ../tessera-dev-env
|
|
19
|
+
source ../tessera-dev-env/bin/activate
|
|
20
|
+
python -m pip install -e ".[dev]"
|
|
21
|
+
python -m pytest -ra
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
On Windows, activate `..\tessera-dev-env\Scripts\Activate.ps1` in PowerShell.
|
|
25
|
+
Changes to MCP also need the optional dependencies on Python 3.10 or newer:
|
|
26
|
+
`python -m pip install -e ".[dev,mcp]"`. CI runs the base suite and built-artifact
|
|
27
|
+
checks on Python 3.9 and 3.12, and the installed MCP protocol checks on 3.12.
|
|
28
|
+
|
|
29
|
+
Start with tests that reproduce the affected behavior. Keep fixtures small,
|
|
30
|
+
deterministic and project-agnostic. Basic retrieval does not require provider
|
|
31
|
+
credentials. Follow the [architecture](docs/ARCHITECTURE.md) and
|
|
32
|
+
[output contract](docs/OUTPUT_CONTRACT.md) when changing public behavior.
|
|
33
|
+
|
|
34
|
+
## Submit a pull request
|
|
35
|
+
|
|
36
|
+
Use the [PR template](.github/pull_request_template.md). Link the owning issue,
|
|
37
|
+
describe the user-visible change and provide reproducible evidence, limitations
|
|
38
|
+
and the proposed decision. Keep unrelated changes in separate issues.
|
|
39
|
+
|
|
40
|
+
Declare `Benchmark applicability: REQUIRED`, `SMOKE_ONLY` or `NOT_APPLICABLE`
|
|
41
|
+
with a rationale under the [Benchmark Ledger contract](docs/BENCHMARK_CI.md).
|
|
42
|
+
Run the relevant evaluation; a green unit suite alone does not establish a
|
|
43
|
+
retrieval-quality improvement. Record a changelog entry or a reason it is not
|
|
44
|
+
needed under the [change policy](docs/CHANGE_POLICY.md), and update affected docs
|
|
45
|
+
and the [plain-language stage record](docs/test-cards/README.md).
|
|
46
|
+
|
|
47
|
+
The [CI workflow](.github/workflows/tessera-ci.yml), independent Maintainer Audit
|
|
48
|
+
and Merge Governor check the exact candidate. Human review remains required.
|
|
49
|
+
After merge, record the canonical commit and complete the
|
|
50
|
+
[lifecycle reconciliation](docs/AGENTIC_GOVERNANCE.md) before starting dependent
|
|
51
|
+
work from fresh `main`.
|
|
52
|
+
|
|
53
|
+
## License and third-party material
|
|
54
|
+
|
|
55
|
+
The project license is [MIT](LICENSE). Submit only material you have permission
|
|
56
|
+
to contribute, and preserve copyright and license notices for third-party code
|
|
57
|
+
and assets. Keep those notices with their files.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luigi Ferronatto
|
|
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
|
|
13
|
+
all 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
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tessera-agent-memory
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: TESSERA — Temporal Evolving State Synthesis with Explicit Relations and Atomic Memories: a text-first, auditable memory and evidence layer for AI agents.
|
|
5
|
+
Author: TESSERA Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/LuigiFerronatto/TESSERA
|
|
8
|
+
Project-URL: Repository, https://github.com/LuigiFerronatto/TESSERA
|
|
9
|
+
Project-URL: Documentation, https://github.com/LuigiFerronatto/TESSERA/tree/main/docs
|
|
10
|
+
Project-URL: Issues, https://github.com/LuigiFerronatto/TESSERA/issues
|
|
11
|
+
Keywords: memory,agents,rag,knowledge-graph,llm,pagerank,provenance,evidence
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: networkx>=3.0
|
|
19
|
+
Requires-Dist: numpy>=1.23
|
|
20
|
+
Requires-Dist: PyYAML>=6.0
|
|
21
|
+
Requires-Dist: scikit-learn>=1.2
|
|
22
|
+
Requires-Dist: rich>=13.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
25
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11" and extra == "dev"
|
|
26
|
+
Provides-Extra: mcp
|
|
27
|
+
Requires-Dist: mcp<2.0.0,>=1.30.0; extra == "mcp"
|
|
28
|
+
Provides-Extra: llm
|
|
29
|
+
Requires-Dist: requests>=2.28; extra == "llm"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<img src="docs/assets/brand/tessera-hero-nobg-sm.svg" alt="TESSERA — Temporal Evolving State Synthesis with Explicit Relations and Atomic Memories" />
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
# TESSERA
|
|
37
|
+
|
|
38
|
+
**A text-first memory and evidence layer for AI agents, with stable identity, explainable retrieval, and source-level provenance.**
|
|
39
|
+
|
|
40
|
+
TESSERA turns project knowledge into structured evidence an agent can query without making the agent own the memory system underneath.
|
|
41
|
+
|
|
42
|
+
- **Text-first** — Markdown and textual sources remain authoritative.
|
|
43
|
+
- **Auditable** — results trace back to source documents, versions, and evidence spans when provable.
|
|
44
|
+
- **Explainable** — retrieval signals and relevant evidence are inspectable instead of hidden behind one opaque score.
|
|
45
|
+
- **Agent-agnostic** — use the Python API, CLI, or MCP surface without coupling memory to one agent runtime.
|
|
46
|
+
|
|
47
|
+
[Install](#install) · [Quickstart](#quickstart) · [Python API](#python-api) · [Features](#features) · [Benchmarks](#benchmarks) · [How it works](#how-it-works) · [Research](#research-references) · [Documentation](#documentation) · [Contributors](#contributors)
|
|
48
|
+
|
|
49
|
+
[](https://github.com/LuigiFerronatto/TESSERA/actions/workflows/tessera-ci.yml)
|
|
50
|
+
|
|
51
|
+
## Install
|
|
52
|
+
|
|
53
|
+
TESSERA requires Python 3.9+.
|
|
54
|
+
|
|
55
|
+
The public distribution name is `tessera-agent-memory`; the Python import and
|
|
56
|
+
CLI remain `tessera`.
|
|
57
|
+
|
|
58
|
+
Install the released package with:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python -m pip install "tessera-agent-memory==0.0.1"
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Install the current repository version with `pip`:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
python -m pip install "git+https://github.com/LuigiFerronatto/TESSERA.git"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For development:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/LuigiFerronatto/TESSERA.git
|
|
74
|
+
cd TESSERA
|
|
75
|
+
python -m pip install -e ".[dev]"
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For a locally built release artifact, use a clean wheel rather than an editable
|
|
79
|
+
checkout:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python -m build
|
|
83
|
+
python -m pip install ./dist/tessera_agent_memory-0.0.1-py3-none-any.whl
|
|
84
|
+
python -m pip install "./dist/tessera_agent_memory-0.0.1-py3-none-any.whl[mcp]" # optional MCP transport
|
|
85
|
+
python -m pip install "./dist/tessera_agent_memory-0.0.1-py3-none-any.whl[llm]" # optional HTTP LLM bridge
|
|
86
|
+
python -m pip install --upgrade ./dist/tessera_agent_memory-0.0.1-py3-none-any.whl
|
|
87
|
+
python -m pip uninstall tessera-agent-memory
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Uninstall removes the installed package and console commands. Project sources,
|
|
91
|
+
`.tessera/config.yaml`, `.tessera-ignore` and generated memories remain yours.
|
|
92
|
+
The derived `.tessera/index/` also remains; remove only that configured index
|
|
93
|
+
directory if you want to discard the cache, then use `tessera index` after
|
|
94
|
+
reinstalling to rebuild it. Keep the config, source files and generated store.
|
|
95
|
+
|
|
96
|
+
The [#118 clean-room Test Card](docs/test-cards/118-clean-room-onboarding.md)
|
|
97
|
+
records the installed-wheel Python 3.9/3.12 onboarding candidate and CI evidence.
|
|
98
|
+
|
|
99
|
+
The project version is currently `0.0.1`; `pyproject.toml`, `tessera.__version__`
|
|
100
|
+
and installed distribution metadata must agree. Version changes are release
|
|
101
|
+
decisions, not automatic consequences of individual Test Cards.
|
|
102
|
+
|
|
103
|
+
TESSERA is not documented here as a PyPI package or release binary until those distribution channels are actually published.
|
|
104
|
+
|
|
105
|
+
## Quickstart
|
|
106
|
+
|
|
107
|
+
Configure this project, write one fact, index it, and query it. The config is
|
|
108
|
+
human-readable and contains no credential:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
tessera init --project . --store memories --sources recommended --non-interactive
|
|
112
|
+
|
|
113
|
+
tessera write \
|
|
114
|
+
--id project/database \
|
|
115
|
+
--type factual \
|
|
116
|
+
--episode setup \
|
|
117
|
+
--content "The project uses PostgreSQL as its primary database." \
|
|
118
|
+
--tags database,postgresql
|
|
119
|
+
|
|
120
|
+
tessera index
|
|
121
|
+
|
|
122
|
+
tessera query "what database does the project use?"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
From a nested directory TESSERA checks only the exact
|
|
126
|
+
`.tessera/config.yaml` marker on each physical ancestor; the nearest config
|
|
127
|
+
wins. Inspect the decision with `tessera config show` or
|
|
128
|
+
`tessera config show --json`.
|
|
129
|
+
|
|
130
|
+
A user-global registry remembers named stores without copying or merging their
|
|
131
|
+
memory:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
tessera init --global research --store /absolute/path/to/research --non-interactive
|
|
135
|
+
tessera config show --global research --json
|
|
136
|
+
tessera config list
|
|
137
|
+
tessera config doctor
|
|
138
|
+
tessera config unregister research # metadata only; never deletes the store
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Selection precedence is explicit `--store`/positional path,
|
|
142
|
+
`TESSERA_STORAGE_DIR`, deprecated warning-emitting `LAO_MEM_DIR`, nearest
|
|
143
|
+
project config, then an explicitly named global entry. Otherwise product CLI
|
|
144
|
+
operations fail with an actionable configuration error. The direct Python
|
|
145
|
+
compatibility resolver and no-configuration MCP fallback retain historical
|
|
146
|
+
`./memories` fallback; existing callers do not migrate automatically. See
|
|
147
|
+
[ADR 0003](docs/adr/0003-configuration-and-store-discovery.md).
|
|
148
|
+
|
|
149
|
+
Source files remain the source of truth. New project configuration is schema v2:
|
|
150
|
+
`store.path` is the generated-memory destination, `sources.roots` is an
|
|
151
|
+
explicit read/index allow list, and `index.path` is disposable derived state.
|
|
152
|
+
Interactive `tessera init` keeps those choices separate: it discovers safe
|
|
153
|
+
Markdown through the validated source-discovery contract, presents recommended,
|
|
154
|
+
optional, ignored and forbidden groups, asks for a source policy, shows the
|
|
155
|
+
complete plan, then requires confirmation before configuration or indexing.
|
|
156
|
+
Choose `memory-only` to retain the generated store as the sole source. Existing
|
|
157
|
+
schema-v1 configurations remain store-only unless a broader source policy is
|
|
158
|
+
explicitly selected.
|
|
159
|
+
|
|
160
|
+
A generated project configuration can therefore look like:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
schema_version: 2
|
|
164
|
+
store:
|
|
165
|
+
id: <UUID generated by tessera init>
|
|
166
|
+
path: memories
|
|
167
|
+
sources:
|
|
168
|
+
roots:
|
|
169
|
+
- path: .
|
|
170
|
+
include:
|
|
171
|
+
- README.md
|
|
172
|
+
- docs/**/*.md
|
|
173
|
+
- research/**/*.md
|
|
174
|
+
- memories/**/*.md
|
|
175
|
+
index:
|
|
176
|
+
path: .tessera/index
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Source roots are read/index only; an external source root is permitted only
|
|
180
|
+
when it is the exact generated-memory store. Generated writes remain inside
|
|
181
|
+
`store.path`. The derived index remains inside the project and outside the
|
|
182
|
+
generated-memory store.
|
|
183
|
+
|
|
184
|
+
The same plan is available without mutation or terminal interaction:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
tessera init --project . --store memories --sources recommended --dry-run
|
|
188
|
+
tessera init --project . --store memories --sources recommended --dry-run --json
|
|
189
|
+
tessera init --project . --store memories --sources custom \
|
|
190
|
+
--source README.md --source docs --non-interactive
|
|
191
|
+
tessera init --project . --store memories --sources memory-only --non-interactive
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Non-interactive project initialization requires an explicit `--sources`
|
|
195
|
+
policy and never prompts. A material change to an existing configuration must
|
|
196
|
+
first be inspected with `--dry-run`, then explicitly allowed with
|
|
197
|
+
`--update-existing`. Deselecting a source never edits `.tessera-ignore`;
|
|
198
|
+
`--persist-exclusion PATH` is the explicit, planned opt-in.
|
|
199
|
+
|
|
200
|
+
TESSERA can also inspect the configured project without changing its allow
|
|
201
|
+
list:
|
|
202
|
+
|
|
203
|
+
```python
|
|
204
|
+
from tessera.source_discovery import discover_sources_for_configuration
|
|
205
|
+
|
|
206
|
+
plan = discover_sources_for_configuration(resolved_configuration)
|
|
207
|
+
payload = plan.to_dict() # stable, machine-readable candidates and clusters
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Discovery is Markdown-only because Markdown is the current canonical ingestion
|
|
211
|
+
format. It returns `RECOMMENDED`, `SUPPORTED`, `IGNORED`, and `FORBIDDEN`
|
|
212
|
+
entries; standalone root files such as `README.md` remain visible while nested
|
|
213
|
+
sources are grouped by top-level project location. It never writes config,
|
|
214
|
+
`.tessera-ignore`, sources, or index state, and it never expands the configured
|
|
215
|
+
corpus. `tessera config doctor --json` includes the same discovery plan.
|
|
216
|
+
|
|
217
|
+
An optional root `.tessera-ignore` supports blank lines, `#` comments, `*`,
|
|
218
|
+
`?`, `**`, directory suffix `/`, and ordered `!` re-inclusion. It is a
|
|
219
|
+
documented subset, not a claim of perfect `.gitignore` compatibility. Mandatory
|
|
220
|
+
exclusions—including `.git`, the resolved derived index, legacy
|
|
221
|
+
`.tessera_index`, unsafe symlinks, special files, and private-key/credential
|
|
222
|
+
artifacts—cannot be re-included. The initialization plan, selection,
|
|
223
|
+
confirmation, configuration persistence, optional ignore edit, and
|
|
224
|
+
selected-source indexing are implemented by #155. No provider or model is
|
|
225
|
+
called, and source files are never rewritten.
|
|
226
|
+
|
|
227
|
+
Markdown is the only canonical writable persistence format. Every successful
|
|
228
|
+
Engine, CLI, or MCP write creates a `.md` source that the current indexer can
|
|
229
|
+
discover. Unsupported formats are rejected before sanitization or any storage,
|
|
230
|
+
registry, graph, index, or Evidence Ledger mutation; arbitrary JSON ingestion is
|
|
231
|
+
not supported.
|
|
232
|
+
|
|
233
|
+
Every write is decided before persistence using the deterministic contract
|
|
234
|
+
`path validation → detection → optional transformation → admission →
|
|
235
|
+
persistence`. Logical memory IDs use portable forward-slash segments and must
|
|
236
|
+
resolve strictly inside the configured store. Safe content is accepted
|
|
237
|
+
unchanged and is never labeled sanitized. Direct known hostile instructions are
|
|
238
|
+
rejected; empty input is rejected; quoted/documentary examples and
|
|
239
|
+
suspicious-tag-only inputs go to `review`. Those non-accepting outcomes have no
|
|
240
|
+
canonical persistence side effects. See
|
|
241
|
+
[`docs/WRITE_GATE_CONTRACT.md`](docs/WRITE_GATE_CONTRACT.md).
|
|
242
|
+
|
|
243
|
+
### Query existing project knowledge
|
|
244
|
+
|
|
245
|
+
TESSERA can also index explicitly configured Markdown with complete, partial,
|
|
246
|
+
or absent frontmatter. It recognizes textual artifacts such as:
|
|
247
|
+
|
|
248
|
+
```text
|
|
249
|
+
memories/*.md
|
|
250
|
+
research/*.md
|
|
251
|
+
AGENTS.md
|
|
252
|
+
CLAUDE.md
|
|
253
|
+
*.SKILL.md
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
It does not treat source code as the primary memory corpus.
|
|
257
|
+
|
|
258
|
+
## Python API
|
|
259
|
+
|
|
260
|
+
```python
|
|
261
|
+
from tessera import TesseraEngine
|
|
262
|
+
|
|
263
|
+
engine = TesseraEngine(storage_dir="./memories")
|
|
264
|
+
engine.build_index()
|
|
265
|
+
|
|
266
|
+
results = engine.retrieve_context(
|
|
267
|
+
"what database does the project use?",
|
|
268
|
+
top_n=3,
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
for result in results:
|
|
272
|
+
print(result["id"], result["score"])
|
|
273
|
+
print(result["relevant_evidence"])
|
|
274
|
+
print(result["provenance"])
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
A structured retrieval result can include:
|
|
278
|
+
|
|
279
|
+
```text
|
|
280
|
+
id
|
|
281
|
+
score + score_explain
|
|
282
|
+
relevant_evidence
|
|
283
|
+
full memory body
|
|
284
|
+
source path
|
|
285
|
+
stable source-document identity
|
|
286
|
+
source version hashes
|
|
287
|
+
evidence span
|
|
288
|
+
related memory IDs
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
See [`docs/OUTPUT_CONTRACT.md`](docs/OUTPUT_CONTRACT.md) for field semantics and nullability.
|
|
292
|
+
|
|
293
|
+
## Why TESSERA
|
|
294
|
+
|
|
295
|
+
Saving information is easy. Maintaining useful memory over time is harder.
|
|
296
|
+
|
|
297
|
+
An agent eventually needs to answer questions such as:
|
|
298
|
+
|
|
299
|
+
- Is this still the same memory after a file moves?
|
|
300
|
+
- Which source version supports this result?
|
|
301
|
+
- Why did this memory rank above another one?
|
|
302
|
+
- Which part of the source is relevant to this query?
|
|
303
|
+
- Are two memories related, outdated, or conflicting?
|
|
304
|
+
|
|
305
|
+
TESSERA makes those concerns part of the memory layer instead of pushing them into prompts, ad-hoc file conventions, or opaque retrieval infrastructure.
|
|
306
|
+
|
|
307
|
+
## Features
|
|
308
|
+
|
|
309
|
+
| Capability | Current behavior |
|
|
310
|
+
| --- | --- |
|
|
311
|
+
| Text ingestion | Canonicalizes Markdown with complete, partial, or absent frontmatter |
|
|
312
|
+
| Memory model | Preserves exactly three semantic drawers: `facts`, `preferences`, `insights` |
|
|
313
|
+
| Stable identity | Separates persistent memory/source identity from file path and content version |
|
|
314
|
+
| Explainable retrieval | Combines inspectable lexical, metadata, title, relation, and type signals |
|
|
315
|
+
| Query-aware evidence | Surfaces relevant evidence while preserving the full original memory |
|
|
316
|
+
| Provenance | Tracks source document, source version hashes, and exact spans when provable |
|
|
317
|
+
| Explicit relations | Preserves relationships and direct navigation between memories |
|
|
318
|
+
| Interfaces | Python API, CLI, and MCP |
|
|
319
|
+
| Evaluation | Python 3.9/3.12 tests, CLI smoke, and deterministic sanity retrieval evaluation |
|
|
320
|
+
|
|
321
|
+
### Deliberate boundaries
|
|
322
|
+
|
|
323
|
+
TESSERA is memory infrastructure, not the final reasoning agent. It does not:
|
|
324
|
+
|
|
325
|
+
- generate the final answer on behalf of the consuming agent;
|
|
326
|
+
- treat retrieval relevance as truth, confidence, or authority;
|
|
327
|
+
- silently rewrite source documents while indexing;
|
|
328
|
+
- require a generative LLM for the basic retrieval path;
|
|
329
|
+
- claim experimental temporal, arbitration, abstention, or adaptive-retrieval work as finished;
|
|
330
|
+
- use source-code indexing as its primary memory model.
|
|
331
|
+
|
|
332
|
+
The binding boundary is recorded in
|
|
333
|
+
[`ADR 0001`](docs/adr/0001-core-vs-optional-llm-boundary.md): deterministic
|
|
334
|
+
TESSERA retrieval ends at structured evidence with provenance; cognition and
|
|
335
|
+
the final response belong to the consuming agent. The repository also contains
|
|
336
|
+
a legacy, explicitly assisted orchestration path for LLM planning and context
|
|
337
|
+
synthesis. It is optional behavior, is not part of the deterministic retrieval
|
|
338
|
+
contract, and project-specific adapters require explicit deprecated
|
|
339
|
+
compatibility selection plus an endpoint or exact router path. No provider is
|
|
340
|
+
auto-probed. Target O0–O4 adapter semantics in the ADR are architecture
|
|
341
|
+
constraints, not claims that those future modes are implemented.
|
|
342
|
+
|
|
343
|
+
Base installation does not install an LLM provider SDK. `tessera[mcp]` adds the
|
|
344
|
+
MCP transport (SDK v1.30+, Python 3.10+; certified on 3.12) and `tessera[llm]` adds the current HTTP bridge dependency; these
|
|
345
|
+
extras do not change ownership of reasoning or final-answer policy.
|
|
346
|
+
|
|
347
|
+
Storage resolution is deterministic: an explicit command/API path wins, then
|
|
348
|
+
`TESSERA_STORAGE_DIR`, then the deprecated `LAO_MEM_DIR` compatibility alias,
|
|
349
|
+
then the nearest project config, then an explicitly named global store. The CLI
|
|
350
|
+
fails with an actionable error if none is selected. The direct Python
|
|
351
|
+
compatibility resolver retains its historical `./memories` fallback. The
|
|
352
|
+
canonical variable outranks the alias, which emits a deprecation warning;
|
|
353
|
+
discovery never scans an ancestor's source corpus or merges global knowledge.
|
|
354
|
+
|
|
355
|
+
Existing project-specific assisted users can migrate through the deprecated
|
|
356
|
+
explicit boundary while moving to an application-owned `llm_fn`:
|
|
357
|
+
|
|
358
|
+
```python
|
|
359
|
+
from tessera.llm_bridge import resolve_llm_fn
|
|
360
|
+
|
|
361
|
+
llm_fn = resolve_llm_fn(
|
|
362
|
+
backend="legacy-blip-gateway",
|
|
363
|
+
endpoint=configured_endpoint,
|
|
364
|
+
api_key=configured_key,
|
|
365
|
+
contact_id=configured_contact,
|
|
366
|
+
subscription_id=configured_subscription,
|
|
367
|
+
tenant_id=configured_tenant,
|
|
368
|
+
)
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
The endpoint and identifiers have no TESSERA defaults. The router adapter
|
|
372
|
+
likewise requires `backend="legacy-lao-engine-router"` and an exact
|
|
373
|
+
`router_path`; no parent-directory search is performed.
|
|
374
|
+
|
|
375
|
+
## Benchmarks
|
|
376
|
+
|
|
377
|
+
TESSERA versions a compact, non-sensitive ledger for its deterministic
|
|
378
|
+
LongMemEval V1 dev-50 retrieval profile. The ledger records aggregate retrieval
|
|
379
|
+
metrics, frozen inputs, configuration, commit provenance, cost, and hashes; it
|
|
380
|
+
does not commit the dataset, questions, answers, ground-truth mappings, or full
|
|
381
|
+
result bundles.
|
|
382
|
+
|
|
383
|
+
Every pull request declares benchmark applicability and, when `REQUIRED`, its
|
|
384
|
+
Test Card issue. Offline reporting checks run for every PR; the frozen 50-query
|
|
385
|
+
profile runs twice, gates against the exact PR base SHA, and reports the
|
|
386
|
+
historical #96 comparison separately. A pinned forward-environment fingerprint
|
|
387
|
+
supports main and weekly drift detection. These scores measure evidence
|
|
388
|
+
retrieval, not final-answer correctness; reader and judge evaluation remain
|
|
389
|
+
separate future layers.
|
|
390
|
+
|
|
391
|
+
See [`benchmarks/results/README.md`](benchmarks/results/README.md) for the local
|
|
392
|
+
comparison command and [`docs/BENCHMARK_CI.md`](docs/BENCHMARK_CI.md) for the CI
|
|
393
|
+
and applicability contract.
|
|
394
|
+
|
|
395
|
+
## How it works
|
|
396
|
+
|
|
397
|
+
```text
|
|
398
|
+
Text sources
|
|
399
|
+
│
|
|
400
|
+
▼
|
|
401
|
+
Canonical metadata
|
|
402
|
+
│
|
|
403
|
+
├── stable memory identity
|
|
404
|
+
├── stable source identity
|
|
405
|
+
└── explicit relations
|
|
406
|
+
│
|
|
407
|
+
▼
|
|
408
|
+
Index + Evidence Ledger
|
|
409
|
+
│
|
|
410
|
+
▼
|
|
411
|
+
Explainable retrieval
|
|
412
|
+
│
|
|
413
|
+
▼
|
|
414
|
+
Structured evidence
|
|
415
|
+
│
|
|
416
|
+
▼
|
|
417
|
+
Consuming agent
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
The current Foundation is intentionally deterministic and auditable before more adaptive behavior is introduced.
|
|
421
|
+
|
|
422
|
+
For implementation details, see [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md).
|
|
423
|
+
|
|
424
|
+
## Design principles
|
|
425
|
+
|
|
426
|
+
**Source text is authoritative.** Indexes, graphs, caches, and evidence records are derived and rebuildable.
|
|
427
|
+
|
|
428
|
+
**Identity is not location.** Moving a document should not automatically create a new memory or source identity.
|
|
429
|
+
|
|
430
|
+
**Evidence stays inspectable.** TESSERA preserves the full memory while foregrounding the part relevant to the current query.
|
|
431
|
+
|
|
432
|
+
**Scores have narrow meanings.** Retrieval relevance, confidence, authority, temporal validity, and utility are separate concepts.
|
|
433
|
+
|
|
434
|
+
**Research must earn its way into the product.** New ideas move through Test Cards and controlled evaluation before becoming architecture.
|
|
435
|
+
|
|
436
|
+
## Project status
|
|
437
|
+
|
|
438
|
+
TESSERA is an evolving Foundation. The current implementation is usable, but several long-term-memory capabilities are still being tested.
|
|
439
|
+
|
|
440
|
+
### Available today
|
|
441
|
+
|
|
442
|
+
- canonical metadata and document classification;
|
|
443
|
+
- stable memory and source-document identity;
|
|
444
|
+
- explainable local retrieval;
|
|
445
|
+
- query-aware relevant evidence;
|
|
446
|
+
- Evidence Ledger and provenance;
|
|
447
|
+
- explicit relation parsing/navigation;
|
|
448
|
+
- Python, CLI, and MCP surfaces;
|
|
449
|
+
- deterministic CI and sanity evaluation.
|
|
450
|
+
- lossless Engine/CLI/MCP direct-query contract parity.
|
|
451
|
+
|
|
452
|
+
### Being tested next
|
|
453
|
+
|
|
454
|
+
- incremental and idempotent indexing;
|
|
455
|
+
- broader text ingestion and structural segmentation;
|
|
456
|
+
- LongMemEval baseline;
|
|
457
|
+
- query-aware graph expansion and relation confidence;
|
|
458
|
+
- temporal state and state keys;
|
|
459
|
+
- authority, precedence, conflict, and evidence arbitration;
|
|
460
|
+
- adaptive retrieval and evidence sufficiency.
|
|
461
|
+
|
|
462
|
+
The deterministic-core/optional-LLM responsibility boundary is accepted in
|
|
463
|
+
[`ADR 0001`](docs/adr/0001-core-vs-optional-llm-boundary.md). Its migration and
|
|
464
|
+
experimental follow-ups remain separate Test Cards.
|
|
465
|
+
|
|
466
|
+
See [`docs/ROADMAP.md`](docs/ROADMAP.md) for the experimental sequence and linked Test Cards.
|
|
467
|
+
|
|
468
|
+
## Research references
|
|
469
|
+
|
|
470
|
+
TESSERA is research-driven, but a cited paper is a **reference signal**, not proof that its approach is implemented or validated here. The detailed source → interpretation → Test Card trace lives in [`docs/research/REFERENCES.md`](docs/research/REFERENCES.md).
|
|
471
|
+
|
|
472
|
+
| Reference | What it informs in TESSERA |
|
|
473
|
+
| --- | --- |
|
|
474
|
+
| [QUMem: Personalized Memory for Query-Conditioned User-State Inference in LLM Agents](https://arxiv.org/abs/2608.16168) | Three semantic drawers, query-conditioned memory use, temporal/source evidence |
|
|
475
|
+
| [A-MEM: Agentic Memory for LLM Agents](https://arxiv.org/abs/2502.12110) | Atomic structured memories, interconnected notes, memory evolution |
|
|
476
|
+
| [LongMemEval: Benchmarking Chat Assistants on Long-Term Interactive Memory](https://arxiv.org/abs/2410.10813) | Extraction, multi-session reasoning, updates, temporal reasoning, abstention |
|
|
477
|
+
| [LongMemEval V2](https://github.com/xiaowu0162/LongMemEval-V2) | Static/dynamic state, workflow knowledge, environment gotchas, premise awareness |
|
|
478
|
+
| [GraphMemix: Query-Aware Evidence Forests for Long-Term Multimodal Agent Memory](https://arxiv.org/abs/2608.26983) | Query-aware graph expansion and bounded evidence budgets |
|
|
479
|
+
| [LiveMem: Maintaining Memory State Continuity in Long-Running LLM Inference](https://arxiv.org/abs/2608.02515) | State continuity across context turnover and the boundary between intrinsic and external memory |
|
|
480
|
+
| [FinPerMA: A Theory-Informed, Event-Grounded Personalized-Memory Benchmark for LLM Agents](https://arxiv.org/abs/2608.04095) | Event-driven preference updates, post-shock personalization, and benchmark controls |
|
|
481
|
+
| [Enabling Personalized Long-term Interactions in LLM-based Agents through Persistent Memory and User Profiles](https://arxiv.org/abs/2510.07925) | Persistent user profiles, adaptive personalization, coordination, and self-validation |
|
|
482
|
+
| [State Contamination in Memory-Augmented LLM Agents](https://arxiv.org/abs/2605.16746) | Memory laundering, pre-persistence sanitization, and safety across state evolution |
|
|
483
|
+
| [MemORAI: Memory Organization and Retrieval via Adaptive Graph Intelligence for LLM Conversational Agents](https://aclanthology.org/2026.findings-acl.1408/) | Selective storage, turn-level provenance, multi-relational graphs, and query-adaptive retrieval |
|
|
484
|
+
| [CaSKG: Counterfactual-Causal Skill Graphs for Scalable Agent Skill Retrieval](https://arxiv.org/abs/2608.25500) | Relation confidence, edge validation, controlled graph traversal |
|
|
485
|
+
| [MemToC: Benchmarking Memory-Tool Conflict Resolution in Large Language Models](https://arxiv.org/abs/2608.26295) | Source arbitration, disagreement visibility, abstention |
|
|
486
|
+
| [RENDER: Controlling Reader-Facing Evidence in LLM Memory Evaluation](https://arxiv.org/abs/2608.23568) | Structured evidence rendering as an independent evaluation variable |
|
|
487
|
+
| [Mem0 paper](https://arxiv.org/abs/2504.19413) | Scalable long-term memory and hybrid retrieval comparison |
|
|
488
|
+
| [Zep / Graphiti paper](https://arxiv.org/abs/2501.13956) | Temporal context graphs, fact validity, provenance, incremental graph updates |
|
|
489
|
+
|
|
490
|
+
## Acknowledgements
|
|
491
|
+
|
|
492
|
+
TESSERA is informed by a broader ecosystem of memory systems, agent runtimes, benchmarks, and retrieval architectures. In addition to the papers above, the project actively studies and compares ideas from:
|
|
493
|
+
|
|
494
|
+
- [Mem0](https://docs.mem0.ai/)
|
|
495
|
+
- [Zep / Graphiti](https://help.getzep.com/graphiti/getting-started/overview)
|
|
496
|
+
- [Letta](https://docs.letta.com/)
|
|
497
|
+
- [LangGraph / LangChain memory](https://docs.langchain.com/oss/python/langchain/long-term-memory)
|
|
498
|
+
- [MemOS](https://github.com/MemTensor/MemOS)
|
|
499
|
+
- [MemPalace](https://github.com/bassemhalawani/memorypalace)
|
|
500
|
+
|
|
501
|
+
These references are acknowledgements of useful research and engineering ideas. They do not imply endorsement, dependency, architectural equivalence, or benchmark superiority.
|
|
502
|
+
|
|
503
|
+
## Documentation
|
|
504
|
+
|
|
505
|
+
| If you need | Read |
|
|
506
|
+
| --- | --- |
|
|
507
|
+
| Product overview | [`docs/OVERVIEW.md`](docs/OVERVIEW.md) |
|
|
508
|
+
| Current capabilities | [`docs/FEATURES.md`](docs/FEATURES.md) |
|
|
509
|
+
| Core vocabulary | [`docs/CONCEPTS.md`](docs/CONCEPTS.md) |
|
|
510
|
+
| Current architecture | [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) |
|
|
511
|
+
| Query examples | [`docs/QUERY_EXAMPLES.md`](docs/QUERY_EXAMPLES.md) |
|
|
512
|
+
| Retrieval result contract | [`docs/OUTPUT_CONTRACT.md`](docs/OUTPUT_CONTRACT.md) |
|
|
513
|
+
| Experimental roadmap | [`docs/ROADMAP.md`](docs/ROADMAP.md) |
|
|
514
|
+
| Research and comparisons | [`docs/research/`](docs/research/) |
|
|
515
|
+
| Change history | [`CHANGELOG.md`](CHANGELOG.md) |
|
|
516
|
+
|
|
517
|
+
The full documentation map is in [`docs/README.md`](docs/README.md).
|
|
518
|
+
|
|
519
|
+
## Development
|
|
520
|
+
|
|
521
|
+
Install the development dependencies and run the test suite:
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
python -m pip install -e ".[dev]"
|
|
525
|
+
pytest -ra
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
Repository changes follow an Issue/Test Card → PR → evaluation → decision workflow. See [`.github/pull_request_template.md`](.github/pull_request_template.md) and [`docs/CHANGE_POLICY.md`](docs/CHANGE_POLICY.md).
|
|
529
|
+
|
|
530
|
+
## Contributing
|
|
531
|
+
|
|
532
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, tests, the Issue/Test Card and PR
|
|
533
|
+
workflow, evaluation requirements and review expectations.
|
|
534
|
+
|
|
535
|
+
## License
|
|
536
|
+
|
|
537
|
+
TESSERA is licensed under the [MIT License](LICENSE). Preserve the separate
|
|
538
|
+
copyright and license notices supplied with third-party code and assets.
|
|
539
|
+
|
|
540
|
+
## Contributors
|
|
541
|
+
|
|
542
|
+
TESSERA is currently maintained by [Luigi Ferronatto](https://github.com/LuigiFerronatto).
|
|
543
|
+
|
|
544
|
+
See the repository's [contributor graph](https://github.com/LuigiFerronatto/TESSERA/graphs/contributors) for everyone who has contributed code or documentation.
|
|
545
|
+
|
|
546
|
+
The #120 MCP candidate adds `tessera-mcp --project /absolute/project`, isolated
|
|
547
|
+
startup and versioned `data`/`error` responses. See [MCP runtime contract](docs/MCP_RUNTIME.md)
|
|
548
|
+
for configuration precedence, provider injection, deadlines and migration.
|