mintmory-core 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.
- mintmory_core-0.1.0/.gitignore +59 -0
- mintmory_core-0.1.0/LICENSE +21 -0
- mintmory_core-0.1.0/PKG-INFO +61 -0
- mintmory_core-0.1.0/README.md +11 -0
- mintmory_core-0.1.0/pyproject.toml +69 -0
- mintmory_core-0.1.0/src/mintmory/core/__init__.py +49 -0
- mintmory_core-0.1.0/src/mintmory/core/cochange.py +901 -0
- mintmory_core-0.1.0/src/mintmory/core/config.py +442 -0
- mintmory_core-0.1.0/src/mintmory/core/conversion.py +207 -0
- mintmory_core-0.1.0/src/mintmory/core/dreaming.py +941 -0
- mintmory_core-0.1.0/src/mintmory/core/embedder.py +497 -0
- mintmory_core-0.1.0/src/mintmory/core/entities.py +352 -0
- mintmory_core-0.1.0/src/mintmory/core/history/__init__.py +21 -0
- mintmory_core-0.1.0/src/mintmory/core/history/adapters/__init__.py +9 -0
- mintmory_core-0.1.0/src/mintmory/core/history/adapters/claude_code.py +241 -0
- mintmory_core-0.1.0/src/mintmory/core/history/adapters/codex.py +274 -0
- mintmory_core-0.1.0/src/mintmory/core/history/adapters/hermes.py +206 -0
- mintmory_core-0.1.0/src/mintmory/core/history/adapters/kiro.py +279 -0
- mintmory_core-0.1.0/src/mintmory/core/history/distill.py +407 -0
- mintmory_core-0.1.0/src/mintmory/core/history/ingest.py +1015 -0
- mintmory_core-0.1.0/src/mintmory/core/history/models.py +90 -0
- mintmory_core-0.1.0/src/mintmory/core/history/normalize.py +125 -0
- mintmory_core-0.1.0/src/mintmory/core/history/query.py +319 -0
- mintmory_core-0.1.0/src/mintmory/core/history/redact.py +123 -0
- mintmory_core-0.1.0/src/mintmory/core/history/segment.py +198 -0
- mintmory_core-0.1.0/src/mintmory/core/hybrid_search.py +227 -0
- mintmory_core-0.1.0/src/mintmory/core/llm.py +366 -0
- mintmory_core-0.1.0/src/mintmory/core/migrate.py +1072 -0
- mintmory_core-0.1.0/src/mintmory/core/notes.py +286 -0
- mintmory_core-0.1.0/src/mintmory/core/ports.py +421 -0
- mintmory_core-0.1.0/src/mintmory/core/prompts.py +135 -0
- mintmory_core-0.1.0/src/mintmory/core/py.typed +0 -0
- mintmory_core-0.1.0/src/mintmory/core/schema.sql +230 -0
- mintmory_core-0.1.0/src/mintmory/core/schema_postgres.sql +206 -0
- mintmory_core-0.1.0/src/mintmory/core/scoring.py +137 -0
- mintmory_core-0.1.0/src/mintmory/core/session.py +135 -0
- mintmory_core-0.1.0/src/mintmory/core/storage.py +1663 -0
- mintmory_core-0.1.0/src/mintmory/core/storage_factory.py +83 -0
- mintmory_core-0.1.0/src/mintmory/core/storage_postgres.py +1606 -0
- mintmory_core-0.1.0/src/mintmory/core/telemetry.py +164 -0
- mintmory_core-0.1.0/src/mintmory/core/tree_index.py +227 -0
- mintmory_core-0.1.0/src/mintmory/core/types.py +521 -0
- mintmory_core-0.1.0/src/mintmory/core/vision.py +782 -0
- mintmory_core-0.1.0/tests/conformance/README.md +69 -0
- mintmory_core-0.1.0/tests/conformance/__init__.py +42 -0
- mintmory_core-0.1.0/tests/conformance/conftest.py +266 -0
- mintmory_core-0.1.0/tests/conformance/test_backend.py +1477 -0
- mintmory_core-0.1.0/tests/conformance/test_golden_retrieval.py +454 -0
- mintmory_core-0.1.0/tests/fixtures/history/claude/-Users-test-projects-sample-project/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.jsonl +7 -0
- mintmory_core-0.1.0/tests/fixtures/history/codex/rollout-2024-03-15T10-00-00-cccccccc-dddd-eeee-ffff-000000000001.jsonl +7 -0
- mintmory_core-0.1.0/tests/fixtures/history/hermes/session_20240315_100000_aabbccdd.json +52 -0
- mintmory_core-0.1.0/tests/fixtures/history/hermes/session_cron_test123_20240315_101000.json +15 -0
- mintmory_core-0.1.0/tests/fixtures/history/kiro/workspace-sessions/L1VzZXJzL3Rlc3QvcHJvamVjdHMvc2FtcGxlLXByb2plY3Q/kkkkkkkk-llll-mmmm-nnnn-oooooooooooo.json +54 -0
- mintmory_core-0.1.0/tests/fixtures/history/kiro/workspace-sessions/L1VzZXJzL3Rlc3QvcHJvamVjdHMvc2FtcGxlLXByb2plY3Q/sessions.json +8 -0
- mintmory_core-0.1.0/tests/test_cochange.py +1540 -0
- mintmory_core-0.1.0/tests/test_config.py +464 -0
- mintmory_core-0.1.0/tests/test_conversion.py +391 -0
- mintmory_core-0.1.0/tests/test_dreaming.py +1073 -0
- mintmory_core-0.1.0/tests/test_embedder.py +297 -0
- mintmory_core-0.1.0/tests/test_entities.py +165 -0
- mintmory_core-0.1.0/tests/test_history_adapters.py +782 -0
- mintmory_core-0.1.0/tests/test_history_distill_phase2.py +680 -0
- mintmory_core-0.1.0/tests/test_history_ingest.py +972 -0
- mintmory_core-0.1.0/tests/test_history_models_distill.py +290 -0
- mintmory_core-0.1.0/tests/test_history_query.py +718 -0
- mintmory_core-0.1.0/tests/test_history_redact.py +293 -0
- mintmory_core-0.1.0/tests/test_history_segment.py +477 -0
- mintmory_core-0.1.0/tests/test_index_tree_cochange.py +787 -0
- mintmory_core-0.1.0/tests/test_links.py +122 -0
- mintmory_core-0.1.0/tests/test_llm.py +524 -0
- mintmory_core-0.1.0/tests/test_llm_distiller.py +196 -0
- mintmory_core-0.1.0/tests/test_migrate.py +1062 -0
- mintmory_core-0.1.0/tests/test_notes.py +415 -0
- mintmory_core-0.1.0/tests/test_pg_soak.py +242 -0
- mintmory_core-0.1.0/tests/test_schema.py +560 -0
- mintmory_core-0.1.0/tests/test_scoring.py +300 -0
- mintmory_core-0.1.0/tests/test_search.py +741 -0
- mintmory_core-0.1.0/tests/test_session.py +366 -0
- mintmory_core-0.1.0/tests/test_stats.py +117 -0
- mintmory_core-0.1.0/tests/test_storage.py +647 -0
- mintmory_core-0.1.0/tests/test_storage_port.py +283 -0
- mintmory_core-0.1.0/tests/test_summary_jobs.py +679 -0
- mintmory_core-0.1.0/tests/test_tree_index.py +179 -0
- mintmory_core-0.1.0/tests/test_vision.py +2151 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
.venv/
|
|
6
|
+
.env
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.coverage
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
htmlcov/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
|
|
16
|
+
# uv
|
|
17
|
+
# uv.lock IS committed (MM-44): the Dockerfile/CI build with `uv sync --frozen`
|
|
18
|
+
# for reproducible, supply-chain-pinned images. Do not re-ignore it.
|
|
19
|
+
.uv/
|
|
20
|
+
|
|
21
|
+
# SQLite databases (dev only — test DBs should not be committed)
|
|
22
|
+
*.db
|
|
23
|
+
*.sqlite
|
|
24
|
+
*.sqlite3
|
|
25
|
+
!tests/fixtures/*.db
|
|
26
|
+
|
|
27
|
+
# Embeddings cache
|
|
28
|
+
.embeddings_cache/
|
|
29
|
+
*.index
|
|
30
|
+
*.npy
|
|
31
|
+
|
|
32
|
+
# IDE
|
|
33
|
+
.idea/
|
|
34
|
+
.vscode/
|
|
35
|
+
*.swp
|
|
36
|
+
*.swo
|
|
37
|
+
|
|
38
|
+
# OS
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# Secrets
|
|
43
|
+
.env.local
|
|
44
|
+
.env.production
|
|
45
|
+
*.key
|
|
46
|
+
*.pem
|
|
47
|
+
|
|
48
|
+
# Firecrawl local cache (CLI scrape/crawl output)
|
|
49
|
+
.firecrawl/
|
|
50
|
+
|
|
51
|
+
# Docs build
|
|
52
|
+
docs/_build/
|
|
53
|
+
site/
|
|
54
|
+
|
|
55
|
+
# Local test corpus (verbatim internal data) and scratch DBs — keep out of git history
|
|
56
|
+
scripts/corpus_parts/
|
|
57
|
+
*.db
|
|
58
|
+
*.db-wal
|
|
59
|
+
*.db-shm
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WeLikeCode
|
|
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.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mintmory-core
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MintMory core: Palantir-inspired typed memory ontology with SQLite storage
|
|
5
|
+
Project-URL: Homepage, https://github.com/WeLikeCode/mint-mory
|
|
6
|
+
Project-URL: Repository, https://github.com/WeLikeCode/mint-mory
|
|
7
|
+
Project-URL: Issues, https://github.com/WeLikeCode/mint-mory/issues
|
|
8
|
+
Author: WeLikeCode
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,llm,mcp,memory,sqlite,vector-search
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: numpy>=1.26
|
|
21
|
+
Requires-Dist: pydantic-settings>=2.4
|
|
22
|
+
Requires-Dist: pydantic>=2.8
|
|
23
|
+
Requires-Dist: python-ulid>=3.0
|
|
24
|
+
Requires-Dist: sqlite-vec>=0.1.6
|
|
25
|
+
Requires-Dist: structlog>=24.4
|
|
26
|
+
Provides-Extra: anthropic
|
|
27
|
+
Requires-Dist: anthropic>=0.35; extra == 'anthropic'
|
|
28
|
+
Provides-Extra: cochange
|
|
29
|
+
Requires-Dist: scikit-learn>=1.3; extra == 'cochange'
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=8.3; extra == 'dev'
|
|
33
|
+
Provides-Extra: docs
|
|
34
|
+
Requires-Dist: markitdown[all]>=0.1.0; extra == 'docs'
|
|
35
|
+
Provides-Extra: image
|
|
36
|
+
Requires-Dist: pillow>=10.0; extra == 'image'
|
|
37
|
+
Provides-Extra: local
|
|
38
|
+
Requires-Dist: sentence-transformers>=3.1; extra == 'local'
|
|
39
|
+
Provides-Extra: ocr
|
|
40
|
+
Requires-Dist: pytesseract>=0.3.10; extra == 'ocr'
|
|
41
|
+
Provides-Extra: openai
|
|
42
|
+
Requires-Dist: openai>=1.50; extra == 'openai'
|
|
43
|
+
Provides-Extra: otel
|
|
44
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.27; extra == 'otel'
|
|
45
|
+
Requires-Dist: opentelemetry-sdk>=1.27; extra == 'otel'
|
|
46
|
+
Provides-Extra: postgres
|
|
47
|
+
Requires-Dist: pgvector>=0.3.0; extra == 'postgres'
|
|
48
|
+
Requires-Dist: psycopg[binary,pool]>=3.1; extra == 'postgres'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
# mintmory-core
|
|
52
|
+
|
|
53
|
+
Core library of [MintMory](https://github.com/WeLikeCode/mint-mory) — a typed
|
|
54
|
+
memory system for LLM agents (8 memory categories, typed concept links, hybrid
|
|
55
|
+
FTS5 + vector search) on SQLite or Postgres.
|
|
56
|
+
|
|
57
|
+
Most users want the umbrella package instead: `pip install mintmory`.
|
|
58
|
+
|
|
59
|
+
Optional extras: `local` (sentence-transformers embeddings), `openai`,
|
|
60
|
+
`anthropic`, `docs` (markitdown ingestion), `otel`, `image`, `ocr`,
|
|
61
|
+
`cochange`, `postgres`. MIT licensed.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# mintmory-core
|
|
2
|
+
|
|
3
|
+
Core library of [MintMory](https://github.com/WeLikeCode/mint-mory) — a typed
|
|
4
|
+
memory system for LLM agents (8 memory categories, typed concept links, hybrid
|
|
5
|
+
FTS5 + vector search) on SQLite or Postgres.
|
|
6
|
+
|
|
7
|
+
Most users want the umbrella package instead: `pip install mintmory`.
|
|
8
|
+
|
|
9
|
+
Optional extras: `local` (sentence-transformers embeddings), `openai`,
|
|
10
|
+
`anthropic`, `docs` (markitdown ingestion), `otel`, `image`, `ocr`,
|
|
11
|
+
`cochange`, `postgres`. MIT licensed.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mintmory-core"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "MintMory core: Palantir-inspired typed memory ontology with SQLite storage"
|
|
5
|
+
requires-python = ">=3.12"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "WeLikeCode" }]
|
|
10
|
+
keywords = ["memory", "llm", "agents", "mcp", "sqlite", "vector-search"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
18
|
+
"Typing :: Typed",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
dependencies = [
|
|
22
|
+
"pydantic>=2.8",
|
|
23
|
+
"pydantic-settings>=2.4",
|
|
24
|
+
"sqlite-vec>=0.1.6", # Vector search within SQLite (small loadable dylib)
|
|
25
|
+
"numpy>=1.26", # Embedding arithmetic
|
|
26
|
+
"python-ulid>=3.0", # ULID for ordered IDs
|
|
27
|
+
"structlog>=24.4", # Structured logging
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.optional-dependencies]
|
|
31
|
+
# ADR-0004: sentence-transformers (and its PyTorch dependency, ~2GB) ships only
|
|
32
|
+
# with the `local` extra. Core without the extra omits PyTorch — suitable for
|
|
33
|
+
# OpenAI-only deployments and fast test environments that inject a mock embedder.
|
|
34
|
+
local = ["sentence-transformers>=3.1"] # Local embeddings (all-MiniLM-L6-v2, 384 dims)
|
|
35
|
+
openai = ["openai>=1.50"] # OpenAI embedding provider (imported lazily)
|
|
36
|
+
anthropic = ["anthropic>=0.35"] # Anthropic provider (future, imported lazily)
|
|
37
|
+
docs = ["markitdown[all]>=0.1.0"] # MS markitdown: docx/pdf/xlsx/pptx/... -> markdown (imported lazily)
|
|
38
|
+
otel = [ # OpenTelemetry export (off by default; no-op shim when absent)
|
|
39
|
+
"opentelemetry-sdk>=1.27",
|
|
40
|
+
"opentelemetry-exporter-otlp-proto-http>=1.27",
|
|
41
|
+
]
|
|
42
|
+
image = ["Pillow>=10.0"] # downscale large image payloads (lazy import; absent -> size-cap/skip)
|
|
43
|
+
ocr = ["pytesseract>=0.3.10"] # local OCR for the future 'ocr' vision provider (stubbed in v1)
|
|
44
|
+
cochange = ["scikit-learn>=1.3"] # HDBSCAN co-change clustering (ADR-0004: heavy deps stay opt-in)
|
|
45
|
+
postgres = [ # PostgresBackend (Phase 2) — psycopg3 pool + pgvector
|
|
46
|
+
"psycopg[binary,pool]>=3.1",
|
|
47
|
+
"pgvector>=0.3.0",
|
|
48
|
+
# Schema is created by runtime DDL (schema_postgres.sql) under a
|
|
49
|
+
# pg_advisory_xact_lock — idempotent + race-safe across replicas. A versioned
|
|
50
|
+
# Alembic migration tree is deferred until the schema first needs to evolve
|
|
51
|
+
# (and is wired into the Helm migration Job in Phase 4); no alembic/sqlalchemy
|
|
52
|
+
# dependency is pulled in until then, keeping the postgres image lean.
|
|
53
|
+
]
|
|
54
|
+
dev = [
|
|
55
|
+
"pytest>=8.3",
|
|
56
|
+
"pytest-asyncio>=0.24",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[project.urls]
|
|
60
|
+
Homepage = "https://github.com/WeLikeCode/mint-mory"
|
|
61
|
+
Repository = "https://github.com/WeLikeCode/mint-mory"
|
|
62
|
+
Issues = "https://github.com/WeLikeCode/mint-mory/issues"
|
|
63
|
+
|
|
64
|
+
[build-system]
|
|
65
|
+
requires = ["hatchling>=1.27"]
|
|
66
|
+
build-backend = "hatchling.build"
|
|
67
|
+
|
|
68
|
+
[tool.hatch.build.targets.wheel]
|
|
69
|
+
packages = ["src/mintmory"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""mintmory-core: typed memory ontology with SQLite storage."""
|
|
2
|
+
|
|
3
|
+
from mintmory.core.types import (
|
|
4
|
+
SYMMETRIC_LINK_TYPES,
|
|
5
|
+
BatchResolutionAction,
|
|
6
|
+
ConceptLink,
|
|
7
|
+
ConceptLinkType,
|
|
8
|
+
ConflictCheckResult,
|
|
9
|
+
ConflictDetail,
|
|
10
|
+
DreamIntensity,
|
|
11
|
+
DreamReport,
|
|
12
|
+
EmbeddingProvider,
|
|
13
|
+
LinkSource,
|
|
14
|
+
MemoryCategory,
|
|
15
|
+
MemoryFilter,
|
|
16
|
+
MemoryRecord,
|
|
17
|
+
MemorySource,
|
|
18
|
+
MemoryStats,
|
|
19
|
+
MemorySummary,
|
|
20
|
+
QueryResult,
|
|
21
|
+
QuerySession,
|
|
22
|
+
SearchAroundSpec,
|
|
23
|
+
SearchRequest,
|
|
24
|
+
SearchResponse,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"BatchResolutionAction",
|
|
29
|
+
"ConceptLink",
|
|
30
|
+
"ConceptLinkType",
|
|
31
|
+
"ConflictCheckResult",
|
|
32
|
+
"ConflictDetail",
|
|
33
|
+
"DreamIntensity",
|
|
34
|
+
"DreamReport",
|
|
35
|
+
"EmbeddingProvider",
|
|
36
|
+
"LinkSource",
|
|
37
|
+
"MemoryCategory",
|
|
38
|
+
"MemoryFilter",
|
|
39
|
+
"MemoryRecord",
|
|
40
|
+
"MemorySource",
|
|
41
|
+
"MemoryStats",
|
|
42
|
+
"MemorySummary",
|
|
43
|
+
"QueryResult",
|
|
44
|
+
"QuerySession",
|
|
45
|
+
"SearchAroundSpec",
|
|
46
|
+
"SearchRequest",
|
|
47
|
+
"SearchResponse",
|
|
48
|
+
"SYMMETRIC_LINK_TYPES",
|
|
49
|
+
]
|