hindsight-client 0.0.15__tar.gz → 0.0.17__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.
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/PKG-INFO +1 -1
- hindsight_client-0.0.17/hindsight_client/__init__.py +51 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client/hindsight_client.py +41 -48
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/pyproject.toml +1 -1
- hindsight_client-0.0.15/hindsight_client/__init__.py +0 -26
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/.gitignore +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/.openapi-generator/FILES +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/.openapi-generator/VERSION +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/.openapi-generator-ignore +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/README.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/__init__.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api/__init__.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api/default_api.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api/monitoring_api.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api_client.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/configuration.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/AddBackgroundRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BackgroundResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankListItem.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankListResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankProfileResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/Budget.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ChunkData.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ChunkIncludeOptions.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ChunkResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/CreateBankRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/DefaultApi.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/DeleteResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/DocumentResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityDetailResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityIncludeOptions.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityListItem.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityListResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityObservationResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityStateResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/GraphDataResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/HTTPValidationError.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/IncludeOptions.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ListDocumentsResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ListMemoryUnitsResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/MemoryItem.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/MetadataFilter.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/MonitoringApi.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/PersonalityTraits.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallResult.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectFact.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectIncludeOptions.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RetainRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RetainResponse.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/UpdatePersonalityRequest.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ValidationError.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ValidationErrorLocInner.md +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/exceptions.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/__init__.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/add_background_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/background_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/bank_list_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/bank_list_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/bank_profile_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/budget.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/chunk_data.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/chunk_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/chunk_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/create_bank_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/delete_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/document_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_detail_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_list_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_list_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_observation_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_state_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/graph_data_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/http_validation_error.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/list_documents_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/list_memory_units_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/memory_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/metadata_filter.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/personality_traits.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_result.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_fact.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/retain_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/retain_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/update_personality_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/validation_error.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/validation_error_loc_inner.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/rest.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/__init__.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_add_background_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_background_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_bank_list_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_bank_list_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_bank_profile_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_budget.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_chunk_data.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_chunk_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_chunk_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_create_bank_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_default_api.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_delete_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_document_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_detail_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_list_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_list_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_observation_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_entity_state_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_graph_data_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_http_validation_error.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_list_documents_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_list_memory_units_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_memory_item.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_metadata_filter.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_monitoring_api.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_personality_traits.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_recall_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_recall_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_recall_result.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_reflect_fact.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_reflect_include_options.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_reflect_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_reflect_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_retain_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_retain_response.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_update_personality_request.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_validation_error.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_validation_error_loc_inner.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/openapi-generator-config.yaml +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/tests/__init__.py +0 -0
- {hindsight_client-0.0.15 → hindsight_client-0.0.17}/tests/test_main_operations.py +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hindsight Client - Clean, pythonic wrapper for the Hindsight API.
|
|
3
|
+
|
|
4
|
+
This package provides a high-level interface for common Hindsight operations.
|
|
5
|
+
For advanced use cases, use the auto-generated API client directly.
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
```python
|
|
9
|
+
from hindsight_client import Hindsight
|
|
10
|
+
|
|
11
|
+
client = Hindsight(base_url="http://localhost:8888")
|
|
12
|
+
|
|
13
|
+
# Store a memory
|
|
14
|
+
result = client.retain(bank_id="alice", content="Alice loves AI")
|
|
15
|
+
print(result.success)
|
|
16
|
+
|
|
17
|
+
# Search memories
|
|
18
|
+
results = client.recall(bank_id="alice", query="What does Alice like?")
|
|
19
|
+
for r in results:
|
|
20
|
+
print(r.text)
|
|
21
|
+
|
|
22
|
+
# Generate contextual answer
|
|
23
|
+
answer = client.reflect(bank_id="alice", query="What are my interests?")
|
|
24
|
+
print(answer.text)
|
|
25
|
+
```
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from .hindsight_client import Hindsight
|
|
29
|
+
|
|
30
|
+
# Re-export response types for convenient access
|
|
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
|
|
34
|
+
from hindsight_client_api.models.reflect_response import ReflectResponse
|
|
35
|
+
from hindsight_client_api.models.reflect_fact import ReflectFact
|
|
36
|
+
from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse
|
|
37
|
+
from hindsight_client_api.models.bank_profile_response import BankProfileResponse
|
|
38
|
+
from hindsight_client_api.models.personality_traits import PersonalityTraits
|
|
39
|
+
|
|
40
|
+
__all__ = [
|
|
41
|
+
"Hindsight",
|
|
42
|
+
# Response types
|
|
43
|
+
"RetainResponse",
|
|
44
|
+
"RecallResponse",
|
|
45
|
+
"RecallResult",
|
|
46
|
+
"ReflectResponse",
|
|
47
|
+
"ReflectFact",
|
|
48
|
+
"ListMemoryUnitsResponse",
|
|
49
|
+
"BankProfileResponse",
|
|
50
|
+
"PersonalityTraits",
|
|
51
|
+
]
|
|
@@ -17,6 +17,12 @@ from hindsight_client_api.models import (
|
|
|
17
17
|
memory_item,
|
|
18
18
|
reflect_request,
|
|
19
19
|
)
|
|
20
|
+
from hindsight_client_api.models.retain_response import RetainResponse
|
|
21
|
+
from hindsight_client_api.models.recall_response import RecallResponse
|
|
22
|
+
from hindsight_client_api.models.recall_result import RecallResult
|
|
23
|
+
from hindsight_client_api.models.reflect_response import ReflectResponse
|
|
24
|
+
from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse
|
|
25
|
+
from hindsight_client_api.models.bank_profile_response import BankProfileResponse
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
def _run_async(coro):
|
|
@@ -86,7 +92,7 @@ class Hindsight:
|
|
|
86
92
|
context: Optional[str] = None,
|
|
87
93
|
document_id: Optional[str] = None,
|
|
88
94
|
metadata: Optional[Dict[str, str]] = None,
|
|
89
|
-
) ->
|
|
95
|
+
) -> RetainResponse:
|
|
90
96
|
"""
|
|
91
97
|
Store a single memory (simplified interface).
|
|
92
98
|
|
|
@@ -99,7 +105,7 @@ class Hindsight:
|
|
|
99
105
|
metadata: Optional user-defined metadata
|
|
100
106
|
|
|
101
107
|
Returns:
|
|
102
|
-
|
|
108
|
+
RetainResponse with success status
|
|
103
109
|
"""
|
|
104
110
|
return self.retain_batch(
|
|
105
111
|
bank_id=bank_id,
|
|
@@ -112,8 +118,8 @@ class Hindsight:
|
|
|
112
118
|
bank_id: str,
|
|
113
119
|
items: List[Dict[str, Any]],
|
|
114
120
|
document_id: Optional[str] = None,
|
|
115
|
-
|
|
116
|
-
) ->
|
|
121
|
+
retain_async: bool = False,
|
|
122
|
+
) -> RetainResponse:
|
|
117
123
|
"""
|
|
118
124
|
Store multiple memories in batch.
|
|
119
125
|
|
|
@@ -121,10 +127,10 @@ class Hindsight:
|
|
|
121
127
|
bank_id: The memory bank ID
|
|
122
128
|
items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata'
|
|
123
129
|
document_id: Optional document ID for grouping memories
|
|
124
|
-
|
|
130
|
+
retain_async: If True, process asynchronously in background (default: False)
|
|
125
131
|
|
|
126
132
|
Returns:
|
|
127
|
-
|
|
133
|
+
RetainResponse with success status and item count
|
|
128
134
|
"""
|
|
129
135
|
memory_items = [
|
|
130
136
|
memory_item.MemoryItem(
|
|
@@ -139,11 +145,10 @@ class Hindsight:
|
|
|
139
145
|
request_obj = retain_request.RetainRequest(
|
|
140
146
|
items=memory_items,
|
|
141
147
|
document_id=document_id,
|
|
142
|
-
async_=
|
|
148
|
+
async_=retain_async,
|
|
143
149
|
)
|
|
144
150
|
|
|
145
|
-
|
|
146
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
151
|
+
return _run_async(self._api.retain_memories(bank_id, request_obj))
|
|
147
152
|
|
|
148
153
|
def recall(
|
|
149
154
|
self,
|
|
@@ -152,7 +157,7 @@ class Hindsight:
|
|
|
152
157
|
types: Optional[List[str]] = None,
|
|
153
158
|
max_tokens: int = 4096,
|
|
154
159
|
budget: str = "mid",
|
|
155
|
-
) -> List[
|
|
160
|
+
) -> List[RecallResult]:
|
|
156
161
|
"""
|
|
157
162
|
Recall memories using semantic similarity.
|
|
158
163
|
|
|
@@ -164,7 +169,7 @@ class Hindsight:
|
|
|
164
169
|
budget: Budget level for recall - "low", "mid", or "high" (default: "mid")
|
|
165
170
|
|
|
166
171
|
Returns:
|
|
167
|
-
List of
|
|
172
|
+
List of RecallResult objects
|
|
168
173
|
"""
|
|
169
174
|
request_obj = recall_request.RecallRequest(
|
|
170
175
|
query=query,
|
|
@@ -175,10 +180,7 @@ class Hindsight:
|
|
|
175
180
|
)
|
|
176
181
|
|
|
177
182
|
response = _run_async(self._api.recall_memories(bank_id, request_obj))
|
|
178
|
-
|
|
179
|
-
if hasattr(response, 'results'):
|
|
180
|
-
return [r.to_dict() if hasattr(r, 'to_dict') else r for r in response.results]
|
|
181
|
-
return []
|
|
183
|
+
return response.results if hasattr(response, 'results') else []
|
|
182
184
|
|
|
183
185
|
def reflect(
|
|
184
186
|
self,
|
|
@@ -186,7 +188,7 @@ class Hindsight:
|
|
|
186
188
|
query: str,
|
|
187
189
|
budget: str = "low",
|
|
188
190
|
context: Optional[str] = None,
|
|
189
|
-
) ->
|
|
191
|
+
) -> ReflectResponse:
|
|
190
192
|
"""
|
|
191
193
|
Generate a contextual answer based on bank identity and memories.
|
|
192
194
|
|
|
@@ -197,7 +199,7 @@ class Hindsight:
|
|
|
197
199
|
context: Optional additional context
|
|
198
200
|
|
|
199
201
|
Returns:
|
|
200
|
-
|
|
202
|
+
ReflectResponse with answer text and optionally facts used
|
|
201
203
|
"""
|
|
202
204
|
request_obj = reflect_request.ReflectRequest(
|
|
203
205
|
query=query,
|
|
@@ -205,8 +207,7 @@ class Hindsight:
|
|
|
205
207
|
context=context,
|
|
206
208
|
)
|
|
207
209
|
|
|
208
|
-
|
|
209
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
210
|
+
return _run_async(self._api.reflect(bank_id, request_obj))
|
|
210
211
|
|
|
211
212
|
# Full-featured methods (expose more options)
|
|
212
213
|
|
|
@@ -221,7 +222,7 @@ class Hindsight:
|
|
|
221
222
|
query_timestamp: Optional[str] = None,
|
|
222
223
|
include_entities: bool = True,
|
|
223
224
|
max_entity_tokens: int = 500,
|
|
224
|
-
) ->
|
|
225
|
+
) -> RecallResponse:
|
|
225
226
|
"""
|
|
226
227
|
Recall memories with all options (full-featured).
|
|
227
228
|
|
|
@@ -237,7 +238,7 @@ class Hindsight:
|
|
|
237
238
|
max_entity_tokens: Maximum tokens for entity observations (default: 500)
|
|
238
239
|
|
|
239
240
|
Returns:
|
|
240
|
-
|
|
241
|
+
RecallResponse with results, optional entities, and optional trace
|
|
241
242
|
"""
|
|
242
243
|
from hindsight_client_api.models import include_options, entity_include_options
|
|
243
244
|
|
|
@@ -255,8 +256,7 @@ class Hindsight:
|
|
|
255
256
|
include=include_opts,
|
|
256
257
|
)
|
|
257
258
|
|
|
258
|
-
|
|
259
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
259
|
+
return _run_async(self._api.recall_memories(bank_id, request_obj))
|
|
260
260
|
|
|
261
261
|
def list_memories(
|
|
262
262
|
self,
|
|
@@ -265,16 +265,15 @@ class Hindsight:
|
|
|
265
265
|
search_query: Optional[str] = None,
|
|
266
266
|
limit: int = 100,
|
|
267
267
|
offset: int = 0,
|
|
268
|
-
) ->
|
|
268
|
+
) -> ListMemoryUnitsResponse:
|
|
269
269
|
"""List memory units with pagination."""
|
|
270
|
-
|
|
270
|
+
return _run_async(self._api.list_memories(
|
|
271
271
|
bank_id=bank_id,
|
|
272
272
|
type=type,
|
|
273
273
|
q=search_query,
|
|
274
274
|
limit=limit,
|
|
275
275
|
offset=offset,
|
|
276
276
|
))
|
|
277
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
278
277
|
|
|
279
278
|
def create_bank(
|
|
280
279
|
self,
|
|
@@ -282,7 +281,7 @@ class Hindsight:
|
|
|
282
281
|
name: Optional[str] = None,
|
|
283
282
|
background: Optional[str] = None,
|
|
284
283
|
personality: Optional[Dict[str, float]] = None,
|
|
285
|
-
) ->
|
|
284
|
+
) -> BankProfileResponse:
|
|
286
285
|
"""Create or update a memory bank."""
|
|
287
286
|
from hindsight_client_api.models import create_bank_request, personality_traits
|
|
288
287
|
|
|
@@ -296,8 +295,7 @@ class Hindsight:
|
|
|
296
295
|
personality=personality_obj,
|
|
297
296
|
)
|
|
298
297
|
|
|
299
|
-
|
|
300
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
298
|
+
return _run_async(self._api.create_or_update_bank(bank_id, request_obj))
|
|
301
299
|
|
|
302
300
|
# Async methods (native async, no _run_async wrapper)
|
|
303
301
|
|
|
@@ -306,8 +304,8 @@ class Hindsight:
|
|
|
306
304
|
bank_id: str,
|
|
307
305
|
items: List[Dict[str, Any]],
|
|
308
306
|
document_id: Optional[str] = None,
|
|
309
|
-
|
|
310
|
-
) ->
|
|
307
|
+
retain_async: bool = False,
|
|
308
|
+
) -> RetainResponse:
|
|
311
309
|
"""
|
|
312
310
|
Store multiple memories in batch (async).
|
|
313
311
|
|
|
@@ -315,10 +313,10 @@ class Hindsight:
|
|
|
315
313
|
bank_id: The memory bank ID
|
|
316
314
|
items: List of memory items with 'content' and optional 'timestamp', 'context', 'metadata'
|
|
317
315
|
document_id: Optional document ID for grouping memories
|
|
318
|
-
|
|
316
|
+
retain_async: If True, process asynchronously in background (default: False)
|
|
319
317
|
|
|
320
318
|
Returns:
|
|
321
|
-
|
|
319
|
+
RetainResponse with success status and item count
|
|
322
320
|
"""
|
|
323
321
|
memory_items = [
|
|
324
322
|
memory_item.MemoryItem(
|
|
@@ -333,11 +331,10 @@ class Hindsight:
|
|
|
333
331
|
request_obj = retain_request.RetainRequest(
|
|
334
332
|
items=memory_items,
|
|
335
333
|
document_id=document_id,
|
|
336
|
-
async_=
|
|
334
|
+
async_=retain_async,
|
|
337
335
|
)
|
|
338
336
|
|
|
339
|
-
|
|
340
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
337
|
+
return await self._api.retain_memories(bank_id, request_obj)
|
|
341
338
|
|
|
342
339
|
async def aretain(
|
|
343
340
|
self,
|
|
@@ -347,7 +344,7 @@ class Hindsight:
|
|
|
347
344
|
context: Optional[str] = None,
|
|
348
345
|
document_id: Optional[str] = None,
|
|
349
346
|
metadata: Optional[Dict[str, str]] = None,
|
|
350
|
-
) ->
|
|
347
|
+
) -> RetainResponse:
|
|
351
348
|
"""
|
|
352
349
|
Store a single memory (async).
|
|
353
350
|
|
|
@@ -360,7 +357,7 @@ class Hindsight:
|
|
|
360
357
|
metadata: Optional user-defined metadata
|
|
361
358
|
|
|
362
359
|
Returns:
|
|
363
|
-
|
|
360
|
+
RetainResponse with success status
|
|
364
361
|
"""
|
|
365
362
|
return await self.aretain_batch(
|
|
366
363
|
bank_id=bank_id,
|
|
@@ -375,7 +372,7 @@ class Hindsight:
|
|
|
375
372
|
types: Optional[List[str]] = None,
|
|
376
373
|
max_tokens: int = 4096,
|
|
377
374
|
budget: str = "mid",
|
|
378
|
-
) -> List[
|
|
375
|
+
) -> List[RecallResult]:
|
|
379
376
|
"""
|
|
380
377
|
Recall memories using semantic similarity (async).
|
|
381
378
|
|
|
@@ -387,7 +384,7 @@ class Hindsight:
|
|
|
387
384
|
budget: Budget level for recall - "low", "mid", or "high" (default: "mid")
|
|
388
385
|
|
|
389
386
|
Returns:
|
|
390
|
-
List of
|
|
387
|
+
List of RecallResult objects
|
|
391
388
|
"""
|
|
392
389
|
request_obj = recall_request.RecallRequest(
|
|
393
390
|
query=query,
|
|
@@ -398,10 +395,7 @@ class Hindsight:
|
|
|
398
395
|
)
|
|
399
396
|
|
|
400
397
|
response = await self._api.recall_memories(bank_id, request_obj)
|
|
401
|
-
|
|
402
|
-
if hasattr(response, 'results'):
|
|
403
|
-
return [r.to_dict() if hasattr(r, 'to_dict') else r for r in response.results]
|
|
404
|
-
return []
|
|
398
|
+
return response.results if hasattr(response, 'results') else []
|
|
405
399
|
|
|
406
400
|
async def areflect(
|
|
407
401
|
self,
|
|
@@ -409,7 +403,7 @@ class Hindsight:
|
|
|
409
403
|
query: str,
|
|
410
404
|
budget: str = "low",
|
|
411
405
|
context: Optional[str] = None,
|
|
412
|
-
) ->
|
|
406
|
+
) -> ReflectResponse:
|
|
413
407
|
"""
|
|
414
408
|
Generate a contextual answer based on bank identity and memories (async).
|
|
415
409
|
|
|
@@ -420,7 +414,7 @@ class Hindsight:
|
|
|
420
414
|
context: Optional additional context
|
|
421
415
|
|
|
422
416
|
Returns:
|
|
423
|
-
|
|
417
|
+
ReflectResponse with answer text and optionally facts used
|
|
424
418
|
"""
|
|
425
419
|
request_obj = reflect_request.ReflectRequest(
|
|
426
420
|
query=query,
|
|
@@ -428,5 +422,4 @@ class Hindsight:
|
|
|
428
422
|
context=context,
|
|
429
423
|
)
|
|
430
424
|
|
|
431
|
-
|
|
432
|
-
return response.to_dict() if hasattr(response, 'to_dict') else response
|
|
425
|
+
return await self._api.reflect(bank_id, request_obj)
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Hindsight Client - Clean, pythonic wrapper for the Hindsight API.
|
|
3
|
-
|
|
4
|
-
This package provides a high-level interface for common Hindsight operations.
|
|
5
|
-
For advanced use cases, use the auto-generated API client directly.
|
|
6
|
-
|
|
7
|
-
Example:
|
|
8
|
-
```python
|
|
9
|
-
from hindsight_client import Hindsight
|
|
10
|
-
|
|
11
|
-
client = Hindsight(base_url="http://localhost:8888")
|
|
12
|
-
|
|
13
|
-
# Store a memory
|
|
14
|
-
client.put(agent_id="alice", content="Alice loves AI")
|
|
15
|
-
|
|
16
|
-
# Search memories
|
|
17
|
-
results = client.search(agent_id="alice", query="What does Alice like?")
|
|
18
|
-
|
|
19
|
-
# Generate contextual answer
|
|
20
|
-
answer = client.think(agent_id="alice", query="What are my interests?")
|
|
21
|
-
```
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
from .hindsight_client import Hindsight
|
|
25
|
-
|
|
26
|
-
__all__ = ["Hindsight"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/api/monitoring_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BackgroundResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankListItem.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankListResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/BankProfileResponse.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ChunkIncludeOptions.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ChunkResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/CreateBankRequest.md
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/DeleteResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/DocumentResponse.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityListItem.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityListResponse.md
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/EntityStateResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/GraphDataResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/HTTPValidationError.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/IncludeOptions.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/MetadataFilter.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/MonitoringApi.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/PersonalityTraits.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallRequest.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RecallResult.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectFact.md
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectRequest.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ReflectResponse.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RetainRequest.md
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/RetainResponse.md
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/docs/ValidationError.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/bank_list_item.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/chunk_data.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/chunk_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/delete_response.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/document_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/entity_list_item.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/include_options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/memory_item.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/metadata_filter.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_request.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_response.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/recall_result.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_fact.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_request.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/reflect_response.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/retain_request.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/retain_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/models/validation_error.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_bank_list_item.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_budget.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_chunk_data.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_chunk_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_default_api.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_memory_item.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_monitoring_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_recall_request.py
RENAMED
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_recall_result.py
RENAMED
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_reflect_fact.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hindsight_client-0.0.15 → hindsight_client-0.0.17}/hindsight_client_api/test/test_retain_request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|