basic-memory 0.7.0__tar.gz → 0.9.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.

Potentially problematic release.


This version of basic-memory might be problematic. Click here for more details.

Files changed (256) hide show
  1. basic_memory-0.9.0/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  2. basic_memory-0.9.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  3. basic_memory-0.9.0/.github/ISSUE_TEMPLATE/documentation.md +19 -0
  4. basic_memory-0.9.0/.github/ISSUE_TEMPLATE/feature_request.md +28 -0
  5. {basic_memory-0.7.0 → basic_memory-0.9.0}/CHANGELOG.md +101 -0
  6. basic_memory-0.9.0/CLA.md +34 -0
  7. basic_memory-0.9.0/CLAUDE.md +133 -0
  8. basic_memory-0.9.0/CONTRIBUTING.md +159 -0
  9. basic_memory-0.9.0/Makefile +67 -0
  10. basic_memory-0.9.0/PKG-INFO +736 -0
  11. basic_memory-0.9.0/README.md +702 -0
  12. basic_memory-0.9.0/docs/.obsidian/app.json +1 -0
  13. basic_memory-0.9.0/docs/.obsidian/appearance.json +1 -0
  14. basic_memory-0.9.0/docs/.obsidian/core-plugins.json +31 -0
  15. basic_memory-0.9.0/docs/.obsidian/publish.json +6 -0
  16. basic_memory-0.9.0/docs/.obsidian/workspace.json +167 -0
  17. basic_memory-0.9.0/docs/AI Assistant Guide.md +396 -0
  18. basic_memory-0.9.0/docs/CLI Reference.md +289 -0
  19. basic_memory-0.9.0/docs/Canvas.md +107 -0
  20. basic_memory-0.9.0/docs/Getting Started with Basic Memory.md +176 -0
  21. basic_memory-0.9.0/docs/Knowledge Format.md +195 -0
  22. basic_memory-0.9.0/docs/Obsidian Integration.md +146 -0
  23. basic_memory-0.9.0/docs/Technical Information.md +99 -0
  24. basic_memory-0.9.0/docs/User Guide.md +518 -0
  25. basic_memory-0.9.0/docs/Welcome to Basic memory.md +181 -0
  26. basic_memory-0.9.0/docs/attachments/Canvas.png +0 -0
  27. basic_memory-0.9.0/docs/attachments/Obsidian-CoffeeKnowledgeBase-examples-overlays.gif +0 -0
  28. basic_memory-0.9.0/docs/attachments/Obsidian-CoffeeKnowledgeBase-examples.gif +0 -0
  29. basic_memory-0.9.0/docs/attachments/Prompt.png +0 -0
  30. basic_memory-0.9.0/docs/attachments/prompt 1.png +0 -0
  31. basic_memory-0.9.0/docs/attachments/prompt2.png +0 -0
  32. basic_memory-0.9.0/docs/attachments/prompt3.png +0 -0
  33. basic_memory-0.9.0/docs/attachments/prompt4.png +0 -0
  34. basic_memory-0.9.0/examples/.basic-memory/memory.db +0 -0
  35. basic_memory-0.9.0/examples/.obsidian/app.json +3 -0
  36. basic_memory-0.9.0/examples/.obsidian/appearance.json +1 -0
  37. basic_memory-0.9.0/examples/.obsidian/community-plugins.json +3 -0
  38. basic_memory-0.9.0/examples/.obsidian/core-plugins.json +31 -0
  39. basic_memory-0.9.0/examples/.obsidian/graph.json +22 -0
  40. basic_memory-0.9.0/examples/.obsidian/plugins/optimize-canvas-connections/main.js +158 -0
  41. basic_memory-0.9.0/examples/.obsidian/plugins/optimize-canvas-connections/manifest.json +10 -0
  42. basic_memory-0.9.0/examples/.obsidian/publish.json +6 -0
  43. basic_memory-0.9.0/examples/.obsidian/workspace.json +186 -0
  44. basic_memory-0.9.0/examples/Coffee Notes/Brewing Equipment.md +83 -0
  45. basic_memory-0.9.0/examples/Coffee Notes/Coffee Bean Origins.md +78 -0
  46. basic_memory-0.9.0/examples/Coffee Notes/Coffee Brewing Methods.md +70 -0
  47. basic_memory-0.9.0/examples/Coffee Notes/Coffee Flavor Map.md +89 -0
  48. basic_memory-0.9.0/examples/Coffee Notes/Coffee Knowledge Base.md +73 -0
  49. basic_memory-0.9.0/examples/Coffee Notes/Flavor Extraction.md +79 -0
  50. basic_memory-0.9.0/examples/Coffee Notes/Perfect Pour Over Coffee Method.canvas +161 -0
  51. basic_memory-0.9.0/examples/Coffee Notes/Tasting Notes.md +84 -0
  52. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/installer.py +0 -4
  53. {basic_memory-0.7.0 → basic_memory-0.9.0}/pyproject.toml +5 -2
  54. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/__init__.py +1 -1
  55. basic_memory-0.9.0/src/basic_memory/alembic/alembic.ini +119 -0
  56. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/alembic/env.py +23 -1
  57. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/alembic/migrations.py +4 -9
  58. basic_memory-0.9.0/src/basic_memory/alembic/versions/502b60eaa905_remove_required_from_entity_permalink.py +51 -0
  59. basic_memory-0.9.0/src/basic_memory/alembic/versions/b3c3938bacdb_relation_to_name_unique_index.py +44 -0
  60. basic_memory-0.9.0/src/basic_memory/alembic/versions/cc7172b46608_update_search_index_schema.py +106 -0
  61. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/app.py +9 -10
  62. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/routers/__init__.py +2 -1
  63. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/routers/knowledge_router.py +31 -5
  64. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/routers/memory_router.py +18 -17
  65. basic_memory-0.9.0/src/basic_memory/api/routers/project_info_router.py +275 -0
  66. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/routers/resource_router.py +105 -4
  67. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/routers/search_router.py +22 -4
  68. basic_memory-0.9.0/src/basic_memory/cli/app.py +69 -0
  69. basic_memory-0.9.0/src/basic_memory/cli/commands/__init__.py +18 -0
  70. basic_memory-0.9.0/src/basic_memory/cli/commands/db.py +24 -0
  71. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/import_chatgpt.py +26 -30
  72. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/import_claude_conversations.py +27 -29
  73. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/import_claude_projects.py +29 -31
  74. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/import_memory_json.py +26 -28
  75. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/mcp.py +7 -1
  76. basic_memory-0.9.0/src/basic_memory/cli/commands/project.py +119 -0
  77. basic_memory-0.9.0/src/basic_memory/cli/commands/project_info.py +167 -0
  78. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/status.py +14 -28
  79. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/commands/sync.py +63 -22
  80. basic_memory-0.9.0/src/basic_memory/cli/commands/tool.py +253 -0
  81. basic_memory-0.9.0/src/basic_memory/cli/main.py +58 -0
  82. basic_memory-0.9.0/src/basic_memory/config.py +224 -0
  83. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/db.py +19 -4
  84. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/deps.py +10 -3
  85. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/file_utils.py +37 -19
  86. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/entity_parser.py +3 -3
  87. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/utils.py +5 -0
  88. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/mcp/async_client.py +1 -1
  89. basic_memory-0.9.0/src/basic_memory/mcp/main.py +24 -0
  90. basic_memory-0.9.0/src/basic_memory/mcp/prompts/__init__.py +19 -0
  91. basic_memory-0.9.0/src/basic_memory/mcp/prompts/ai_assistant_guide.py +26 -0
  92. basic_memory-0.9.0/src/basic_memory/mcp/prompts/continue_conversation.py +111 -0
  93. basic_memory-0.9.0/src/basic_memory/mcp/prompts/recent_activity.py +88 -0
  94. basic_memory-0.9.0/src/basic_memory/mcp/prompts/search.py +182 -0
  95. basic_memory-0.9.0/src/basic_memory/mcp/prompts/utils.py +155 -0
  96. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/mcp/server.py +2 -6
  97. basic_memory-0.9.0/src/basic_memory/mcp/tools/__init__.py +27 -0
  98. basic_memory-0.9.0/src/basic_memory/mcp/tools/build_context.py +85 -0
  99. basic_memory-0.9.0/src/basic_memory/mcp/tools/canvas.py +97 -0
  100. basic_memory-0.9.0/src/basic_memory/mcp/tools/delete_note.py +28 -0
  101. basic_memory-0.9.0/src/basic_memory/mcp/tools/project_info.py +51 -0
  102. basic_memory-0.9.0/src/basic_memory/mcp/tools/read_content.py +229 -0
  103. basic_memory-0.9.0/src/basic_memory/mcp/tools/read_note.py +190 -0
  104. basic_memory-0.9.0/src/basic_memory/mcp/tools/recent_activity.py +100 -0
  105. basic_memory-0.9.0/src/basic_memory/mcp/tools/search.py +77 -0
  106. basic_memory-0.9.0/src/basic_memory/mcp/tools/utils.py +383 -0
  107. basic_memory-0.9.0/src/basic_memory/mcp/tools/write_note.py +124 -0
  108. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/models/knowledge.py +27 -11
  109. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/models/search.py +2 -1
  110. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/entity_repository.py +3 -2
  111. basic_memory-0.9.0/src/basic_memory/repository/project_info_repository.py +9 -0
  112. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/repository.py +24 -7
  113. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/search_repository.py +47 -14
  114. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/__init__.py +10 -9
  115. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/base.py +4 -1
  116. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/memory.py +14 -4
  117. basic_memory-0.9.0/src/basic_memory/schemas/project_info.py +96 -0
  118. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/search.py +29 -33
  119. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/context_service.py +3 -3
  120. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/entity_service.py +26 -13
  121. basic_memory-0.9.0/src/basic_memory/services/file_service.py +295 -0
  122. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/link_resolver.py +9 -46
  123. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/search_service.py +95 -22
  124. basic_memory-0.9.0/src/basic_memory/sync/__init__.py +6 -0
  125. basic_memory-0.9.0/src/basic_memory/sync/sync_service.py +580 -0
  126. basic_memory-0.9.0/src/basic_memory/sync/watch_service.py +344 -0
  127. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/utils.py +51 -36
  128. basic_memory-0.9.0/static/ai_assistant_guide.md +413 -0
  129. basic_memory-0.9.0/static/json_canvas_spec_1_0.md +115 -0
  130. basic_memory-0.9.0/tests/Non-MarkdownFileSupport.pdf +0 -0
  131. basic_memory-0.9.0/tests/Screenshot.png +0 -0
  132. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/__init__.py +2 -2
  133. basic_memory-0.9.0/tests/api/test_project_info_router.py +110 -0
  134. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/api/test_resource_router.py +124 -0
  135. basic_memory-0.9.0/tests/cli/conftest.py +30 -0
  136. basic_memory-0.9.0/tests/cli/test_cli_tools.py +412 -0
  137. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_import_chatgpt.py +2 -0
  138. basic_memory-0.9.0/tests/cli/test_project_commands.py +158 -0
  139. basic_memory-0.9.0/tests/cli/test_project_info.py +38 -0
  140. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_status.py +8 -39
  141. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_sync.py +2 -1
  142. basic_memory-0.9.0/tests/cli/test_version.py +14 -0
  143. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/conftest.py +39 -9
  144. basic_memory-0.9.0/tests/markdown/__init__.py +0 -0
  145. basic_memory-0.9.0/tests/mcp/test_prompts.py +215 -0
  146. basic_memory-0.9.0/tests/mcp/test_resources.py +19 -0
  147. basic_memory-0.9.0/tests/mcp/test_tool_canvas.py +273 -0
  148. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/mcp/test_tool_memory.py +1 -1
  149. basic_memory-0.9.0/tests/mcp/test_tool_notes.py +231 -0
  150. basic_memory-0.9.0/tests/mcp/test_tool_project_info.py +127 -0
  151. basic_memory-0.9.0/tests/mcp/test_tool_read_note.py +291 -0
  152. basic_memory-0.9.0/tests/mcp/test_tool_resource.py +197 -0
  153. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/mcp/test_tool_search.py +5 -5
  154. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/mcp/test_tool_utils.py +34 -4
  155. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/repository/test_entity_repository.py +17 -3
  156. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/schemas/test_memory_url.py +18 -1
  157. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/schemas/test_schemas.py +14 -0
  158. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/schemas/test_search.py +15 -22
  159. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/services/test_context_service.py +3 -3
  160. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/services/test_entity_service.py +96 -41
  161. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/services/test_link_resolver.py +41 -1
  162. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/services/test_search_service.py +116 -0
  163. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/sync/test_sync_service.py +210 -29
  164. basic_memory-0.9.0/tests/sync/test_watch_service.py +432 -0
  165. basic_memory-0.9.0/tests/sync/test_watch_service_edge_cases.py +75 -0
  166. basic_memory-0.9.0/tests/test_config.py +156 -0
  167. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/utils/test_permalink_formatting.py +1 -1
  168. {basic_memory-0.7.0 → basic_memory-0.9.0}/uv.lock +110 -472
  169. basic_memory-0.7.0/CONTRIBUTING.md +0 -17
  170. basic_memory-0.7.0/Makefile +0 -45
  171. basic_memory-0.7.0/PKG-INFO +0 -378
  172. basic_memory-0.7.0/README.md +0 -344
  173. basic_memory-0.7.0/src/basic_memory/alembic/README +0 -1
  174. basic_memory-0.7.0/src/basic_memory/cli/app.py +0 -20
  175. basic_memory-0.7.0/src/basic_memory/cli/commands/__init__.py +0 -5
  176. basic_memory-0.7.0/src/basic_memory/cli/commands/db.py +0 -28
  177. basic_memory-0.7.0/src/basic_memory/cli/commands/tools.py +0 -157
  178. basic_memory-0.7.0/src/basic_memory/cli/main.py +0 -20
  179. basic_memory-0.7.0/src/basic_memory/config.py +0 -62
  180. basic_memory-0.7.0/src/basic_memory/mcp/tools/__init__.py +0 -36
  181. basic_memory-0.7.0/src/basic_memory/mcp/tools/knowledge.py +0 -68
  182. basic_memory-0.7.0/src/basic_memory/mcp/tools/memory.py +0 -170
  183. basic_memory-0.7.0/src/basic_memory/mcp/tools/notes.py +0 -202
  184. basic_memory-0.7.0/src/basic_memory/mcp/tools/search.py +0 -38
  185. basic_memory-0.7.0/src/basic_memory/mcp/tools/utils.py +0 -154
  186. basic_memory-0.7.0/src/basic_memory/schemas/discovery.py +0 -28
  187. basic_memory-0.7.0/src/basic_memory/services/file_service.py +0 -176
  188. basic_memory-0.7.0/src/basic_memory/sync/__init__.py +0 -5
  189. basic_memory-0.7.0/src/basic_memory/sync/file_change_scanner.py +0 -158
  190. basic_memory-0.7.0/src/basic_memory/sync/sync_service.py +0 -174
  191. basic_memory-0.7.0/src/basic_memory/sync/utils.py +0 -31
  192. basic_memory-0.7.0/src/basic_memory/sync/watch_service.py +0 -218
  193. basic_memory-0.7.0/tests/cli/test_cli_tools.py +0 -294
  194. basic_memory-0.7.0/tests/mcp/test_tool_knowledge.py +0 -162
  195. basic_memory-0.7.0/tests/mcp/test_tool_notes.py +0 -352
  196. basic_memory-0.7.0/tests/sync/test_file_change_scanner.py +0 -245
  197. basic_memory-0.7.0/tests/sync/test_watch_service.py +0 -121
  198. {basic_memory-0.7.0 → basic_memory-0.9.0}/.github/workflows/pr-title.yml +0 -0
  199. {basic_memory-0.7.0 → basic_memory-0.9.0}/.github/workflows/release.yml +0 -0
  200. {basic_memory-0.7.0 → basic_memory-0.9.0}/.github/workflows/test.yml +0 -0
  201. {basic_memory-0.7.0 → basic_memory-0.9.0}/.gitignore +0 -0
  202. {basic_memory-0.7.0 → basic_memory-0.9.0}/.python-version +0 -0
  203. {basic_memory-0.7.0 → basic_memory-0.9.0}/CITATION.cff +0 -0
  204. {basic_memory-0.7.0 → basic_memory-0.9.0}/CODE_OF_CONDUCT.md +0 -0
  205. {basic_memory-0.7.0 → basic_memory-0.9.0}/LICENSE +0 -0
  206. {basic_memory-0.7.0 → basic_memory-0.9.0}/basic-memory.md +0 -0
  207. /basic_memory-0.7.0/tests/markdown/__init__.py → /basic_memory-0.9.0/examples/Untitled.md +0 -0
  208. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/Basic.icns +0 -0
  209. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/README.md +0 -0
  210. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/icon.svg +0 -0
  211. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/make_icons.sh +0 -0
  212. {basic_memory-0.7.0 → basic_memory-0.9.0}/installer/setup.py +0 -0
  213. {basic_memory-0.7.0 → basic_memory-0.9.0}/memory.json +0 -0
  214. {basic_memory-0.7.0 → basic_memory-0.9.0}/scripts/install.sh +0 -0
  215. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/alembic/script.py.mako +0 -0
  216. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/alembic/versions/3dae7c7b1564_initial_schema.py +0 -0
  217. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/api/__init__.py +0 -0
  218. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/cli/__init__.py +0 -0
  219. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/__init__.py +0 -0
  220. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/markdown_processor.py +0 -0
  221. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/plugins.py +0 -0
  222. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/markdown/schemas.py +0 -0
  223. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/mcp/__init__.py +0 -0
  224. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/models/__init__.py +0 -0
  225. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/models/base.py +0 -0
  226. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/__init__.py +0 -0
  227. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/observation_repository.py +0 -0
  228. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/repository/relation_repository.py +0 -0
  229. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/delete.py +0 -0
  230. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/request.py +0 -0
  231. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/schemas/response.py +0 -0
  232. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/__init__.py +0 -0
  233. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/exceptions.py +0 -0
  234. {basic_memory-0.7.0 → basic_memory-0.9.0}/src/basic_memory/services/service.py +0 -0
  235. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/api/conftest.py +0 -0
  236. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/api/test_knowledge_router.py +0 -0
  237. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/api/test_memory_router.py +0 -0
  238. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/api/test_search_router.py +0 -0
  239. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_import_claude_conversations.py +0 -0
  240. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_import_claude_projects.py +0 -0
  241. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/cli/test_import_memory_json.py +0 -0
  242. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/edit_file_test.py +0 -0
  243. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_entity_parser.py +0 -0
  244. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_markdown_plugins.py +0 -0
  245. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_markdown_processor.py +0 -0
  246. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_observation_edge_cases.py +0 -0
  247. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_parser_edge_cases.py +0 -0
  248. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_relation_edge_cases.py +0 -0
  249. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/markdown/test_task_detection.py +0 -0
  250. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/mcp/conftest.py +0 -0
  251. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/repository/test_observation_repository.py +0 -0
  252. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/repository/test_relation_repository.py +0 -0
  253. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/repository/test_repository.py +0 -0
  254. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/services/test_file_service.py +0 -0
  255. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/test_basic_memory.py +0 -0
  256. {basic_memory-0.7.0 → basic_memory-0.9.0}/tests/utils/test_file_utils.py +0 -0
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve Basic Memory
4
+ title: '[BUG] '
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Bug Description
10
+ A clear and concise description of what the bug is.
11
+
12
+ ## Steps To Reproduce
13
+ Steps to reproduce the behavior:
14
+ 1. Install version '...'
15
+ 2. Run command '...'
16
+ 3. Use tool/feature '...'
17
+ 4. See error
18
+
19
+ ## Expected Behavior
20
+ A clear and concise description of what you expected to happen.
21
+
22
+ ## Actual Behavior
23
+ What actually happened, including error messages and output.
24
+
25
+ ## Environment
26
+ - OS: [e.g. macOS 14.2, Ubuntu 22.04]
27
+ - Python version: [e.g. 3.12.1]
28
+ - Basic Memory version: [e.g. 0.1.0]
29
+ - Installation method: [e.g. pip, uv, source]
30
+ - Claude Desktop version (if applicable):
31
+
32
+ ## Additional Context
33
+ - Configuration files (if relevant)
34
+ - Logs or screenshots
35
+ - Any special configuration or environment variables
36
+
37
+ ## Possible Solution
38
+ If you have any ideas on what might be causing the issue or how to fix it, please share them here.
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Basic Memory Discussions
4
+ url: https://github.com/basicmachines-co/basic-memory/discussions
5
+ about: For questions, ideas, or more open-ended discussions
6
+ - name: Documentation
7
+ url: https://github.com/basicmachines-co/basic-memory#readme
8
+ about: Please check the documentation first before reporting an issue
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Documentation improvement
3
+ about: Suggest improvements or report issues with documentation
4
+ title: '[DOCS] '
5
+ labels: documentation
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Documentation Issue
10
+ Describe what's missing, unclear, or incorrect in the current documentation.
11
+
12
+ ## Location
13
+ Where is the problematic documentation? (URL, file path, or section)
14
+
15
+ ## Suggested Improvement
16
+ How would you improve this documentation? Please be as specific as possible.
17
+
18
+ ## Additional Context
19
+ Any additional information or screenshots that might help explain the issue or improvement.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for Basic Memory
4
+ title: '[FEATURE] '
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ ## Feature Description
10
+ A clear and concise description of the feature you'd like to see implemented.
11
+
12
+ ## Problem This Feature Solves
13
+ Describe the problem or limitation you're experiencing that this feature would address.
14
+
15
+ ## Proposed Solution
16
+ Describe how you envision this feature working. Include:
17
+ - User workflow
18
+ - Interface design (if applicable)
19
+ - Technical approach (if you have ideas)
20
+
21
+ ## Alternative Solutions
22
+ Have you considered any alternative solutions or workarounds?
23
+
24
+ ## Additional Context
25
+ Add any other context, screenshots, or examples about the feature request here.
26
+
27
+ ## Impact
28
+ How would this feature benefit you and other users of Basic Memory?
@@ -1,6 +1,107 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v0.9.0 (2025-03-07)
5
+
6
+ ### Chores
7
+
8
+ - Pre beta prep ([#20](https://github.com/basicmachines-co/basic-memory/pull/20),
9
+ [`6a4bd54`](https://github.com/basicmachines-co/basic-memory/commit/6a4bd546466a45107007b5000276b6c9bb62ef27))
10
+
11
+ fix: drop search_index table on db reindex
12
+
13
+ fix: ai_resource_guide.md path
14
+
15
+ chore: remove logfire
16
+
17
+ Signed-off-by: phernandez <paul@basicmachines.co>
18
+
19
+ ### Documentation
20
+
21
+ - Update README.md and CLAUDE.md
22
+ ([`182ec78`](https://github.com/basicmachines-co/basic-memory/commit/182ec7835567fc246798d9b4ad121b2f85bc6ade))
23
+
24
+ ### Features
25
+
26
+ - Add project_info tool ([#19](https://github.com/basicmachines-co/basic-memory/pull/19),
27
+ [`d2bd75a`](https://github.com/basicmachines-co/basic-memory/commit/d2bd75a949cc4323cb376ac2f6cb39f47c78c428))
28
+
29
+ Signed-off-by: phernandez <paul@basicmachines.co>
30
+
31
+ - Beta work ([#17](https://github.com/basicmachines-co/basic-memory/pull/17),
32
+ [`e6496df`](https://github.com/basicmachines-co/basic-memory/commit/e6496df595f3cafde6cc836384ee8c60886057a5))
33
+
34
+ feat: Add multiple projects support
35
+
36
+ feat: enhanced read_note for when initial result is not found
37
+
38
+ fix: merge frontmatter when updating note
39
+
40
+ fix: handle directory removed on sync watch
41
+
42
+ - Implement boolean search ([#18](https://github.com/basicmachines-co/basic-memory/pull/18),
43
+ [`90d5754`](https://github.com/basicmachines-co/basic-memory/commit/90d5754180beaf4acd4be38f2438712555640b49))
44
+
45
+
46
+ ## v0.8.0 (2025-02-28)
47
+
48
+ ### Chores
49
+
50
+ - Formatting
51
+ ([`93cc637`](https://github.com/basicmachines-co/basic-memory/commit/93cc6379ebb9ecc6a1652feeeecbf47fc992d478))
52
+
53
+ - Refactor logging setup
54
+ ([`f4b703e`](https://github.com/basicmachines-co/basic-memory/commit/f4b703e57f0ddf686de6840ff346b8be2be499ad))
55
+
56
+ ### Features
57
+
58
+ - Add enhanced prompts and resources
59
+ ([#15](https://github.com/basicmachines-co/basic-memory/pull/15),
60
+ [`093dab5`](https://github.com/basicmachines-co/basic-memory/commit/093dab5f03cf7b090a9f4003c55507859bf355b0))
61
+
62
+ ## Summary - Add comprehensive documentation to all MCP prompt modules - Enhance search prompt with
63
+ detailed contextual output formatting - Implement consistent logging and docstring patterns across
64
+ prompt utilities - Fix type checking in prompt modules
65
+
66
+ ## Prompts Added/Enhanced - `search.py`: New formatted output with relevance scores, excerpts, and
67
+ next steps - `recent_activity.py`: Enhanced with better metadata handling and documentation -
68
+ `continue_conversation.py`: Improved context management
69
+
70
+ ## Resources Added/Enhanced - `ai_assistant_guide`: Resource with description to give to LLM to
71
+ understand how to use the tools
72
+
73
+ ## Technical improvements - Added detailed docstrings to all prompt modules explaining their purpose
74
+ and usage - Enhanced the search prompt with rich contextual output that helps LLMs understand
75
+ results - Created a consistent pattern for formatting output across prompts - Improved error
76
+ handling in metadata extraction - Standardized import organization and naming conventions - Fixed
77
+ various type checking issues across the codebase
78
+
79
+ This PR is part of our ongoing effort to improve the MCP's interaction quality with LLMs, making the
80
+ system more helpful and intuitive for AI assistants to navigate knowledge bases.
81
+
82
+ 🤖 Generated with [Claude Code](https://claude.ai/code)
83
+
84
+ ---------
85
+
86
+ Co-authored-by: phernandez <phernandez@basicmachines.co>
87
+
88
+ - Add new `canvas` tool to create json canvas files in obsidian.
89
+ ([#14](https://github.com/basicmachines-co/basic-memory/pull/14),
90
+ [`0d7b0b3`](https://github.com/basicmachines-co/basic-memory/commit/0d7b0b3d7ede7555450ddc9728951d4b1edbbb80))
91
+
92
+ Add new `canvas` tool to create json canvas files in obsidian.
93
+
94
+ ---------
95
+
96
+ Co-authored-by: phernandez <phernandez@basicmachines.co>
97
+
98
+ - Incremental sync on watch ([#13](https://github.com/basicmachines-co/basic-memory/pull/13),
99
+ [`37a01b8`](https://github.com/basicmachines-co/basic-memory/commit/37a01b806d0758029d34a862e76d44c7e5d538a5))
100
+
101
+ - incremental sync on watch - sync non-markdown files in knowledge base - experimental
102
+ `read_resource` tool for reading non-markdown files in raw form (pdf, image)
103
+
104
+
4
105
  ## v0.7.0 (2025-02-19)
5
106
 
6
107
  ### Bug Fixes
@@ -0,0 +1,34 @@
1
+ Developer Certificate of Origin
2
+ Version 1.1
3
+ https://developercertificate.org/
4
+
5
+ Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
6
+
7
+ Everyone is permitted to copy and distribute verbatim copies of this
8
+ license document, but changing it is not allowed.
9
+
10
+ Developer's Certificate of Origin 1.1
11
+
12
+ By making a contribution to this project, I certify that:
13
+
14
+ (a) The contribution was created in whole or in part by me and I
15
+ have the right to submit it under the open source license
16
+ indicated in the file; or
17
+
18
+ (b) The contribution is based upon previous work that, to the best
19
+ of my knowledge, is covered under an appropriate open source
20
+ license and I have the right under that license to submit that
21
+ work with modifications, whether created in whole or in part
22
+ by me, under the same open source license (unless I am
23
+ permitted to submit under a different license), as indicated
24
+ in the file; or
25
+
26
+ (c) The contribution was provided directly to me by some other
27
+ person who certified (a), (b) or (c) and I have not modified
28
+ it.
29
+
30
+ (d) I understand and agree that this project and the contribution
31
+ are public and that a record of the contribution (including all
32
+ personal information I submit with it, including my sign-off) is
33
+ maintained indefinitely and may be redistributed consistent with
34
+ this project or the open source license(s) involved.
@@ -0,0 +1,133 @@
1
+ # CLAUDE.md - Basic Memory Project Guide
2
+
3
+ ## Project Overview
4
+
5
+ Basic Memory is a local-first knowledge management system built on the Model Context Protocol (MCP). It enables
6
+ bidirectional communication between LLMs (like Claude) and markdown files, creating a personal knowledge graph that can
7
+ be traversed using links between documents.
8
+
9
+ ## CODEBASE DEVELOPMENT
10
+
11
+ ### Project information
12
+
13
+ See the [README.md](README.md) file for a project overview.
14
+
15
+ ### Build and Test Commands
16
+
17
+ - Install: `make install` or `pip install -e ".[dev]"`
18
+ - Run tests: `uv run pytest -p pytest_mock -v` or `make test`
19
+ - Single test: `pytest tests/path/to/test_file.py::test_function_name`
20
+ - Lint: `make lint` or `ruff check . --fix`
21
+ - Type check: `make type-check` or `uv run pyright`
22
+ - Format: `make format` or `uv run ruff format .`
23
+ - Run all code checks: `make check` (runs lint, format, type-check, test)
24
+ - Create db migration: `make migration m="Your migration message"`
25
+ - Run development MCP Inspector: `make run-inspector`
26
+
27
+ ### Code Style Guidelines
28
+
29
+ - Line length: 100 characters max
30
+ - Python 3.12+ with full type annotations
31
+ - Format with ruff (consistent styling)
32
+ - Import order: standard lib, third-party, local imports
33
+ - Naming: snake_case for functions/variables, PascalCase for classes
34
+ - Prefer async patterns with SQLAlchemy 2.0
35
+ - Use Pydantic v2 for data validation and schemas
36
+ - CLI uses Typer for command structure
37
+ - API uses FastAPI for endpoints
38
+ - Follow the repository pattern for data access
39
+ - Tools communicate to api routers via the httpx ASGI client (in process)
40
+
41
+ ### Codebase Architecture
42
+
43
+ - `/alembic` - Alembic db migrations
44
+ - `/api` - FastAPI implementation of REST endpoints
45
+ - `/cli` - Typer command-line interface
46
+ - `/markdown` - Markdown parsing and processing
47
+ - `/mcp` - Model Context Protocol server implementation
48
+ - `/models` - SQLAlchemy ORM models
49
+ - `/repository` - Data access layer
50
+ - `/schemas` - Pydantic models for validation
51
+ - `/services` - Business logic layer
52
+ - `/sync` - File synchronization services
53
+
54
+ ### Development Notes
55
+
56
+ - MCP tools are defined in src/basic_memory/mcp/tools/
57
+ - MCP prompts are defined in src/basic_memory/mcp/prompts/
58
+ - MCP tools should be atomic, composable operations
59
+ - Use `textwrap.dedent()` for multi-line string formatting in prompts and tools
60
+ - MCP Prompts are used to invoke tools and format content with instructions for an LLM
61
+ - Schema changes require Alembic migrations
62
+ - SQLite is used for indexing and full text search, files are source of truth
63
+ - Testing uses pytest with asyncio support (strict mode)
64
+ - Test database uses in-memory SQLite
65
+ - Avoid creating mocks in tests in most circumstances.
66
+ - Each test runs in a standalone enviroment with in memory SQLite and tmp_file directory
67
+
68
+ ## BASIC MEMORY PRODUCT USAGE
69
+
70
+ ### Knowledge Structure
71
+
72
+ - Entity: Any concept, document, or idea represented as a markdown file
73
+ - Observation: A categorized fact about an entity (`- [category] content`)
74
+ - Relation: A directional link between entities (`- relation_type [[Target]]`)
75
+ - Frontmatter: YAML metadata at the top of markdown files
76
+ - Knowledge representation follows precise markdown format:
77
+ - Observations with [category] prefixes
78
+ - Relations with WikiLinks [[Entity]]
79
+ - Frontmatter with metadata
80
+
81
+ ### Basic Memory Commands
82
+
83
+ - Sync knowledge: `basic-memory sync` or `basic-memory sync --watch`
84
+ - Import from Claude: `basic-memory import claude conversations`
85
+ - Import from ChatGPT: `basic-memory import chatgpt`
86
+ - Import from Memory JSON: `basic-memory import memory-json`
87
+ - Check sync status: `basic-memory status`
88
+ - Tool access: `basic-memory tools` (provides CLI access to MCP tools)
89
+ - Guide: `basic-memory tools basic-memory-guide`
90
+ - Continue: `basic-memory tools continue-conversation --topic="search"`
91
+
92
+ ### MCP Capabilities
93
+
94
+ - Basic Memory exposes these MCP tools to LLMs:
95
+
96
+ **Content Management:**
97
+ - `write_note(title, content, folder, tags)` - Create/update markdown notes with semantic observations and relations
98
+ - `read_note(identifier, page, page_size)` - Read notes by title, permalink, or memory:// URL with knowledge graph
99
+ awareness
100
+ - `read_file(path)` - Read raw file content (text, images, binaries) without knowledge graph processing
101
+
102
+ **Knowledge Graph Navigation:**
103
+ - `build_context(url, depth, timeframe)` - Navigate the knowledge graph via memory:// URLs for conversation
104
+ continuity
105
+ - `recent_activity(type, depth, timeframe)` - Get recently updated information with specified timeframe (e.g., "
106
+ 1d", "1 week")
107
+
108
+ **Search & Discovery:**
109
+ - `search(query, page, page_size)` - Full-text search across all content with filtering options
110
+
111
+ **Visualization:**
112
+ - `canvas(nodes, edges, title, folder)` - Generate Obsidian canvas files for knowledge graph visualization
113
+
114
+ - MCP Prompts for better AI interaction:
115
+ - `ai_assistant_guide()` - Guidance on effectively using Basic Memory tools for AI assistants
116
+ - `continue_conversation(topic, timeframe)` - Continue previous conversations with relevant historical context
117
+ - `search(query, after_date)` - Search with detailed, formatted results for better context understanding
118
+ - `recent_activity(timeframe)` - View recently changed items with formatted output
119
+ - `json_canvas_spec()` - Full JSON Canvas specification for Obsidian visualization
120
+
121
+ ## AI-Human Collaborative Development
122
+
123
+ Basic Memory emerged from and enables a new kind of development process that combines human and AI capabilities. Instead
124
+ of using AI just for code generation, we've developed a true collaborative workflow:
125
+
126
+ 1. AI (LLM) writes initial implementation based on specifications and context
127
+ 2. Human reviews, runs tests, and commits code with any necessary adjustments
128
+ 3. Knowledge persists across conversations using Basic Memory's knowledge graph
129
+ 4. Development continues seamlessly across different AI sessions with consistent context
130
+ 5. Results improve through iterative collaboration and shared understanding
131
+
132
+ This approach has allowed us to tackle more complex challenges and build a more robust system than either humans or AI
133
+ could achieve independently.
@@ -0,0 +1,159 @@
1
+ # Contributing to Basic Memory
2
+
3
+ Thank you for considering contributing to Basic Memory! This document outlines the process for contributing to the project and how to get started as a developer.
4
+
5
+ ## Getting Started
6
+
7
+ ### Development Environment
8
+
9
+ 1. **Clone the Repository**:
10
+ ```bash
11
+ git clone https://github.com/basicmachines-co/basic-memory.git
12
+ cd basic-memory
13
+ ```
14
+
15
+ 2. **Install Dependencies**:
16
+ ```bash
17
+ # Using make (recommended)
18
+ make install
19
+
20
+ # Or using uv
21
+ uv install -e ".[dev]"
22
+
23
+ # Or using pip
24
+ pip install -e ".[dev]"
25
+ ```
26
+
27
+ 3. **Run the Tests**:
28
+ ```bash
29
+ # Run all tests
30
+ make test
31
+ # or
32
+ uv run pytest -p pytest_mock -v
33
+
34
+ # Run a specific test
35
+ pytest tests/path/to/test_file.py::test_function_name
36
+ ```
37
+
38
+ ### Development Workflow
39
+
40
+ 1. **Fork the Repo**: Fork the repository on GitHub and clone your copy.
41
+ 2. **Create a Branch**: Create a new branch for your feature or fix.
42
+ ```bash
43
+ git checkout -b feature/your-feature-name
44
+ # or
45
+ git checkout -b fix/issue-you-are-fixing
46
+ ```
47
+ 3. **Make Your Changes**: Implement your changes with appropriate test coverage.
48
+ 4. **Check Code Quality**:
49
+ ```bash
50
+ # Run all checks at once
51
+ make check
52
+
53
+ # Or run individual checks
54
+ make lint # Run linting
55
+ make format # Format code
56
+ make type-check # Type checking
57
+ ```
58
+ 5. **Test Your Changes**: Ensure all tests pass locally and maintain 100% test coverage.
59
+ ```bash
60
+ make test
61
+ ```
62
+ 6. **Submit a PR**: Submit a pull request with a detailed description of your changes.
63
+
64
+ ## LLM-Assisted Development
65
+
66
+ This project is designed for collaborative development between humans and LLMs (Large Language Models):
67
+
68
+ 1. **CLAUDE.md**: The repository includes a `CLAUDE.md` file that serves as a project guide for both humans and LLMs. This file contains:
69
+ - Key project information and architectural overview
70
+ - Development commands and workflows
71
+ - Code style guidelines
72
+ - Documentation standards
73
+
74
+ 2. **AI-Human Collaborative Workflow**:
75
+ - We encourage using LLMs like Claude for code generation, reviews, and documentation
76
+ - When possible, save context in markdown files that can be referenced later
77
+ - This enables seamless knowledge transfer between different development sessions
78
+ - Claude can help with implementation details while you focus on architecture and design
79
+
80
+ 3. **Adding to CLAUDE.md**:
81
+ - If you discover useful project information or common commands, consider adding them to CLAUDE.md
82
+ - This helps all contributors (human and AI) maintain consistent knowledge of the project
83
+
84
+ ## Pull Request Process
85
+
86
+ 1. **Create a Pull Request**: Open a PR against the `main` branch with a clear title and description.
87
+ 2. **Sign the Developer Certificate of Origin (DCO)**: All contributions require signing our DCO, which certifies that you have the right to submit your contributions. This will be automatically checked by our CLA assistant when you create a PR.
88
+ 3. **PR Description**: Include:
89
+ - What the PR changes
90
+ - Why the change is needed
91
+ - How you tested the changes
92
+ - Any related issues (use "Fixes #123" to automatically close issues)
93
+ 4. **Code Review**: Wait for code review and address any feedback.
94
+ 5. **CI Checks**: Ensure all CI checks pass.
95
+ 6. **Merge**: Once approved, a maintainer will merge your PR.
96
+
97
+ ## Developer Certificate of Origin
98
+
99
+ By contributing to this project, you agree to the [Developer Certificate of Origin (DCO)](CLA.md). This means you certify that:
100
+ - You have the right to submit your contributions
101
+ - You're not knowingly submitting code with patent or copyright issues
102
+ - Your contributions are provided under the project's license (AGPL-3.0)
103
+
104
+ This is a lightweight alternative to a Contributor License Agreement and helps ensure that all contributions can be properly incorporated into the project and potentially used in commercial applications.
105
+
106
+ ### Signing Your Commits
107
+
108
+ You can sign your commits in one of two ways:
109
+
110
+ 1. **Using the `-s` or `--signoff` flag**:
111
+ ```bash
112
+ git commit -s -m "Your commit message"
113
+ ```
114
+ This adds a `Signed-off-by` line to your commit message, certifying that you adhere to the DCO.
115
+
116
+ 2. **Configuring Git to automatically sign off**:
117
+ ```bash
118
+ git config --global alias.cs 'commit -s'
119
+ ```
120
+ Then use `git cs -m "Your commit message"` to commit with sign-off.
121
+
122
+ The sign-off certifies that you have the right to submit your contribution under the project's license and verifies your agreement to the DCO.
123
+
124
+ ## Code Style Guidelines
125
+
126
+ - **Python Version**: Python 3.12+ with full type annotations
127
+ - **Line Length**: 100 characters maximum
128
+ - **Formatting**: Use ruff for consistent styling
129
+ - **Import Order**: Standard lib, third-party, local imports
130
+ - **Naming**: Use snake_case for functions/variables, PascalCase for classes
131
+ - **Documentation**: Add docstrings to public functions, classes, and methods
132
+ - **Type Annotations**: Use type hints for all functions and methods
133
+
134
+ ## Testing Guidelines
135
+
136
+ - **Coverage Target**: We aim for 100% test coverage for all code
137
+ - **Test Framework**: Use pytest for unit and integration tests
138
+ - **Mocking**: Use pytest-mock for mocking dependencies
139
+ - **Edge Cases**: Test both normal operation and edge cases
140
+ - **Database Testing**: Use in-memory SQLite for testing database operations
141
+ - **Fixtures**: Use pytest fixtures for setup and teardown
142
+
143
+ ## Creating Issues
144
+
145
+ If you're planning to work on something, please create an issue first to discuss the approach. Include:
146
+
147
+ - A clear title and description
148
+ - Steps to reproduce if reporting a bug
149
+ - Expected behavior vs. actual behavior
150
+ - Any relevant logs or screenshots
151
+ - Your proposed solution, if you have one
152
+
153
+ ## Code of Conduct
154
+
155
+ All contributors must follow the [Code of Conduct](CODE_OF_CONDUCT.md).
156
+
157
+ ## Thank You!
158
+
159
+ Your contributions help make Basic Memory better for everyone. We appreciate your time and effort!
@@ -0,0 +1,67 @@
1
+ .PHONY: install test test-module lint clean format type-check installer-mac installer-win check
2
+
3
+ install:
4
+ pip install -e ".[dev]"
5
+
6
+ test:
7
+ uv run pytest -p pytest_mock -v
8
+
9
+ # Run tests for a specific module
10
+ # Usage: make test-module m=path/to/module.py [cov=module_path]
11
+ test-module:
12
+ @if [ -z "$(m)" ]; then \
13
+ echo "Usage: make test-module m=path/to/module.py [cov=module_path]"; \
14
+ exit 1; \
15
+ fi; \
16
+ if [ -z "$(cov)" ]; then \
17
+ uv run pytest $(m) -v; \
18
+ else \
19
+ uv run pytest $(m) -v --cov=$(cov); \
20
+ fi
21
+
22
+ lint:
23
+ ruff check . --fix
24
+
25
+ type-check:
26
+ uv run pyright
27
+
28
+ clean:
29
+ find . -type f -name '*.pyc' -delete
30
+ find . -type d -name '__pycache__' -exec rm -r {} +
31
+ rm -rf installer/build/
32
+ rm -rf installer/dist/
33
+ rm -f rw.*.dmg
34
+ rm -rf dist
35
+ rm -rf installer/build
36
+ rm -rf installer/dist
37
+ rm -f .coverage.*
38
+
39
+ format:
40
+ uv run ruff format .
41
+
42
+ # run inspector tool
43
+ run-inspector:
44
+ uv run mcp dev src/basic_memory/mcp/main.py
45
+
46
+ # Build app installer
47
+ installer-mac:
48
+ cd installer && chmod +x make_icons.sh && ./make_icons.sh
49
+ cd installer && uv run python setup.py bdist_mac
50
+
51
+ installer-win:
52
+ cd installer && uv run python setup.py bdist_win32
53
+
54
+
55
+ update-deps:
56
+ uv lock --upgrade
57
+
58
+ check: lint format type-check test
59
+
60
+
61
+ # Target for generating Alembic migrations with a message from command line
62
+ migration:
63
+ @if [ -z "$(m)" ]; then \
64
+ echo "Usage: make migration m=\"Your migration message\""; \
65
+ exit 1; \
66
+ fi; \
67
+ cd src/basic_memory/alembic && alembic revision --autogenerate -m "$(m)"