hindsight-client 0.1.3__tar.gz → 0.1.4__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 (138) hide show
  1. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/PKG-INFO +1 -1
  2. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client/__init__.py +49 -4
  3. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client/hindsight_client.py +19 -10
  4. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/pyproject.toml +1 -1
  5. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/.gitignore +0 -0
  6. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/.openapi-generator/FILES +0 -0
  7. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/.openapi-generator/VERSION +0 -0
  8. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/.openapi-generator-ignore +0 -0
  9. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/README.md +0 -0
  10. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/__init__.py +0 -0
  11. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/api/__init__.py +0 -0
  12. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/api/default_api.py +0 -0
  13. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/api/monitoring_api.py +0 -0
  14. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/api_client.py +0 -0
  15. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/api_response.py +0 -0
  16. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/configuration.py +0 -0
  17. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/AddBackgroundRequest.md +0 -0
  18. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/BackgroundResponse.md +0 -0
  19. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/BankListItem.md +0 -0
  20. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/BankListResponse.md +0 -0
  21. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/BankProfileResponse.md +0 -0
  22. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/Budget.md +0 -0
  23. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ChunkData.md +0 -0
  24. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ChunkIncludeOptions.md +0 -0
  25. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ChunkResponse.md +0 -0
  26. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/CreateBankRequest.md +0 -0
  27. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/DefaultApi.md +0 -0
  28. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/DeleteResponse.md +0 -0
  29. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/DispositionTraits.md +0 -0
  30. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/DocumentResponse.md +0 -0
  31. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityDetailResponse.md +0 -0
  32. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityIncludeOptions.md +0 -0
  33. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityListItem.md +0 -0
  34. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityListResponse.md +0 -0
  35. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityObservationResponse.md +0 -0
  36. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/EntityStateResponse.md +0 -0
  37. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/GraphDataResponse.md +0 -0
  38. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/HTTPValidationError.md +0 -0
  39. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/IncludeOptions.md +0 -0
  40. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ListDocumentsResponse.md +0 -0
  41. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ListMemoryUnitsResponse.md +0 -0
  42. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/MemoryItem.md +0 -0
  43. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/MonitoringApi.md +0 -0
  44. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/RecallRequest.md +0 -0
  45. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/RecallResponse.md +0 -0
  46. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/RecallResult.md +0 -0
  47. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ReflectFact.md +0 -0
  48. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ReflectIncludeOptions.md +0 -0
  49. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ReflectRequest.md +0 -0
  50. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ReflectResponse.md +0 -0
  51. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/RetainRequest.md +0 -0
  52. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/RetainResponse.md +0 -0
  53. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/UpdateDispositionRequest.md +0 -0
  54. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ValidationError.md +0 -0
  55. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/docs/ValidationErrorLocInner.md +0 -0
  56. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/exceptions.py +0 -0
  57. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/__init__.py +0 -0
  58. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/add_background_request.py +0 -0
  59. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/background_response.py +0 -0
  60. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/bank_list_item.py +0 -0
  61. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/bank_list_response.py +0 -0
  62. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/bank_profile_response.py +0 -0
  63. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/budget.py +0 -0
  64. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/chunk_data.py +0 -0
  65. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/chunk_include_options.py +0 -0
  66. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/chunk_response.py +0 -0
  67. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/create_bank_request.py +0 -0
  68. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/delete_response.py +0 -0
  69. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/disposition_traits.py +0 -0
  70. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/document_response.py +0 -0
  71. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_detail_response.py +0 -0
  72. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_include_options.py +0 -0
  73. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_list_item.py +0 -0
  74. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_list_response.py +0 -0
  75. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_observation_response.py +0 -0
  76. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/entity_state_response.py +0 -0
  77. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/graph_data_response.py +0 -0
  78. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/http_validation_error.py +0 -0
  79. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/include_options.py +0 -0
  80. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/list_documents_response.py +0 -0
  81. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/list_memory_units_response.py +0 -0
  82. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/memory_item.py +0 -0
  83. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/recall_request.py +0 -0
  84. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/recall_response.py +0 -0
  85. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/recall_result.py +0 -0
  86. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/reflect_fact.py +0 -0
  87. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/reflect_include_options.py +0 -0
  88. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/reflect_request.py +0 -0
  89. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/reflect_response.py +0 -0
  90. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/retain_request.py +0 -0
  91. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/retain_response.py +0 -0
  92. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/update_disposition_request.py +0 -0
  93. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/validation_error.py +0 -0
  94. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/models/validation_error_loc_inner.py +0 -0
  95. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/rest.py +0 -0
  96. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/__init__.py +0 -0
  97. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_add_background_request.py +0 -0
  98. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_background_response.py +0 -0
  99. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_bank_list_item.py +0 -0
  100. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_bank_list_response.py +0 -0
  101. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_bank_profile_response.py +0 -0
  102. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_budget.py +0 -0
  103. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_chunk_data.py +0 -0
  104. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_chunk_include_options.py +0 -0
  105. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_chunk_response.py +0 -0
  106. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_create_bank_request.py +0 -0
  107. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_default_api.py +0 -0
  108. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_delete_response.py +0 -0
  109. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_disposition_traits.py +0 -0
  110. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_document_response.py +0 -0
  111. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_detail_response.py +0 -0
  112. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_include_options.py +0 -0
  113. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_list_item.py +0 -0
  114. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_list_response.py +0 -0
  115. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_observation_response.py +0 -0
  116. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_entity_state_response.py +0 -0
  117. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_graph_data_response.py +0 -0
  118. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_http_validation_error.py +0 -0
  119. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_include_options.py +0 -0
  120. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_list_documents_response.py +0 -0
  121. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_list_memory_units_response.py +0 -0
  122. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_memory_item.py +0 -0
  123. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_monitoring_api.py +0 -0
  124. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_recall_request.py +0 -0
  125. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_recall_response.py +0 -0
  126. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_recall_result.py +0 -0
  127. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_reflect_fact.py +0 -0
  128. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_reflect_include_options.py +0 -0
  129. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_reflect_request.py +0 -0
  130. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_reflect_response.py +0 -0
  131. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_retain_request.py +0 -0
  132. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_retain_response.py +0 -0
  133. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_update_disposition_request.py +0 -0
  134. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_validation_error.py +0 -0
  135. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/hindsight_client_api/test/test_validation_error_loc_inner.py +0 -0
  136. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/openapi-generator-config.yaml +0 -0
  137. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/tests/__init__.py +0 -0
  138. {hindsight_client-0.1.3 → hindsight_client-0.1.4}/tests/test_main_operations.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hindsight-client
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: Python client for Hindsight - Semantic memory system with personality-driven thinking
5
5
  Author: Hindsight Team
6
6
  Requires-Python: >=3.10
@@ -15,8 +15,8 @@ Example:
15
15
  print(result.success)
16
16
 
17
17
  # Search memories
18
- results = client.recall(bank_id="alice", query="What does Alice like?")
19
- for r in results:
18
+ response = client.recall(bank_id="alice", query="What does Alice like?")
19
+ for r in response.results:
20
20
  print(r.text)
21
21
 
22
22
  # Generate contextual answer
@@ -29,14 +29,59 @@ from .hindsight_client import Hindsight
29
29
 
30
30
  # Re-export response types for convenient access
31
31
  from hindsight_client_api.models.retain_response import RetainResponse
32
- from hindsight_client_api.models.recall_response import RecallResponse
33
- from hindsight_client_api.models.recall_result import RecallResult
32
+ from hindsight_client_api.models.recall_response import RecallResponse as _RecallResponse
33
+ from hindsight_client_api.models.recall_result import RecallResult as _RecallResult
34
34
  from hindsight_client_api.models.reflect_response import ReflectResponse
35
35
  from hindsight_client_api.models.reflect_fact import ReflectFact
36
36
  from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse
37
37
  from hindsight_client_api.models.bank_profile_response import BankProfileResponse
38
38
  from hindsight_client_api.models.disposition_traits import DispositionTraits
39
39
 
40
+
41
+ # Add cleaner __repr__ and __iter__ for REPL usability
42
+ def _recall_result_repr(self):
43
+ text_preview = self.text[:80] + "..." if len(self.text) > 80 else self.text
44
+ return f"RecallResult(id='{self.id[:8]}...', type='{self.type}', text='{text_preview}')"
45
+
46
+
47
+ def _recall_response_repr(self):
48
+ count = len(self.results) if self.results else 0
49
+ extras = []
50
+ if self.trace:
51
+ extras.append("trace=True")
52
+ if self.entities:
53
+ extras.append(f"entities={len(self.entities)}")
54
+ if self.chunks:
55
+ extras.append(f"chunks={len(self.chunks)}")
56
+ extras_str = ", " + ", ".join(extras) if extras else ""
57
+ return f"RecallResponse({count} results{extras_str})"
58
+
59
+
60
+ def _recall_response_iter(self):
61
+ """Iterate directly over results for convenience."""
62
+ return iter(self.results or [])
63
+
64
+
65
+ def _recall_response_len(self):
66
+ """Return number of results."""
67
+ return len(self.results) if self.results else 0
68
+
69
+
70
+ def _recall_response_getitem(self, index):
71
+ """Access results by index."""
72
+ return self.results[index]
73
+
74
+
75
+ _RecallResult.__repr__ = _recall_result_repr
76
+ _RecallResponse.__repr__ = _recall_response_repr
77
+ _RecallResponse.__iter__ = _recall_response_iter
78
+ _RecallResponse.__len__ = _recall_response_len
79
+ _RecallResponse.__getitem__ = _recall_response_getitem
80
+
81
+ # Re-export with patched repr
82
+ RecallResult = _RecallResult
83
+ RecallResponse = _RecallResponse
84
+
40
85
  __all__ = [
41
86
  "Hindsight",
42
87
  # Response types
@@ -50,7 +50,9 @@ class Hindsight:
50
50
  client.retain(bank_id="alice", content="Alice loves AI")
51
51
 
52
52
  # Recall memories
53
- results = client.recall(bank_id="alice", query="What does Alice like?")
53
+ response = client.recall(bank_id="alice", query="What does Alice like?")
54
+ for r in response.results:
55
+ print(r.text)
54
56
 
55
57
  # Generate contextual answer
56
58
  answer = client.reflect(bank_id="alice", query="What are my interests?")
@@ -125,8 +127,8 @@ class Hindsight:
125
127
 
126
128
  Args:
127
129
  bank_id: The memory bank ID
128
- items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata'
129
- document_id: Optional document ID for grouping memories
130
+ items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata', 'document_id'
131
+ document_id: Optional document ID for grouping memories (applied to items that don't have their own)
130
132
  retain_async: If True, process asynchronously in background (default: False)
131
133
 
132
134
  Returns:
@@ -138,13 +140,14 @@ class Hindsight:
138
140
  timestamp=item.get("timestamp"),
139
141
  context=item.get("context"),
140
142
  metadata=item.get("metadata"),
143
+ # Use item's document_id if provided, otherwise fall back to batch-level document_id
144
+ document_id=item.get("document_id") or document_id,
141
145
  )
142
146
  for item in items
143
147
  ]
144
148
 
145
149
  request_obj = retain_request.RetainRequest(
146
150
  items=memory_items,
147
- document_id=document_id,
148
151
  async_=retain_async,
149
152
  )
150
153
 
@@ -161,6 +164,8 @@ class Hindsight:
161
164
  query_timestamp: Optional[str] = None,
162
165
  include_entities: bool = False,
163
166
  max_entity_tokens: int = 500,
167
+ include_chunks: bool = False,
168
+ max_chunk_tokens: int = 8192,
164
169
  ) -> RecallResponse:
165
170
  """
166
171
  Recall memories using semantic similarity.
@@ -175,14 +180,17 @@ class Hindsight:
175
180
  query_timestamp: Optional ISO format date string (e.g., '2023-05-30T23:40:00')
176
181
  include_entities: Include entity observations in results (default: False)
177
182
  max_entity_tokens: Maximum tokens for entity observations (default: 500)
183
+ include_chunks: Include raw text chunks in results (default: False)
184
+ max_chunk_tokens: Maximum tokens for chunks (default: 8192)
178
185
 
179
186
  Returns:
180
- RecallResponse with results, optional entities, and optional trace
187
+ RecallResponse with results, optional entities, optional chunks, and optional trace
181
188
  """
182
- from hindsight_client_api.models import include_options, entity_include_options
189
+ from hindsight_client_api.models import include_options, entity_include_options, chunk_include_options
183
190
 
184
191
  include_opts = include_options.IncludeOptions(
185
- entities=entity_include_options.EntityIncludeOptions(max_tokens=max_entity_tokens) if include_entities else None
192
+ entities=entity_include_options.EntityIncludeOptions(max_tokens=max_entity_tokens) if include_entities else None,
193
+ chunks=chunk_include_options.ChunkIncludeOptions(max_tokens=max_chunk_tokens) if include_chunks else None,
186
194
  )
187
195
 
188
196
  request_obj = recall_request.RecallRequest(
@@ -277,8 +285,8 @@ class Hindsight:
277
285
 
278
286
  Args:
279
287
  bank_id: The memory bank ID
280
- items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata'
281
- document_id: Optional document ID for grouping memories
288
+ items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata', 'document_id'
289
+ document_id: Optional document ID for grouping memories (applied to items that don't have their own)
282
290
  retain_async: If True, process asynchronously in background (default: False)
283
291
 
284
292
  Returns:
@@ -290,13 +298,14 @@ class Hindsight:
290
298
  timestamp=item.get("timestamp"),
291
299
  context=item.get("context"),
292
300
  metadata=item.get("metadata"),
301
+ # Use item's document_id if provided, otherwise fall back to batch-level document_id
302
+ document_id=item.get("document_id") or document_id,
293
303
  )
294
304
  for item in items
295
305
  ]
296
306
 
297
307
  request_obj = retain_request.RetainRequest(
298
308
  items=memory_items,
299
- document_id=document_id,
300
309
  async_=retain_async,
301
310
  )
302
311
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hindsight-client"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "Python client for Hindsight - Semantic memory system with personality-driven thinking"
5
5
  authors = [
6
6
  {name = "Hindsight Team"}