keep-skill 0.8.1__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.
keep/api.py CHANGED
@@ -534,13 +534,17 @@ class Keeper:
534
534
  summary: Optional[str] = None,
535
535
  source_tags: Optional[dict[str, str]] = None, # Deprecated alias
536
536
  collection: Optional[str] = None,
537
- lazy: bool = False
538
537
  ) -> Item:
539
538
  """
540
539
  Insert or update a document in the store.
541
540
 
542
541
  Fetches the document, generates embeddings and summary, then stores it.
543
542
 
543
+ **Summary behavior:**
544
+ - If summary is provided, use it (skips auto-summarization)
545
+ - For large content, summarization is async (truncated placeholder
546
+ stored immediately, real summary generated in background)
547
+
544
548
  **Update behavior:**
545
549
  - Summary: Replaced with user-provided or newly generated summary
546
550
  - Tags: Merged - existing tags are preserved, new tags override
@@ -553,9 +557,6 @@ class Keeper:
553
557
  summary: User-provided summary (skips auto-summarization if given)
554
558
  source_tags: Deprecated alias for 'tags'
555
559
  collection: Target collection (uses default if None)
556
- lazy: If True, use truncated placeholder summary and queue for
557
- background processing. Use `process_pending()` to generate
558
- real summaries later. Ignored if summary is provided.
559
560
 
560
561
  Returns:
561
562
  The stored Item with merged tags and new summary
@@ -615,17 +616,14 @@ class Keeper:
615
616
  )
616
617
  summary = summary[:max_len]
617
618
  final_summary = summary
618
- elif lazy:
619
- # Truncated placeholder for lazy mode
619
+ else:
620
+ # Large content: async summarization (truncated placeholder now, real summary later)
620
621
  if len(doc.content) > max_len:
621
622
  final_summary = doc.content[:max_len] + "..."
623
+ # Queue for background processing
624
+ self._pending_queue.enqueue(id, coll, doc.content)
622
625
  else:
623
626
  final_summary = doc.content
624
- # Queue for background processing
625
- self._pending_queue.enqueue(id, coll, doc.content)
626
- else:
627
- # Auto-generate summary
628
- final_summary = self._get_summarization_provider().summarize(doc.content)
629
627
 
630
628
  # Build tags: existing → config → env → user (later wins on collision)
631
629
  merged_tags = {**existing_tags}
@@ -686,8 +684,8 @@ class Keeper:
686
684
  tags=old_doc.tags,
687
685
  )
688
686
 
689
- # Spawn background processor if lazy (only if summary wasn't user-provided and content changed)
690
- if lazy and summary is None and not content_unchanged:
687
+ # Spawn background processor if content was queued (large content, no user summary, content changed)
688
+ if summary is None and len(doc.content) > max_len and not content_unchanged:
691
689
  self._spawn_processor()
692
690
 
693
691
  # Return the stored item
@@ -703,7 +701,6 @@ class Keeper:
703
701
  tags: Optional[dict[str, str]] = None,
704
702
  source_tags: Optional[dict[str, str]] = None, # Deprecated alias
705
703
  collection: Optional[str] = None,
706
- lazy: bool = False
707
704
  ) -> Item:
708
705
  """
709
706
  Store inline content directly (without fetching from a URI).
@@ -713,7 +710,8 @@ class Keeper:
713
710
  **Smart summary behavior:**
714
711
  - If summary is provided, use it (skips auto-summarization)
715
712
  - If content is short (≤ max_summary_length), use content verbatim
716
- - Otherwise, generate summary via summarization provider
713
+ - For large content, summarization is async (truncated placeholder
714
+ stored immediately, real summary generated in background)
717
715
 
718
716
  **Update behavior (when id already exists):**
719
717
  - Summary: Replaced with user-provided, content, or generated summary
@@ -728,9 +726,6 @@ class Keeper:
728
726
  tags: User-provided tags to merge with existing tags
729
727
  source_tags: Deprecated alias for 'tags'
730
728
  collection: Target collection (uses default if None)
731
- lazy: If True and content is long, use truncated placeholder summary
732
- and queue for background processing. Ignored if content is
733
- short or summary is provided.
734
729
 
735
730
  Returns:
736
731
  The stored Item with merged tags and new summary
@@ -794,14 +789,11 @@ class Keeper:
794
789
  elif len(content) <= max_len:
795
790
  # Content is short enough - use verbatim (smart summary)
796
791
  final_summary = content
797
- elif lazy:
798
- # Content is long and lazy mode - truncated placeholder
792
+ else:
793
+ # Content is long - async summarization (truncated placeholder now, real summary later)
799
794
  final_summary = content[:max_len] + "..."
800
795
  # Queue for background processing
801
796
  self._pending_queue.enqueue(id, coll, content)
802
- else:
803
- # Content is long - generate summary
804
- final_summary = self._get_summarization_provider().summarize(content)
805
797
 
806
798
  # Build tags: existing → config → env → user (later wins on collision)
807
799
  merged_tags = {**existing_tags}
@@ -860,8 +852,8 @@ class Keeper:
860
852
  tags=old_doc.tags,
861
853
  )
862
854
 
863
- # Spawn background processor if lazy and content was queued (only if content changed)
864
- if lazy and summary is None and len(content) > max_len and not content_unchanged:
855
+ # Spawn background processor if content was queued (large content, no user summary, content changed)
856
+ if summary is None and len(content) > max_len and not content_unchanged:
865
857
  self._spawn_processor()
866
858
 
867
859
  # Return the stored item
@@ -1366,14 +1358,14 @@ class Keeper:
1366
1358
 
1367
1359
  def get_now(self) -> Item:
1368
1360
  """
1369
- Get the current working context.
1361
+ Get the current working intentions.
1370
1362
 
1371
1363
  A singleton document representing what you're currently working on.
1372
1364
  If it doesn't exist, creates one with default content and tags from
1373
1365
  the bundled system now.md file.
1374
1366
 
1375
1367
  Returns:
1376
- The current context Item (never None - auto-creates if missing)
1368
+ The current intentions Item (never None - auto-creates if missing)
1377
1369
  """
1378
1370
  item = self.get(NOWDOC_ID)
1379
1371
  if item is None:
@@ -1394,13 +1386,13 @@ class Keeper:
1394
1386
  tags: Optional[dict[str, str]] = None,
1395
1387
  ) -> Item:
1396
1388
  """
1397
- Set the current working context.
1389
+ Set the current working intentions.
1398
1390
 
1399
- Updates the singleton context with new content. Uses remember()
1391
+ Updates the singleton intentions with new content. Uses remember()
1400
1392
  internally with the fixed NOWDOC_ID.
1401
1393
 
1402
1394
  Args:
1403
- content: New content for the current context
1395
+ content: New content for the current intentions
1404
1396
  tags: Optional additional tags to apply
1405
1397
 
1406
1398
  Returns:
keep/cli.py CHANGED
@@ -251,7 +251,7 @@ def main_callback(
251
251
  )] = None,
252
252
  ):
253
253
  """Reflective memory with semantic search."""
254
- # If no subcommand provided, show the current context (now)
254
+ # If no subcommand provided, show the current intentions (now)
255
255
  if ctx.invoked_subcommand is None:
256
256
  from .api import NOWDOC_ID
257
257
  kp = _get_keeper(None, "default")
@@ -683,10 +683,6 @@ def update(
683
683
  "--summary",
684
684
  help="User-provided summary (skips auto-summarization)"
685
685
  )] = None,
686
- lazy: Annotated[bool, typer.Option(
687
- "--lazy",
688
- help="Fast mode: use truncated summary, queue for later processing"
689
- )] = False,
690
686
  ):
691
687
  """
692
688
  Add or update a document in the store.
@@ -715,15 +711,15 @@ def update(
715
711
  parsed_tags = {**frontmatter_tags, **parsed_tags} # CLI tags override
716
712
  # Use content-addressed ID for stdin text (enables versioning)
717
713
  doc_id = id or _text_content_id(content)
718
- item = kp.remember(content, id=doc_id, summary=summary, tags=parsed_tags or None, lazy=lazy)
714
+ item = kp.remember(content, id=doc_id, summary=summary, tags=parsed_tags or None)
719
715
  elif source and _URI_SCHEME_PATTERN.match(source):
720
716
  # URI mode: fetch from URI (ID is the URI itself)
721
- item = kp.update(source, tags=parsed_tags or None, summary=summary, lazy=lazy)
717
+ item = kp.update(source, tags=parsed_tags or None, summary=summary)
722
718
  elif source:
723
719
  # Text mode: inline content (no :// in source)
724
720
  # Use content-addressed ID for text (enables versioning)
725
721
  doc_id = id or _text_content_id(source)
726
- item = kp.remember(source, id=doc_id, summary=summary, tags=parsed_tags or None, lazy=lazy)
722
+ item = kp.remember(source, id=doc_id, summary=summary, tags=parsed_tags or None)
727
723
  else:
728
724
  typer.echo("Error: Provide content, URI, or '-' for stdin", err=True)
729
725
  raise typer.Exit(1)
@@ -760,15 +756,15 @@ def now(
760
756
  )] = None,
761
757
  ):
762
758
  """
763
- Get or set the current working context.
759
+ Get or set the current working intentions.
764
760
 
765
- With no arguments, displays the current context.
761
+ With no arguments, displays the current intentions.
766
762
  With content, replaces it.
767
763
 
768
764
  \b
769
765
  Examples:
770
- keep now # Show current context
771
- keep now "What's important now" # Update context
766
+ keep now # Show current intentions
767
+ keep now "What's important now" # Update intentions
772
768
  keep now -f context.md # Read content from file
773
769
  keep now --reset # Reset to default from system
774
770
  keep now -V 1 # Previous version
@@ -891,7 +887,7 @@ def now(
891
887
  item = kp.set_now(new_content, tags=parsed_tags or None)
892
888
  typer.echo(_format_item(item, as_json=_get_json_output()))
893
889
  else:
894
- # Get current context with version navigation and similar items
890
+ # Get current intentions with version navigation and similar items
895
891
  item = kp.get_now()
896
892
  version_nav = kp.get_version_nav(NOWDOC_ID, None, collection=collection)
897
893
  similar_items = kp.get_similar_for_display(NOWDOC_ID, limit=3, collection=collection)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: keep-skill
3
- Version: 0.8.1
3
+ Version: 0.9.0
4
4
  Summary: Reflective memory - remember and search documents by meaning
5
5
  Project-URL: Homepage, https://github.com/hughpyle/keep
6
6
  Project-URL: Repository, https://github.com/hughpyle/keep
@@ -68,7 +68,7 @@ keep find "what's the rate limit?"
68
68
 
69
69
  # Track what you're working on
70
70
  keep now "Debugging auth flow"
71
- keep now -V 1 # Previous context
71
+ keep now -V 1 # Previous intentions
72
72
  ```
73
73
 
74
74
  ---
@@ -131,9 +131,9 @@ keep get ID --history # All versions
131
131
  keep list --tag project=myapp # Find by tag
132
132
  keep list --tags= # List all tag keys
133
133
 
134
- # Current context
134
+ # Current intentions
135
135
  keep now # Show what you're working on
136
- keep now "Fixing login bug" # Update context
136
+ keep now "Fixing login bug" # Update intentions
137
137
  ```
138
138
 
139
139
  ### Python API
@@ -1,8 +1,8 @@
1
1
  keep/__init__.py,sha256=yBK7jvbQmx9fRBGanICNgrQdyCQHzt5bNPp098Qvh9E,1621
2
2
  keep/__main__.py,sha256=3Uu70IhIDIjh8OW6jp9jQQ3dF2lKdJWi_3FtRIQMiMY,104
3
- keep/api.py,sha256=V_w4ahhgmgk10ehjs5JAvTct8wOvL8xsvW-nko_9Yjw,64858
3
+ keep/api.py,sha256=3DHqgIsX7Fu6SwpxHwOnCA5ao0S9DlPschfK4WlN_Hs,64538
4
4
  keep/chunking.py,sha256=neAXOLSvVwbUxapbqq7nZrbSNSzMXuhxj-ODoOSodsU,11830
5
- keep/cli.py,sha256=SAB4LEZrX08sDVBxYD1s_zo2WXTYJBwhZswlQdjVkQ8,46024
5
+ keep/cli.py,sha256=m3yokiLUbz1SWUD2IQEhI1WieY3IKVdpLV-f8Nd-BP8,45859
6
6
  keep/config.py,sha256=hWjiJDg2u6p8IJpksXe0ngVxQNcKHKRFKUDJQBFlG7I,16226
7
7
  keep/context.py,sha256=CNpjmrv6eW2kV1E0MO6qAQfhYKRlfzAL--6v4Mj1nFY,71
8
8
  keep/document_store.py,sha256=UswqKIGSc5E-r7Tg9k0g5-byYnuar3e9FieQ7WNod9k,29109
@@ -26,8 +26,8 @@ keep/providers/embeddings.py,sha256=zi8GyitKexdbCJyU1nLrUhGt_zzPn3udYrrPZ5Ak8Wo,
26
26
  keep/providers/llm.py,sha256=BxROKOklKbkGsHcSADPNNgWQExgSN6Bg4KPQIxVuB3U,12441
27
27
  keep/providers/mlx.py,sha256=aNl00r9tGi5tCGj2ArYH7CmDHtL1jLjVzb1rofU1DAo,9050
28
28
  keep/providers/summarization.py,sha256=MlVTcYipaqp2lT-QYnznp0AMuPVG36QfcTQnvY7Gb-Q,3409
29
- keep_skill-0.8.1.dist-info/METADATA,sha256=ClBi2sP1kofuCjyjM1UsO8Yo_ouw-XxhLPIpMyDcVjE,6042
30
- keep_skill-0.8.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
31
- keep_skill-0.8.1.dist-info/entry_points.txt,sha256=W8yiI4kNeW0IC8ji4EHRWrvdhFxzaqTIePUhJAJAMOo,39
32
- keep_skill-0.8.1.dist-info/licenses/LICENSE,sha256=zsm0tpvtyUkevcjn5BIvs9jAho8iwxq3Ax9647AaOSg,1086
33
- keep_skill-0.8.1.dist-info/RECORD,,
29
+ keep_skill-0.9.0.dist-info/METADATA,sha256=nzvsFdQRS659llg52q-GkZv9CPKF9jX9hx-cP5i-c6k,6051
30
+ keep_skill-0.9.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
31
+ keep_skill-0.9.0.dist-info/entry_points.txt,sha256=W8yiI4kNeW0IC8ji4EHRWrvdhFxzaqTIePUhJAJAMOo,39
32
+ keep_skill-0.9.0.dist-info/licenses/LICENSE,sha256=zsm0tpvtyUkevcjn5BIvs9jAho8iwxq3Ax9647AaOSg,1086
33
+ keep_skill-0.9.0.dist-info/RECORD,,