npcsh 1.1.17__tar.gz → 1.1.18__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 (155) hide show
  1. {npcsh-1.1.17/npcsh.egg-info → npcsh-1.1.18}/PKG-INFO +90 -1
  2. {npcsh-1.1.17 → npcsh-1.1.18}/README.md +89 -0
  3. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/_state.py +114 -91
  4. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/alicanto.py +2 -2
  5. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/benchmark/__init__.py +8 -2
  6. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/benchmark/npcsh_agent.py +46 -12
  7. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/benchmark/runner.py +85 -43
  8. npcsh-1.1.18/npcsh/benchmark/templates/install-npcsh.sh.j2 +35 -0
  9. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/build.py +2 -4
  10. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/completion.py +2 -6
  11. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/config.py +1 -3
  12. npcsh-1.1.18/npcsh/conversation_viewer.py +389 -0
  13. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/corca.py +0 -1
  14. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/execution.py +0 -1
  15. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/guac.py +0 -1
  16. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/mcp_helpers.py +2 -3
  17. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/mcp_server.py +5 -10
  18. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc.py +10 -11
  19. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/benchmark.jinx +1 -1
  20. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/db_search.jinx +348 -0
  21. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/file_search.jinx +339 -0
  22. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/kg_search.jinx +418 -0
  23. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/mem_review.jinx +73 -0
  24. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/mem_search.jinx +388 -0
  25. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/search/web_search.jinx +283 -0
  26. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/sleep.jinx +22 -11
  27. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/core/sql.jinx +20 -0
  28. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/research/paper_search.jinx +412 -0
  29. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/research/semantic_scholar.jinx +386 -0
  30. npcsh-1.1.18/npcsh/npc_team/jinxs/lib/utils/jinxs.jinx +331 -0
  31. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/alicanto.jinx +356 -0
  32. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/arxiv.jinx +720 -0
  33. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/corca.jinx +430 -0
  34. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/guac.jinx +544 -0
  35. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/plonk.jinx +379 -0
  36. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/pti.jinx +357 -0
  37. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/reattach.jinx +291 -0
  38. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/spool.jinx +350 -0
  39. npcsh-1.1.18/npcsh/npc_team/jinxs/modes/wander.jinx +455 -0
  40. {npcsh-1.1.17/npcsh/npc_team/jinxs/bin → npcsh-1.1.18/npcsh/npc_team/jinxs/modes}/yap.jinx +13 -7
  41. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npcsh.py +7 -4
  42. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/plonk.py +0 -1
  43. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/pti.py +0 -1
  44. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/routes.py +1 -3
  45. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/spool.py +0 -1
  46. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/ui.py +0 -1
  47. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/wander.py +0 -1
  48. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/yap.py +0 -1
  49. {npcsh-1.1.17 → npcsh-1.1.18/npcsh.egg-info}/PKG-INFO +90 -1
  50. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh.egg-info/SOURCES.txt +15 -4
  51. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh.egg-info/entry_points.txt +0 -3
  52. {npcsh-1.1.17 → npcsh-1.1.18}/setup.py +1 -1
  53. npcsh-1.1.18/tests/test_config.py +48 -0
  54. npcsh-1.1.18/tests/test_jinxs.py +58 -0
  55. {npcsh-1.1.17 → npcsh-1.1.18}/tests/test_tool_routing.py +16 -3
  56. npcsh-1.1.17/npcsh/npc_team/jinxs/bin/spool.jinx +0 -161
  57. npcsh-1.1.17/npcsh/npc_team/jinxs/bin/wander.jinx +0 -242
  58. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/search/db_search.jinx +0 -44
  59. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/search/file_search.jinx +0 -94
  60. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/search/kg_search.jinx +0 -96
  61. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/search/mem_search.jinx +0 -80
  62. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/search/web_search.jinx +0 -51
  63. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/core/sql.jinx +0 -16
  64. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/research/arxiv.jinx +0 -76
  65. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/research/paper_search.jinx +0 -101
  66. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/research/semantic_scholar.jinx +0 -69
  67. npcsh-1.1.17/npcsh/npc_team/jinxs/lib/utils/jinxs.jinx +0 -176
  68. {npcsh-1.1.17 → npcsh-1.1.18}/LICENSE +0 -0
  69. {npcsh-1.1.17 → npcsh-1.1.18}/MANIFEST.in +0 -0
  70. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/__init__.py +0 -0
  71. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/alicanto.npc +0 -0
  72. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/alicanto.png +0 -0
  73. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/corca.npc +0 -0
  74. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/corca.png +0 -0
  75. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/corca_example.png +0 -0
  76. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/frederic.npc +0 -0
  77. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/frederic4.png +0 -0
  78. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/guac.npc +0 -0
  79. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/guac.png +0 -0
  80. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/nql.jinx +0 -0
  81. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/roll.jinx +0 -0
  82. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/sample.jinx +0 -0
  83. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/sync.jinx +0 -0
  84. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/bin/vixynt.jinx +0 -0
  85. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/add_tab.jinx +0 -0
  86. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/close_pane.jinx +0 -0
  87. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/close_tab.jinx +0 -0
  88. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/confirm.jinx +0 -0
  89. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/focus_pane.jinx +0 -0
  90. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/incognide.jinx +0 -0
  91. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/list_panes.jinx +0 -0
  92. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/navigate.jinx +0 -0
  93. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/notify.jinx +0 -0
  94. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/open_pane.jinx +0 -0
  95. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/read_pane.jinx +0 -0
  96. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/run_terminal.jinx +0 -0
  97. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/send_message.jinx +0 -0
  98. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/split_pane.jinx +0 -0
  99. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/switch_npc.jinx +0 -0
  100. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/switch_tab.jinx +0 -0
  101. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/write_file.jinx +0 -0
  102. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/incognide/zen_mode.jinx +0 -0
  103. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/browser/browser_action.jinx +0 -0
  104. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/browser/browser_screenshot.jinx +0 -0
  105. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/browser/close_browser.jinx +0 -0
  106. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/browser/open_browser.jinx +0 -0
  107. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/click.jinx +0 -0
  108. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/key_press.jinx +0 -0
  109. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/launch_app.jinx +0 -0
  110. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/screenshot.jinx +0 -0
  111. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/trigger.jinx +0 -0
  112. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/type_text.jinx +0 -0
  113. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/computer_use/wait.jinx +0 -0
  114. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/chat.jinx +0 -0
  115. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/cmd.jinx +0 -0
  116. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/compress.jinx +0 -0
  117. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/edit_file.jinx +0 -0
  118. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/load_file.jinx +0 -0
  119. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/ots.jinx +0 -0
  120. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/paste.jinx +0 -0
  121. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/python.jinx +0 -0
  122. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/search.jinx +0 -0
  123. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/core/sh.jinx +0 -0
  124. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/orchestration/convene.jinx +0 -0
  125. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/orchestration/delegate.jinx +0 -0
  126. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/build.jinx +0 -0
  127. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/compile.jinx +0 -0
  128. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/help.jinx +0 -0
  129. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/init.jinx +0 -0
  130. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/serve.jinx +0 -0
  131. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/set.jinx +0 -0
  132. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/shh.jinx +0 -0
  133. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/switch.jinx +0 -0
  134. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/switches.jinx +0 -0
  135. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/teamviz.jinx +0 -0
  136. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/usage.jinx +0 -0
  137. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/jinxs/lib/utils/verbose.jinx +0 -0
  138. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/kadiefa.npc +0 -0
  139. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/kadiefa.png +0 -0
  140. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/npcsh.ctx +0 -0
  141. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/npcsh_sibiji.png +0 -0
  142. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/plonk.npc +0 -0
  143. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/plonk.png +0 -0
  144. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/plonkjr.npc +0 -0
  145. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/plonkjr.png +0 -0
  146. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/sibiji.npc +0 -0
  147. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/sibiji.png +0 -0
  148. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/spool.png +0 -0
  149. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/npc_team/yap.png +0 -0
  150. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh/parsing.py +0 -0
  151. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh.egg-info/dependency_links.txt +0 -0
  152. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh.egg-info/requires.txt +0 -0
  153. {npcsh-1.1.17 → npcsh-1.1.18}/npcsh.egg-info/top_level.txt +0 -0
  154. {npcsh-1.1.17 → npcsh-1.1.18}/project/__init__.py +0 -0
  155. {npcsh-1.1.17 → npcsh-1.1.18}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: npcsh
3
- Version: 1.1.17
3
+ Version: 1.1.18
4
4
  Summary: npcsh is a command-line toolkit for using AI agents in novel ways.
5
5
  Home-page: https://github.com/NPC-Worldwide/npcsh
6
6
  Author: Christopher Agostino
@@ -596,6 +596,9 @@ npc vixynt "a sunset over mountains"
596
596
  | `/teamviz` | Visualize team structure. Usage: `/teamviz save=output.png` |
597
597
  | `/ots` | Screenshot analysis. Usage: `/ots` then select area |
598
598
  | `/sleep` | Evolve knowledge graph. Usage: `/sleep --ops link_facts,deepen` |
599
+ | `/kg_search` | Search knowledge graph with multiple modes. Usage: `/kg_search query mode=hybrid depth=2` |
600
+ | `/mem_search` | Search approved memories. Usage: `/mem_search query status=approved top_k=10` |
601
+ | `/mem_review` | Review pending memories interactively. Usage: `/mem_review limit=50` |
599
602
 
600
603
  ### System & Config
601
604
  | Command | Description |
@@ -626,6 +629,92 @@ npc vixynt "a sunset over mountains"
626
629
  --format (-f) | --num_frames (-num_f) | --sprovider (-s) |
627
630
  ```
628
631
 
632
+ ## Memory & Knowledge Graph
633
+
634
+ `npcsh` maintains a memory lifecycle system that allows agents to learn and grow from past interactions. Memories progress through stages and can be incorporated into a knowledge graph for advanced retrieval.
635
+
636
+ ### Memory Lifecycle
637
+
638
+ Memories are extracted from conversations and follow this lifecycle:
639
+
640
+ 1. **pending_approval** - New memories awaiting review
641
+ 2. **human-approved** - Approved and ready for KG integration
642
+ 3. **human-rejected** - Rejected (used as negative examples)
643
+ 4. **human-edited** - Modified by user before approval
644
+ 5. **skipped** - Deferred for later review
645
+
646
+ ### Memory Commands
647
+
648
+ ```bash
649
+ # Search through approved memories
650
+ /mem_search python # Keyword search
651
+ /mem_search python status=approved # Filter by status
652
+ /mem_search python top_k=20 # Limit results
653
+
654
+ # Review pending memories interactively
655
+ /mem_review # Review with default limit
656
+ /mem_review limit=50 # Review more at once
657
+ ```
658
+
659
+ ### Knowledge Graph
660
+
661
+ The knowledge graph stores facts and concepts extracted from approved memories, enabling semantic search and reasoning. Facts are linked to concepts, allowing traversal-based discovery.
662
+
663
+ ```bash
664
+ # Keyword search
665
+ /kg_search python # Simple keyword match
666
+
667
+ # Semantic similarity search
668
+ /kg_search python mode=embedding # Find semantically similar facts
669
+
670
+ # Graph traversal search
671
+ /kg_search python mode=link depth=3 # Traverse graph links
672
+
673
+ # Hybrid search (combines methods)
674
+ /kg_search python mode=all # All methods combined
675
+
676
+ # Explore concepts
677
+ /kg_search type=concepts # List all concepts
678
+ /kg_search concept="Machine Learning" # Explore a specific concept
679
+ ```
680
+
681
+ ### Knowledge Graph Evolution
682
+
683
+ The `/sleep` command evolves the knowledge graph through consolidation, abstraction, and creative synthesis:
684
+
685
+ ```bash
686
+ # Basic sleep (consolidation)
687
+ /sleep
688
+
689
+ # Import approved memories first, then evolve
690
+ /sleep backfill=true
691
+
692
+ # Dream mode - creative synthesis across domains
693
+ /sleep dream=true
694
+
695
+ # Combined backfill and dream
696
+ /sleep backfill=true dream=true
697
+
698
+ # Specific operations
699
+ /sleep ops=prune,deepen,abstract
700
+ ```
701
+
702
+ **Operations:**
703
+ - **prune** - Remove redundant or low-value facts
704
+ - **deepen** - Add detail to existing facts
705
+ - **abstract** - Create higher-level generalizations
706
+ - **link** - Connect related facts and concepts
707
+
708
+ ### Environment Variables
709
+
710
+ ```bash
711
+ # Enable/disable automatic KG building (default: enabled)
712
+ export NPCSH_BUILD_KG=1
713
+
714
+ # Database path
715
+ export NPCSH_DB_PATH=~/npcsh_history.db
716
+ ```
717
+
629
718
  ## Read the Docs
630
719
  To see more about how to use the jinxs and modes in the NPC Shell, read the docs at [npc-shell.readthedocs.io](https://npc-shell.readthedocs.io/en/latest/)
631
720
 
@@ -493,6 +493,9 @@ npc vixynt "a sunset over mountains"
493
493
  | `/teamviz` | Visualize team structure. Usage: `/teamviz save=output.png` |
494
494
  | `/ots` | Screenshot analysis. Usage: `/ots` then select area |
495
495
  | `/sleep` | Evolve knowledge graph. Usage: `/sleep --ops link_facts,deepen` |
496
+ | `/kg_search` | Search knowledge graph with multiple modes. Usage: `/kg_search query mode=hybrid depth=2` |
497
+ | `/mem_search` | Search approved memories. Usage: `/mem_search query status=approved top_k=10` |
498
+ | `/mem_review` | Review pending memories interactively. Usage: `/mem_review limit=50` |
496
499
 
497
500
  ### System & Config
498
501
  | Command | Description |
@@ -523,6 +526,92 @@ npc vixynt "a sunset over mountains"
523
526
  --format (-f) | --num_frames (-num_f) | --sprovider (-s) |
524
527
  ```
525
528
 
529
+ ## Memory & Knowledge Graph
530
+
531
+ `npcsh` maintains a memory lifecycle system that allows agents to learn and grow from past interactions. Memories progress through stages and can be incorporated into a knowledge graph for advanced retrieval.
532
+
533
+ ### Memory Lifecycle
534
+
535
+ Memories are extracted from conversations and follow this lifecycle:
536
+
537
+ 1. **pending_approval** - New memories awaiting review
538
+ 2. **human-approved** - Approved and ready for KG integration
539
+ 3. **human-rejected** - Rejected (used as negative examples)
540
+ 4. **human-edited** - Modified by user before approval
541
+ 5. **skipped** - Deferred for later review
542
+
543
+ ### Memory Commands
544
+
545
+ ```bash
546
+ # Search through approved memories
547
+ /mem_search python # Keyword search
548
+ /mem_search python status=approved # Filter by status
549
+ /mem_search python top_k=20 # Limit results
550
+
551
+ # Review pending memories interactively
552
+ /mem_review # Review with default limit
553
+ /mem_review limit=50 # Review more at once
554
+ ```
555
+
556
+ ### Knowledge Graph
557
+
558
+ The knowledge graph stores facts and concepts extracted from approved memories, enabling semantic search and reasoning. Facts are linked to concepts, allowing traversal-based discovery.
559
+
560
+ ```bash
561
+ # Keyword search
562
+ /kg_search python # Simple keyword match
563
+
564
+ # Semantic similarity search
565
+ /kg_search python mode=embedding # Find semantically similar facts
566
+
567
+ # Graph traversal search
568
+ /kg_search python mode=link depth=3 # Traverse graph links
569
+
570
+ # Hybrid search (combines methods)
571
+ /kg_search python mode=all # All methods combined
572
+
573
+ # Explore concepts
574
+ /kg_search type=concepts # List all concepts
575
+ /kg_search concept="Machine Learning" # Explore a specific concept
576
+ ```
577
+
578
+ ### Knowledge Graph Evolution
579
+
580
+ The `/sleep` command evolves the knowledge graph through consolidation, abstraction, and creative synthesis:
581
+
582
+ ```bash
583
+ # Basic sleep (consolidation)
584
+ /sleep
585
+
586
+ # Import approved memories first, then evolve
587
+ /sleep backfill=true
588
+
589
+ # Dream mode - creative synthesis across domains
590
+ /sleep dream=true
591
+
592
+ # Combined backfill and dream
593
+ /sleep backfill=true dream=true
594
+
595
+ # Specific operations
596
+ /sleep ops=prune,deepen,abstract
597
+ ```
598
+
599
+ **Operations:**
600
+ - **prune** - Remove redundant or low-value facts
601
+ - **deepen** - Add detail to existing facts
602
+ - **abstract** - Create higher-level generalizations
603
+ - **link** - Connect related facts and concepts
604
+
605
+ ### Environment Variables
606
+
607
+ ```bash
608
+ # Enable/disable automatic KG building (default: enabled)
609
+ export NPCSH_BUILD_KG=1
610
+
611
+ # Database path
612
+ export NPCSH_DB_PATH=~/npcsh_history.db
613
+ ```
614
+
526
615
  ## Read the Docs
527
616
  To see more about how to use the jinxs and modes in the NPC Shell, read the docs at [npc-shell.readthedocs.io](https://npc-shell.readthedocs.io/en/latest/)
528
617