adaptive-memory-engine 0.1.6__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.
Files changed (128) hide show
  1. adaptive_memory_engine-0.1.6/.gitignore +17 -0
  2. adaptive_memory_engine-0.1.6/CHANGELOG.md +48 -0
  3. adaptive_memory_engine-0.1.6/LICENSE +21 -0
  4. adaptive_memory_engine-0.1.6/PKG-INFO +228 -0
  5. adaptive_memory_engine-0.1.6/README.en.md +197 -0
  6. adaptive_memory_engine-0.1.6/README.md +197 -0
  7. adaptive_memory_engine-0.1.6/docs/product_user_flow.md +119 -0
  8. adaptive_memory_engine-0.1.6/docs/release_distribution_plan.md +200 -0
  9. adaptive_memory_engine-0.1.6/docs/standalone_distribution.md +259 -0
  10. adaptive_memory_engine-0.1.6/examples/corpora/README.md +11 -0
  11. adaptive_memory_engine-0.1.6/examples/notes/openclaw.md +13 -0
  12. adaptive_memory_engine-0.1.6/install.ps1 +73 -0
  13. adaptive_memory_engine-0.1.6/install.sh +71 -0
  14. adaptive_memory_engine-0.1.6/pyproject.toml +88 -0
  15. adaptive_memory_engine-0.1.6/src/ame/__init__.py +1 -0
  16. adaptive_memory_engine-0.1.6/src/ame/agent/__init__.py +1 -0
  17. adaptive_memory_engine-0.1.6/src/ame/agent/mcp.py +474 -0
  18. adaptive_memory_engine-0.1.6/src/ame/agent/memory_api.py +141 -0
  19. adaptive_memory_engine-0.1.6/src/ame/agent/results.py +30 -0
  20. adaptive_memory_engine-0.1.6/src/ame/bronze/schema.py +17 -0
  21. adaptive_memory_engine-0.1.6/src/ame/bronze/store.py +38 -0
  22. adaptive_memory_engine-0.1.6/src/ame/cli/__init__.py +1 -0
  23. adaptive_memory_engine-0.1.6/src/ame/cli/main.py +903 -0
  24. adaptive_memory_engine-0.1.6/src/ame/connectors/base.py +30 -0
  25. adaptive_memory_engine-0.1.6/src/ame/connectors/contract.py +199 -0
  26. adaptive_memory_engine-0.1.6/src/ame/connectors/github.py +66 -0
  27. adaptive_memory_engine-0.1.6/src/ame/connectors/google.py +464 -0
  28. adaptive_memory_engine-0.1.6/src/ame/connectors/google_oauth.py +156 -0
  29. adaptive_memory_engine-0.1.6/src/ame/connectors/jira.py +66 -0
  30. adaptive_memory_engine-0.1.6/src/ame/connectors/json_helpers.py +43 -0
  31. adaptive_memory_engine-0.1.6/src/ame/connectors/markdown.py +116 -0
  32. adaptive_memory_engine-0.1.6/src/ame/connectors/notion.py +59 -0
  33. adaptive_memory_engine-0.1.6/src/ame/connectors/oauth_callback.py +102 -0
  34. adaptive_memory_engine-0.1.6/src/ame/connectors/oauth_provider.py +250 -0
  35. adaptive_memory_engine-0.1.6/src/ame/connectors/obsidian.py +19 -0
  36. adaptive_memory_engine-0.1.6/src/ame/connectors/router.py +155 -0
  37. adaptive_memory_engine-0.1.6/src/ame/connectors/slack.py +66 -0
  38. adaptive_memory_engine-0.1.6/src/ame/connectors/slack_oauth.py +417 -0
  39. adaptive_memory_engine-0.1.6/src/ame/connectors/sync_history.py +73 -0
  40. adaptive_memory_engine-0.1.6/src/ame/context_budget.py +106 -0
  41. adaptive_memory_engine-0.1.6/src/ame/core/config.py +77 -0
  42. adaptive_memory_engine-0.1.6/src/ame/core/corpus.py +17 -0
  43. adaptive_memory_engine-0.1.6/src/ame/core/errors.py +18 -0
  44. adaptive_memory_engine-0.1.6/src/ame/core/paths.py +111 -0
  45. adaptive_memory_engine-0.1.6/src/ame/core/state.py +57 -0
  46. adaptive_memory_engine-0.1.6/src/ame/export/obsidian.py +123 -0
  47. adaptive_memory_engine-0.1.6/src/ame/gold/builder.py +300 -0
  48. adaptive_memory_engine-0.1.6/src/ame/gold/ontology.py +80 -0
  49. adaptive_memory_engine-0.1.6/src/ame/gold/resolver.py +91 -0
  50. adaptive_memory_engine-0.1.6/src/ame/gold/schema.py +40 -0
  51. adaptive_memory_engine-0.1.6/src/ame/gold/store.py +45 -0
  52. adaptive_memory_engine-0.1.6/src/ame/hardware/profiler.py +85 -0
  53. adaptive_memory_engine-0.1.6/src/ame/hardware/tier.py +27 -0
  54. adaptive_memory_engine-0.1.6/src/ame/hermes/__init__.py +3 -0
  55. adaptive_memory_engine-0.1.6/src/ame/hermes/memory.py +209 -0
  56. adaptive_memory_engine-0.1.6/src/ame/models/download.py +243 -0
  57. adaptive_memory_engine-0.1.6/src/ame/models/ollama.py +60 -0
  58. adaptive_memory_engine-0.1.6/src/ame/models/registry.py +101 -0
  59. adaptive_memory_engine-0.1.6/src/ame/models/router.py +22 -0
  60. adaptive_memory_engine-0.1.6/src/ame/pipeline.py +155 -0
  61. adaptive_memory_engine-0.1.6/src/ame/query/diff.py +40 -0
  62. adaptive_memory_engine-0.1.6/src/ame/query/engine.py +919 -0
  63. adaptive_memory_engine-0.1.6/src/ame/query/memory_os.py +313 -0
  64. adaptive_memory_engine-0.1.6/src/ame/query/mql.py +84 -0
  65. adaptive_memory_engine-0.1.6/src/ame/query/multihop.py +264 -0
  66. adaptive_memory_engine-0.1.6/src/ame/query/result.py +20 -0
  67. adaptive_memory_engine-0.1.6/src/ame/sdk.py +52 -0
  68. adaptive_memory_engine-0.1.6/src/ame/security.py +145 -0
  69. adaptive_memory_engine-0.1.6/src/ame/silver/extractor.py +414 -0
  70. adaptive_memory_engine-0.1.6/src/ame/silver/llm_extractor.py +181 -0
  71. adaptive_memory_engine-0.1.6/src/ame/silver/prompts.py +56 -0
  72. adaptive_memory_engine-0.1.6/src/ame/silver/rationale.py +140 -0
  73. adaptive_memory_engine-0.1.6/src/ame/silver/schema.py +51 -0
  74. adaptive_memory_engine-0.1.6/src/ame/silver/store.py +59 -0
  75. adaptive_memory_engine-0.1.6/src/ame/storage/custom_kg.py +33 -0
  76. adaptive_memory_engine-0.1.6/src/ame/storage/lightrag_adapter.py +362 -0
  77. adaptive_memory_engine-0.1.6/src/ame/validation/confidence.py +5 -0
  78. adaptive_memory_engine-0.1.6/src/ame/validation/grounding.py +10 -0
  79. adaptive_memory_engine-0.1.6/src/ame/validation/type_gate.py +22 -0
  80. adaptive_memory_engine-0.1.6/src/ame/writeback.py +173 -0
  81. adaptive_memory_engine-0.1.6/src/memory/__init__.py +3 -0
  82. adaptive_memory_engine-0.1.6/tests/conftest.py +9 -0
  83. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/README.md +5 -0
  84. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/001_rag_core_considered.md +16 -0
  85. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/002_lightrag_selected.md +17 -0
  86. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/003_obsidian_required.md +17 -0
  87. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/004_model_tier_decision.md +19 -0
  88. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/005_invalid_relation_case.md +16 -0
  89. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/006_superseded_policy.md +14 -0
  90. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/007_current_policy.md +16 -0
  91. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/008_action_items.md +17 -0
  92. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/009_issue_log.md +16 -0
  93. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/docs/010_project_summary.md +15 -0
  94. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/expected/expected_queries.json +27 -0
  95. adaptive_memory_engine-0.1.6/tests/fixtures/memory-mini/expected/validation_results.json +184 -0
  96. adaptive_memory_engine-0.1.6/tests/test_agent_writeback_hermes.py +36 -0
  97. adaptive_memory_engine-0.1.6/tests/test_benchmark_part1_fact_recall.py +133 -0
  98. adaptive_memory_engine-0.1.6/tests/test_benchmark_part2_timeline_supersedes.py +114 -0
  99. adaptive_memory_engine-0.1.6/tests/test_benchmark_part3_negative_hallucination.py +95 -0
  100. adaptive_memory_engine-0.1.6/tests/test_benchmark_part4_multihop_reasoning.py +98 -0
  101. adaptive_memory_engine-0.1.6/tests/test_benchmark_part5_agent_memory_os.py +121 -0
  102. adaptive_memory_engine-0.1.6/tests/test_benchmark_part6_connectors.py +17 -0
  103. adaptive_memory_engine-0.1.6/tests/test_bronze_store.py +18 -0
  104. adaptive_memory_engine-0.1.6/tests/test_connector_contract.py +69 -0
  105. adaptive_memory_engine-0.1.6/tests/test_context_budget_optimizer.py +46 -0
  106. adaptive_memory_engine-0.1.6/tests/test_cross_platform_paths.py +25 -0
  107. adaptive_memory_engine-0.1.6/tests/test_custom_kg.py +22 -0
  108. adaptive_memory_engine-0.1.6/tests/test_external_connectors.py +104 -0
  109. adaptive_memory_engine-0.1.6/tests/test_gold_builder.py +99 -0
  110. adaptive_memory_engine-0.1.6/tests/test_google_connectors.py +207 -0
  111. adaptive_memory_engine-0.1.6/tests/test_hardware.py +17 -0
  112. adaptive_memory_engine-0.1.6/tests/test_lightrag_adapter.py +288 -0
  113. adaptive_memory_engine-0.1.6/tests/test_llm_extractor.py +79 -0
  114. adaptive_memory_engine-0.1.6/tests/test_markdown_connector.py +17 -0
  115. adaptive_memory_engine-0.1.6/tests/test_memory_interface_hardening.py +75 -0
  116. adaptive_memory_engine-0.1.6/tests/test_memory_mini_dataset.py +136 -0
  117. adaptive_memory_engine-0.1.6/tests/test_model_download.py +111 -0
  118. adaptive_memory_engine-0.1.6/tests/test_oauth_login.py +96 -0
  119. adaptive_memory_engine-0.1.6/tests/test_obsidian_export.py +55 -0
  120. adaptive_memory_engine-0.1.6/tests/test_ollama_client.py +21 -0
  121. adaptive_memory_engine-0.1.6/tests/test_pipeline.py +80 -0
  122. adaptive_memory_engine-0.1.6/tests/test_pipeline_llm.py +61 -0
  123. adaptive_memory_engine-0.1.6/tests/test_plan_compliance_runtime.py +187 -0
  124. adaptive_memory_engine-0.1.6/tests/test_query_engine.py +69 -0
  125. adaptive_memory_engine-0.1.6/tests/test_rationale_memory.py +64 -0
  126. adaptive_memory_engine-0.1.6/tests/test_security.py +58 -0
  127. adaptive_memory_engine-0.1.6/tests/test_silver_extractor.py +46 -0
  128. adaptive_memory_engine-0.1.6/tests/test_slack_oauth_transport.py +168 -0
@@ -0,0 +1,17 @@
1
+ .DS_Store
2
+ .env
3
+ .coverage
4
+ htmlcov/
5
+ __pycache__/
6
+ *.py[cod]
7
+ .pytest_cache/
8
+ .ame*/
9
+ exports/
10
+ tests/out/
11
+ .venv/
12
+ dist/
13
+ build/
14
+ *.egg-info/
15
+ content/
16
+ /docs/adaptive_memory_engine_*.md
17
+ /adaptive_memory_engine_*.md
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ ## 0.1.6 - 2026-06-12
4
+
5
+ - Switched public install docs from TestPyPI to PyPI.
6
+ - Added macOS/Linux and Windows installer scripts for one-command local setup.
7
+ - Simplified README around the agent-first MCP flow: install once, connect once, then use Codex/Claude Code in natural language.
8
+
9
+ ## 0.1.5 - 2026-06-12
10
+
11
+ - Changed MCP config output to use `command: "ame"` by default.
12
+ - Added `--include-path-env` for MCP clients that need PATH included in generated config.
13
+ - Added `--absolute-command` for users who prefer the previous absolute executable path behavior.
14
+
15
+ ## 0.1.4 - 2026-06-11
16
+
17
+ - Updated MCP client config generation to use the absolute `ame` executable path.
18
+ - Clarified that virtual environments are only for installation isolation; MCP clients do not need the venv activated after config is added.
19
+
20
+ ## 0.1.3 - 2026-06-11
21
+
22
+ - Added `ame` as the recommended CLI command to avoid collisions with older or unrelated `memory` commands.
23
+ - Kept `memory` as a backwards-compatible alias.
24
+ - Updated README examples to use `ame` first.
25
+
26
+ ## 0.1.2 - 2026-06-11
27
+
28
+ - Added corpus-free bootstrap MCP mode through `memory mcp stdio`.
29
+ - Added MCP tools for agent-led setup: `ame_doctor`, `ame_setup`, `ame_load`, `ame_connect`, and `ame_corpora`.
30
+ - Updated `memory connect` so Codex/Claude Code can connect before any corpus exists.
31
+ - Added tests for agent bootstrap load and query flow.
32
+
33
+ ## 0.1.1 - 2026-06-11
34
+
35
+ - Added `memory chat <corpus>` for interactive terminal questions without typing `memory query` each time.
36
+ - Updated Korean and English README usage docs to show terminal chat mode and MCP usage more clearly.
37
+
38
+ ## 0.1.0 - 2026-06-11
39
+
40
+ Initial alpha release.
41
+
42
+ - Added local-first `memory` CLI for corpus setup, ingestion, retrieval, graph inspection, and export.
43
+ - Added Bronze/Silver/Gold document memory pipeline with local LLM assisted Silver extraction.
44
+ - Added hardware diagnosis and Ollama model recommendation through `memory doctor` and `memory setup`.
45
+ - Added stdio MCP server and client config generation for Codex and Claude Code.
46
+ - Added deterministic ingestion fallback for tests and lightweight smoke runs.
47
+ - Added macOS, Windows, and Linux runtime path handling.
48
+ - Added TestPyPI packaging support and GitHub Actions CI/publish workflows.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adaptive Memory Engine contributors
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,228 @@
1
+ Metadata-Version: 2.4
2
+ Name: adaptive-memory-engine
3
+ Version: 0.1.6
4
+ Summary: Local-first CLI memory engine that builds Bronze/Silver/Gold RAG memory from local documents.
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Keywords: ai,local-first,mcp,memory,ollama,rag
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: Microsoft :: Windows
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: Text Processing :: Indexing
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: pydantic>=2.7
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: typer>=0.12
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Provides-Extra: lightrag
28
+ Requires-Dist: lightrag-hku; extra == 'lightrag'
29
+ Requires-Dist: ollama; extra == 'lightrag'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # Adaptive Memory Engine Core
33
+
34
+ [English](README.en.md)
35
+
36
+ Adaptive Memory Engine Core는 내 로컬 문서를 읽어 Bronze/Silver/Gold 메모리로 만들고,
37
+ Codex나 Claude Code가 그 메모리를 보고 답할 수 있게 해주는 local-first 메모리 엔진입니다.
38
+
39
+ 사용자가 매번 긴 명령어를 치는 방식보다, **Codex/Claude Code에 AME를 연결하고 자연어로 맡기는 방식**을 우선합니다.
40
+
41
+ 현재는 alpha 단계이며 PyPI로 배포 중입니다. 현재 버전은 `0.1.6`입니다.
42
+
43
+ ## 1. 설치
44
+
45
+ macOS/Linux:
46
+
47
+ ```bash
48
+ curl -fsSL https://raw.githubusercontent.com/kimdol1045-hash/adaptive-memory-engine/main/install.sh | bash
49
+ ```
50
+
51
+ Windows PowerShell:
52
+
53
+ ```powershell
54
+ irm https://raw.githubusercontent.com/kimdol1045-hash/adaptive-memory-engine/main/install.ps1 | iex
55
+ ```
56
+
57
+ 설치 스크립트는 `~/.ame`에 AME를 설치하고 `ame` 명령을 PATH에 추가합니다. macOS/Linux에서는 설치 직후 스크립트가 출력하는 `source ...` 명령을 현재 터미널에 한 번 실행하면 됩니다.
58
+
59
+ ```bash
60
+ source ~/.zshrc
61
+ ```
62
+
63
+ 직접 설치하고 싶다면 PyPI에서 설치할 수 있습니다.
64
+
65
+ ```bash
66
+ python -m pip install adaptive-memory-engine
67
+ ```
68
+
69
+ 커스텀 MCP로만 쓸 때도 AME 실행 파일은 로컬에 있어야 합니다. PyPI/GitHub는 설치 파일을 배포하는 곳이고, MCP 클라이언트는 로컬에서 `ame mcp stdio` 프로세스를 실행합니다.
70
+
71
+ ## 2. Codex 또는 Claude Code에 연결
72
+
73
+ Codex용 MCP 설정을 출력해서 Codex의 커스텀 MCP 설정에 붙입니다.
74
+
75
+ ```bash
76
+ ame connect --client codex
77
+ ```
78
+
79
+ Claude Code를 쓴다면 다음 명령을 사용합니다.
80
+
81
+ ```bash
82
+ ame connect --client claude
83
+ ```
84
+
85
+ 출력된 JSON의 기본 `command`는 절대경로가 아니라 `ame`입니다.
86
+
87
+ ```json
88
+ {
89
+ "command": "ame",
90
+ "args": ["mcp", "stdio"]
91
+ }
92
+ ```
93
+
94
+ 기본 설정에는 실행 파일 절대경로를 넣지 않습니다. MCP 클라이언트가 실행될 때마다 가상환경을 직접 활성화할 필요도 없습니다.
95
+
96
+ 이때 아직 문서 메모리를 만들지 않았어도 괜찮습니다. `ame connect --client ...`는 bootstrap MCP 설정을 출력하므로, Codex/Claude Code가 사양 진단부터 메모리 구축까지 진행할 수 있습니다.
97
+
98
+ ## 3. 자연어로 요청
99
+
100
+ 이제 Codex나 Claude Code에 이렇게 말하면 됩니다.
101
+
102
+ ```text
103
+ 내 컴퓨터 사양을 진단하고 AME에 맞는 로컬 모델을 추천해줘.
104
+ 다운로드가 필요하면 어떤 모델을 받을지 먼저 알려줘.
105
+ 내가 승인하면 모델을 설치해줘.
106
+ 그 다음 /Users/me/Documents/planning 폴더를 my-docs라는 이름으로 메모리화해줘.
107
+ 구축이 끝나면 그 메모리를 기준으로 질문에 답해줘.
108
+ ```
109
+
110
+ 이후에는 평소처럼 질문하면 됩니다.
111
+
112
+ ```text
113
+ 이 문서들에서 현재 유효한 결정은 뭐야?
114
+ 왜 이런 구조를 선택했는지 근거를 찾아줘.
115
+ 지난 결정 중 지금은 superseded 된 게 있어?
116
+ ```
117
+
118
+ ## AME가 제공하는 MCP 도구
119
+
120
+ Codex/Claude Code는 AME MCP를 통해 다음 도구를 사용할 수 있습니다.
121
+
122
+ - `ame_doctor`: 컴퓨터 사양과 로컬 모델 상태 진단
123
+ - `ame_setup`: 추천 모델 다운로드 계획 또는 실행
124
+ - `ame_load`: 문서 폴더를 Bronze/Silver/Gold 메모리로 구축
125
+ - `ame_corpora`: 만들어진 corpus 목록 확인
126
+ - `memory_search`, `memory_query`: 구축된 메모리 기반 질문
127
+ - `memory_graph`, `memory_decisions`, `memory_timeline`, `memory_why`: 구조화된 메모리 조회
128
+
129
+ 모델 다운로드는 시간과 디스크를 사용합니다. Codex/Claude Code가 먼저 다운로드 계획을 보여준 뒤, 사용자가 승인하면 실행하는 흐름을 권장합니다.
130
+
131
+ ## CLI로 직접 쓰고 싶을 때
132
+
133
+ 에이전트 없이 직접 사용할 수도 있습니다.
134
+
135
+ ```bash
136
+ ame doctor
137
+ ame setup
138
+ ame setup --execute
139
+ ame load my-docs ./path/to/markdown-docs
140
+ ame chat my-docs
141
+ ```
142
+
143
+ `ame chat`에 들어가면 매번 명령어를 치지 않고 질문만 입력할 수 있습니다.
144
+
145
+ ```text
146
+ ame> 현재 유효한 결정은 뭐야?
147
+ ame> 왜 LightRAG를 선택했어?
148
+ ame> /exit
149
+ ```
150
+
151
+ ## 설치 문제 해결
152
+
153
+ 가상환경은 패키지를 격리해서 설치하기 위한 용도입니다.
154
+ MCP 설정을 한 번 추가한 뒤에는 Codex/Claude Code가 `ame` 명령을 직접 실행합니다.
155
+
156
+ 터미널에서 `ame` 명령이 안 보이면 PATH를 다시 적용합니다.
157
+
158
+ ```bash
159
+ source ~/.zshrc
160
+ ame --help
161
+ ame connect --client codex
162
+ ```
163
+
164
+ MCP 클라이언트가 `ame`를 찾지 못한다면 PATH를 JSON에 같이 넣을 수 있습니다.
165
+
166
+ ```bash
167
+ ame connect --client codex --include-path-env
168
+ ```
169
+
170
+ 그래도 안 되면 예전 방식처럼 실행 파일 절대경로를 넣을 수 있습니다.
171
+
172
+ ```bash
173
+ ame connect --client codex --absolute-command
174
+ ```
175
+
176
+ 예전 문서의 `memory` 명령과 충돌할 수 있어서, 새 버전에서는 `ame` 명령을 기본으로 사용합니다.
177
+ `memory`는 호환용 alias로 남아 있지만 가능하면 `ame`를 사용하세요.
178
+
179
+ ## MCP 모드
180
+
181
+ AME는 두 가지 MCP 모드를 제공합니다.
182
+
183
+ 아직 corpus가 없고 Codex/Claude Code가 설정부터 진행해야 한다면 bootstrap MCP를 사용합니다.
184
+
185
+ ```bash
186
+ ame mcp stdio
187
+ ```
188
+
189
+ 이미 만들어진 특정 corpus만 보게 하려면 corpus-bound MCP를 사용합니다.
190
+
191
+ ```bash
192
+ ame mcp stdio my-docs
193
+ ```
194
+
195
+ 대부분의 사용자는 직접 `ame mcp stdio`를 실행하지 않고, `ame connect --client codex` 또는 `ame connect --client claude`로 출력된 설정을 클라이언트에 넣으면 됩니다.
196
+
197
+ ## Bronze/Silver/Gold 구조
198
+
199
+ - Bronze: 원본 문서를 보존합니다.
200
+ - Silver: 엔티티, 관계, 결정, 근거, 제약을 구조화합니다.
201
+ - Gold: 그래프, 타임라인, supersession, 검증 정보를 구성합니다.
202
+
203
+ `ame load`의 기본 모드는 로컬 LLM을 사용하는 Bronze/Silver/Gold 구축입니다.
204
+ 테스트나 fallback이 필요할 때만 deterministic 모드를 사용합니다.
205
+
206
+ ```bash
207
+ ame load my-docs ./path/to/docs --mode deterministic
208
+ ```
209
+
210
+ ## SDK
211
+
212
+ ```python
213
+ from ame.sdk import Corpus
214
+ from memory import Corpus
215
+ ```
216
+
217
+ ## 테스트
218
+
219
+ ```bash
220
+ pytest
221
+ ```
222
+
223
+ ## 참고 문서
224
+
225
+ - `docs/product_user_flow.md`: 의도한 CLI 제품 흐름
226
+ - `docs/release_distribution_plan.md`: 외부 배포 계획
227
+ - `docs/pypi_release_checklist.md`: PyPI/TestPyPI 배포 체크리스트
228
+ - `docs/standalone_distribution.md`: standalone 패키지 분리 전략
@@ -0,0 +1,197 @@
1
+ # Adaptive Memory Engine Core
2
+
3
+ Adaptive Memory Engine Core turns local documents into Bronze/Silver/Gold memory
4
+ and exposes that memory to Codex, Claude Code, or another MCP client.
5
+
6
+ The preferred UX is agent-first: connect AME through MCP, then ask Codex or
7
+ Claude Code to diagnose hardware, recommend models, build memory, and answer
8
+ questions in natural language.
9
+
10
+ Current status: alpha, distributed through PyPI. Current version: `0.1.6`.
11
+
12
+ ## 1. Install
13
+
14
+ macOS/Linux:
15
+
16
+ ```bash
17
+ curl -fsSL https://raw.githubusercontent.com/kimdol1045-hash/adaptive-memory-engine/main/install.sh | bash
18
+ ```
19
+
20
+ Windows PowerShell:
21
+
22
+ ```powershell
23
+ irm https://raw.githubusercontent.com/kimdol1045-hash/adaptive-memory-engine/main/install.ps1 | iex
24
+ ```
25
+
26
+ The installer puts AME in `~/.ame` and adds `ame` to PATH. On macOS/Linux, run
27
+ the printed `source ...` command once in the current terminal after
28
+ installation:
29
+
30
+ ```bash
31
+ source ~/.zshrc
32
+ ```
33
+
34
+ Manual PyPI install is also available:
35
+
36
+ ```bash
37
+ python -m pip install adaptive-memory-engine
38
+ ```
39
+
40
+ Even when you only use custom MCP, the AME executable still needs to exist
41
+ locally. PyPI/GitHub distributes the package; the MCP client starts a local `ame
42
+ mcp stdio` process so AME can read local documents and use local LLMs.
43
+
44
+ ## 2. Connect Codex Or Claude Code
45
+
46
+ Print a Codex MCP config and paste it into Codex custom MCP settings:
47
+
48
+ ```bash
49
+ ame connect --client codex
50
+ ```
51
+
52
+ For Claude Code:
53
+
54
+ ```bash
55
+ ame connect --client claude
56
+ ```
57
+
58
+ By default, the `command` field is `ame`, not an absolute executable path.
59
+
60
+ ```json
61
+ {
62
+ "command": "ame",
63
+ "args": ["mcp", "stdio"]
64
+ }
65
+ ```
66
+
67
+ The default config does not include an absolute executable path. The MCP client
68
+ does not need the virtual environment to be activated every time.
69
+
70
+ This works even before a corpus exists. The bootstrap MCP server lets Codex or
71
+ Claude Code diagnose hardware, plan model downloads, build memory, and query the
72
+ built memory.
73
+
74
+ ## 3. Ask In Natural Language
75
+
76
+ Then ask Codex or Claude Code:
77
+
78
+ ```text
79
+ Diagnose my computer for AME and recommend local models.
80
+ If downloads are needed, show me the model plan first.
81
+ After I approve, install the models.
82
+ Then build memory named my-docs from /Users/me/Documents/planning.
83
+ Once memory is built, answer questions from that local memory.
84
+ ```
85
+
86
+ After that, ask normally:
87
+
88
+ ```text
89
+ What decisions are currently valid?
90
+ Why did we choose this architecture?
91
+ Which past decisions are now superseded?
92
+ ```
93
+
94
+ ## MCP Tools
95
+
96
+ AME exposes these tools to Codex or Claude Code:
97
+
98
+ - `ame_doctor`: diagnose hardware and local model status
99
+ - `ame_setup`: plan or execute recommended model downloads
100
+ - `ame_load`: build Bronze/Silver/Gold memory from a folder
101
+ - `ame_corpora`: list built corpora
102
+ - `memory_search`, `memory_query`: answer from built memory
103
+ - `memory_graph`, `memory_decisions`, `memory_timeline`, `memory_why`: structured memory lookup
104
+
105
+ Model downloads can take time and disk space. The agent should show the plan
106
+ first, then run downloads after user approval.
107
+
108
+ ## Manual CLI Use
109
+
110
+ You can also use AME directly:
111
+
112
+ ```bash
113
+ ame doctor
114
+ ame setup
115
+ ame setup --execute
116
+ ame load my-docs ./path/to/markdown-docs
117
+ ame chat my-docs
118
+ ```
119
+
120
+ Inside chat mode:
121
+
122
+ ```text
123
+ ame> What decisions are currently valid?
124
+ ame> Why did we choose LightRAG?
125
+ ame> /exit
126
+ ```
127
+
128
+ ## Troubleshooting
129
+
130
+ The virtual environment is only used to isolate the Python package install. Once
131
+ the MCP config is added, Codex or Claude Code launches the `ame` command.
132
+
133
+ If `ame` is not on PATH, reload your shell config:
134
+
135
+ ```bash
136
+ source ~/.zshrc
137
+ ame --help
138
+ ame connect --client codex
139
+ ```
140
+
141
+ If the MCP client still cannot find `ame`, include PATH in the generated JSON:
142
+
143
+ ```bash
144
+ ame connect --client codex --include-path-env
145
+ ```
146
+
147
+ If that still fails, use the previous absolute command mode:
148
+
149
+ ```bash
150
+ ame connect --client codex --absolute-command
151
+ ```
152
+
153
+ New versions use `ame` as the recommended command because the older `memory`
154
+ command can collide with previous installs. `memory` remains as a compatibility
155
+ alias, but prefer `ame`.
156
+
157
+ ## MCP Modes
158
+
159
+ Bootstrap MCP:
160
+
161
+ ```bash
162
+ ame mcp stdio
163
+ ```
164
+
165
+ Corpus-bound MCP:
166
+
167
+ ```bash
168
+ ame mcp stdio my-docs
169
+ ```
170
+
171
+ Most users do not need to run these manually. Use `ame connect --client codex`
172
+ or `ame connect --client claude` and paste the printed config into the client.
173
+
174
+ ## Bronze/Silver/Gold
175
+
176
+ - Bronze: preserves raw documents.
177
+ - Silver: extracts entities, relations, decisions, rationales, and constraints.
178
+ - Gold: builds graph, timeline, supersession, and validation views.
179
+
180
+ Use deterministic mode only for tests or fallback:
181
+
182
+ ```bash
183
+ ame load my-docs ./path/to/docs --mode deterministic
184
+ ```
185
+
186
+ ## SDK
187
+
188
+ ```python
189
+ from ame.sdk import Corpus
190
+ from memory import Corpus
191
+ ```
192
+
193
+ ## Tests
194
+
195
+ ```bash
196
+ pytest
197
+ ```