From 4f21886a0e7ba6b147735ebf9b917ccf3f570192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Mon, 5 Jan 2026 12:36:29 +0100 Subject: [PATCH] doc: changelog for 0.2.0 (and regenerate clients) (#99) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) * doc: changelog for 0.2.0 (and regenerate clients) --- .github/workflows/test.yml | 74 +- hindsight-cli/src/commands/memory.rs | 2 + .../python/.openapi-generator/FILES | 49 +- .../python/.openapi-generator/VERSION | 2 +- .../python/hindsight_client_api/__init__.py | 177 +- .../python/hindsight_client_api/api_client.py | 19 +- .../hindsight_client_api/configuration.py | 19 +- .../docs/AddBackgroundRequest.md | 31 - .../docs/BackgroundResponse.md | 31 - .../hindsight_client_api/docs/BankListItem.md | 35 - .../docs/BankListResponse.md | 30 - .../docs/BankProfileResponse.md | 33 - .../docs/BankStatsResponse.md | 39 - .../hindsight_client_api/docs/BanksApi.md | 517 --- .../hindsight_client_api/docs/Budget.md | 15 - .../docs/CancelOperationResponse.md | 32 - .../hindsight_client_api/docs/ChunkData.md | 33 - .../docs/ChunkIncludeOptions.md | 30 - .../docs/ChunkResponse.md | 35 - .../docs/CreateBankRequest.md | 32 - .../docs/DeleteDocumentResponse.md | 33 - .../docs/DeleteResponse.md | 32 - .../docs/DispositionTraits.md | 32 - .../docs/DocumentResponse.md | 36 - .../hindsight_client_api/docs/DocumentsApi.md | 313 -- .../hindsight_client_api/docs/EntitiesApi.md | 230 -- .../docs/EntityDetailResponse.md | 36 - .../docs/EntityIncludeOptions.md | 30 - .../docs/EntityListItem.md | 35 - .../docs/EntityListResponse.md | 30 - .../docs/EntityObservationResponse.md | 31 - .../docs/EntityStateResponse.md | 32 - .../docs/GraphDataResponse.md | 33 - .../docs/HTTPValidationError.md | 29 - .../docs/IncludeOptions.md | 31 - .../docs/ListDocumentsResponse.md | 33 - .../docs/ListMemoryUnitsResponse.md | 33 - .../hindsight_client_api/docs/MemoryApi.md | 499 --- .../hindsight_client_api/docs/MemoryItem.md | 34 - .../docs/MonitoringApi.md | 136 - .../docs/OperationResponse.md | 36 - .../docs/OperationsApi.md | 154 - .../docs/OperationsListResponse.md | 31 - .../docs/RecallRequest.md | 36 - .../docs/RecallResponse.md | 33 - .../hindsight_client_api/docs/RecallResult.md | 40 - .../hindsight_client_api/docs/ReflectFact.md | 35 - .../docs/ReflectIncludeOptions.md | 30 - .../docs/ReflectRequest.md | 35 - .../docs/ReflectResponse.md | 32 - .../docs/RetainRequest.md | 31 - .../docs/RetainResponse.md | 33 - .../docs/UpdateDispositionRequest.md | 30 - .../docs/ValidationError.md | 31 - .../docs/ValidationErrorLocInner.md | 28 - .../python/hindsight_client_api/exceptions.py | 24 +- .../hindsight_client_api/models/__init__.py | 2 +- .../models/entity_input.py | 32 +- .../models/memory_item.py | 16 +- .../python/hindsight_client_api/rest.py | 110 +- .../python/openapi-generator-config.yaml | 4 +- hindsight-clients/rust/Cargo.lock | 93 +- hindsight-clients/rust/build.rs | 4 +- hindsight-clients/rust/src/lib.rs | 2 + .../typescript/generated/types.gen.ts | 26 + .../typescript/openapi-ts.config.ts | 2 +- .../hindsight_dev/generate_openapi.py | 4 +- hindsight-docs/docs/changelog/index.md | 21 + hindsight-docs/docusaurus.config.ts | 2 +- hindsight-docs/openapi.json | 3509 ----------------- hindsight-docs/static/openapi.json | 51 + openapi.json | 3509 ----------------- scripts/generate-clients.sh | 168 +- scripts/generate-openapi.sh | 5 - uv.lock | 10 +- 75 files changed, 564 insertions(+), 10578 deletions(-) delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/AddBackgroundRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BackgroundResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BankListItem.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BankListResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BankProfileResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BankStatsResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/BanksApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/Budget.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/CancelOperationResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ChunkData.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ChunkIncludeOptions.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ChunkResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/CreateBankRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/DeleteDocumentResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/DeleteResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/DispositionTraits.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/DocumentResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/DocumentsApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntitiesApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityDetailResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityIncludeOptions.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityListItem.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityListResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityObservationResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/EntityStateResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/GraphDataResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/HTTPValidationError.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/IncludeOptions.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ListDocumentsResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ListMemoryUnitsResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/MemoryApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/MemoryItem.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/MonitoringApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/OperationResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/OperationsApi.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/OperationsListResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/RecallRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/RecallResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/RecallResult.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ReflectFact.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ReflectIncludeOptions.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ReflectRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ReflectResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/RetainRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/RetainResponse.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/UpdateDispositionRequest.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ValidationError.md delete mode 100644 hindsight-clients/python/hindsight_client_api/docs/ValidationErrorLocInner.md delete mode 100644 hindsight-docs/openapi.json delete mode 100644 openapi.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a048b07..efa4b67b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -883,4 +883,76 @@ jobs: if: always() run: | echo "=== API Server Logs ===" - cat /tmp/api-server.log || echo "No API server log found" \ No newline at end of file + cat /tmp/api-server.log || echo "No API server log found" + + verify-generated-files: + runs-on: ubuntu-latest + env: + UV_INDEX: pytorch=https://download.pytorch.org/whl/cpu + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + with: + enable-cache: true + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: ".python-version" + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: package-lock.json + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-gen-${{ hashFiles('**/Cargo.lock') }} + + - name: Install Node dependencies + run: npm ci + + - name: Install Python dependencies + run: | + cd hindsight-dev && uv sync --index-strategy unsafe-best-match + cd ../hindsight-api && uv sync --index-strategy unsafe-best-match + cd ../hindsight-embed && uv sync --index-strategy unsafe-best-match + + - name: Run generate-openapi + run: ./scripts/generate-openapi.sh + + - name: Run generate-clients + run: ./scripts/generate-clients.sh + + - name: Run lint + run: ./scripts/hooks/lint.sh + + - name: Verify no uncommitted changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "❌ Error: Generated files are out of sync with committed files." + echo "" + echo "The following files have changed after running generation scripts:" + git status --porcelain + echo "" + echo "Please run the following commands locally and commit the changes:" + echo " ./scripts/generate-openapi.sh" + echo " ./scripts/generate-clients.sh" + echo " ./scripts/hooks/lint.sh" + echo "" + git diff --stat + exit 1 + fi + echo "✓ All generated files are up to date" \ No newline at end of file diff --git a/hindsight-cli/src/commands/memory.rs b/hindsight-cli/src/commands/memory.rs index c1d3995a..0b92a5f5 100644 --- a/hindsight-cli/src/commands/memory.rs +++ b/hindsight-cli/src/commands/memory.rs @@ -161,6 +161,7 @@ pub fn retain( metadata: None, timestamp: None, document_id: Some(doc_id.clone()), + entities: None, }; let request = RetainRequest { @@ -270,6 +271,7 @@ pub fn retain_files( metadata: None, timestamp: None, document_id: Some(doc_id), + entities: None, }); pb.inc(1); diff --git a/hindsight-clients/python/.openapi-generator/FILES b/hindsight-clients/python/.openapi-generator/FILES index 478ff38b..af6a82fc 100644 --- a/hindsight-clients/python/.openapi-generator/FILES +++ b/hindsight-clients/python/.openapi-generator/FILES @@ -9,54 +9,6 @@ hindsight_client_api/api/operations_api.py hindsight_client_api/api_client.py hindsight_client_api/api_response.py hindsight_client_api/configuration.py -hindsight_client_api/docs/AddBackgroundRequest.md -hindsight_client_api/docs/BackgroundResponse.md -hindsight_client_api/docs/BankListItem.md -hindsight_client_api/docs/BankListResponse.md -hindsight_client_api/docs/BankProfileResponse.md -hindsight_client_api/docs/BankStatsResponse.md -hindsight_client_api/docs/BanksApi.md -hindsight_client_api/docs/Budget.md -hindsight_client_api/docs/CancelOperationResponse.md -hindsight_client_api/docs/ChunkData.md -hindsight_client_api/docs/ChunkIncludeOptions.md -hindsight_client_api/docs/ChunkResponse.md -hindsight_client_api/docs/CreateBankRequest.md -hindsight_client_api/docs/DeleteDocumentResponse.md -hindsight_client_api/docs/DeleteResponse.md -hindsight_client_api/docs/DispositionTraits.md -hindsight_client_api/docs/DocumentResponse.md -hindsight_client_api/docs/DocumentsApi.md -hindsight_client_api/docs/EntitiesApi.md -hindsight_client_api/docs/EntityDetailResponse.md -hindsight_client_api/docs/EntityIncludeOptions.md -hindsight_client_api/docs/EntityListItem.md -hindsight_client_api/docs/EntityListResponse.md -hindsight_client_api/docs/EntityObservationResponse.md -hindsight_client_api/docs/EntityStateResponse.md -hindsight_client_api/docs/GraphDataResponse.md -hindsight_client_api/docs/HTTPValidationError.md -hindsight_client_api/docs/IncludeOptions.md -hindsight_client_api/docs/ListDocumentsResponse.md -hindsight_client_api/docs/ListMemoryUnitsResponse.md -hindsight_client_api/docs/MemoryApi.md -hindsight_client_api/docs/MemoryItem.md -hindsight_client_api/docs/MonitoringApi.md -hindsight_client_api/docs/OperationResponse.md -hindsight_client_api/docs/OperationsApi.md -hindsight_client_api/docs/OperationsListResponse.md -hindsight_client_api/docs/RecallRequest.md -hindsight_client_api/docs/RecallResponse.md -hindsight_client_api/docs/RecallResult.md -hindsight_client_api/docs/ReflectFact.md -hindsight_client_api/docs/ReflectIncludeOptions.md -hindsight_client_api/docs/ReflectRequest.md -hindsight_client_api/docs/ReflectResponse.md -hindsight_client_api/docs/RetainRequest.md -hindsight_client_api/docs/RetainResponse.md -hindsight_client_api/docs/UpdateDispositionRequest.md -hindsight_client_api/docs/ValidationError.md -hindsight_client_api/docs/ValidationErrorLocInner.md hindsight_client_api/exceptions.py hindsight_client_api/models/__init__.py hindsight_client_api/models/add_background_request.py @@ -77,6 +29,7 @@ hindsight_client_api/models/disposition_traits.py hindsight_client_api/models/document_response.py hindsight_client_api/models/entity_detail_response.py hindsight_client_api/models/entity_include_options.py +hindsight_client_api/models/entity_input.py hindsight_client_api/models/entity_list_item.py hindsight_client_api/models/entity_list_response.py hindsight_client_api/models/entity_observation_response.py diff --git a/hindsight-clients/python/.openapi-generator/VERSION b/hindsight-clients/python/.openapi-generator/VERSION index 2fb556b6..758bb9c8 100644 --- a/hindsight-clients/python/.openapi-generator/VERSION +++ b/hindsight-clients/python/.openapi-generator/VERSION @@ -1 +1 @@ -7.18.0-SNAPSHOT +7.10.0 diff --git a/hindsight-clients/python/hindsight_client_api/__init__.py b/hindsight-clients/python/hindsight_client_api/__init__.py index ae8bca63..14ac3d49 100644 --- a/hindsight-clients/python/hindsight_client_api/__init__.py +++ b/hindsight-clients/python/hindsight_client_api/__init__.py @@ -16,127 +16,66 @@ __version__ = "0.0.7" -# Define package exports -__all__ = [ - "BanksApi", - "DocumentsApi", - "EntitiesApi", - "MemoryApi", - "MonitoringApi", - "OperationsApi", - "ApiResponse", - "ApiClient", - "Configuration", - "OpenApiException", - "ApiTypeError", - "ApiValueError", - "ApiKeyError", - "ApiAttributeError", - "ApiException", - "AddBackgroundRequest", - "BackgroundResponse", - "BankListItem", - "BankListResponse", - "BankProfileResponse", - "BankStatsResponse", - "Budget", - "CancelOperationResponse", - "ChunkData", - "ChunkIncludeOptions", - "ChunkResponse", - "CreateBankRequest", - "DeleteDocumentResponse", - "DeleteResponse", - "DispositionTraits", - "DocumentResponse", - "EntityDetailResponse", - "EntityIncludeOptions", - "EntityListItem", - "EntityListResponse", - "EntityObservationResponse", - "EntityStateResponse", - "GraphDataResponse", - "HTTPValidationError", - "IncludeOptions", - "ListDocumentsResponse", - "ListMemoryUnitsResponse", - "MemoryItem", - "OperationResponse", - "OperationsListResponse", - "RecallRequest", - "RecallResponse", - "RecallResult", - "ReflectFact", - "ReflectIncludeOptions", - "ReflectRequest", - "ReflectResponse", - "RetainRequest", - "RetainResponse", - "UpdateDispositionRequest", - "ValidationError", - "ValidationErrorLocInner", -] - # import apis into sdk package -from hindsight_client_api.api.banks_api import BanksApi as BanksApi -from hindsight_client_api.api.documents_api import DocumentsApi as DocumentsApi -from hindsight_client_api.api.entities_api import EntitiesApi as EntitiesApi -from hindsight_client_api.api.memory_api import MemoryApi as MemoryApi -from hindsight_client_api.api.monitoring_api import MonitoringApi as MonitoringApi -from hindsight_client_api.api.operations_api import OperationsApi as OperationsApi +from hindsight_client_api.api.banks_api import BanksApi +from hindsight_client_api.api.documents_api import DocumentsApi +from hindsight_client_api.api.entities_api import EntitiesApi +from hindsight_client_api.api.memory_api import MemoryApi +from hindsight_client_api.api.monitoring_api import MonitoringApi +from hindsight_client_api.api.operations_api import OperationsApi # import ApiClient -from hindsight_client_api.api_response import ApiResponse as ApiResponse -from hindsight_client_api.api_client import ApiClient as ApiClient -from hindsight_client_api.configuration import Configuration as Configuration -from hindsight_client_api.exceptions import OpenApiException as OpenApiException -from hindsight_client_api.exceptions import ApiTypeError as ApiTypeError -from hindsight_client_api.exceptions import ApiValueError as ApiValueError -from hindsight_client_api.exceptions import ApiKeyError as ApiKeyError -from hindsight_client_api.exceptions import ApiAttributeError as ApiAttributeError -from hindsight_client_api.exceptions import ApiException as ApiException +from hindsight_client_api.api_response import ApiResponse +from hindsight_client_api.api_client import ApiClient +from hindsight_client_api.configuration import Configuration +from hindsight_client_api.exceptions import OpenApiException +from hindsight_client_api.exceptions import ApiTypeError +from hindsight_client_api.exceptions import ApiValueError +from hindsight_client_api.exceptions import ApiKeyError +from hindsight_client_api.exceptions import ApiAttributeError +from hindsight_client_api.exceptions import ApiException # import models into sdk package -from hindsight_client_api.models.add_background_request import AddBackgroundRequest as AddBackgroundRequest -from hindsight_client_api.models.background_response import BackgroundResponse as BackgroundResponse -from hindsight_client_api.models.bank_list_item import BankListItem as BankListItem -from hindsight_client_api.models.bank_list_response import BankListResponse as BankListResponse -from hindsight_client_api.models.bank_profile_response import BankProfileResponse as BankProfileResponse -from hindsight_client_api.models.bank_stats_response import BankStatsResponse as BankStatsResponse -from hindsight_client_api.models.budget import Budget as Budget -from hindsight_client_api.models.cancel_operation_response import CancelOperationResponse as CancelOperationResponse -from hindsight_client_api.models.chunk_data import ChunkData as ChunkData -from hindsight_client_api.models.chunk_include_options import ChunkIncludeOptions as ChunkIncludeOptions -from hindsight_client_api.models.chunk_response import ChunkResponse as ChunkResponse -from hindsight_client_api.models.create_bank_request import CreateBankRequest as CreateBankRequest -from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse as DeleteDocumentResponse -from hindsight_client_api.models.delete_response import DeleteResponse as DeleteResponse -from hindsight_client_api.models.disposition_traits import DispositionTraits as DispositionTraits -from hindsight_client_api.models.document_response import DocumentResponse as DocumentResponse -from hindsight_client_api.models.entity_detail_response import EntityDetailResponse as EntityDetailResponse -from hindsight_client_api.models.entity_include_options import EntityIncludeOptions as EntityIncludeOptions -from hindsight_client_api.models.entity_list_item import EntityListItem as EntityListItem -from hindsight_client_api.models.entity_list_response import EntityListResponse as EntityListResponse -from hindsight_client_api.models.entity_observation_response import EntityObservationResponse as EntityObservationResponse -from hindsight_client_api.models.entity_state_response import EntityStateResponse as EntityStateResponse -from hindsight_client_api.models.graph_data_response import GraphDataResponse as GraphDataResponse -from hindsight_client_api.models.http_validation_error import HTTPValidationError as HTTPValidationError -from hindsight_client_api.models.include_options import IncludeOptions as IncludeOptions -from hindsight_client_api.models.list_documents_response import ListDocumentsResponse as ListDocumentsResponse -from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse as ListMemoryUnitsResponse -from hindsight_client_api.models.memory_item import MemoryItem as MemoryItem -from hindsight_client_api.models.operation_response import OperationResponse as OperationResponse -from hindsight_client_api.models.operations_list_response import OperationsListResponse as OperationsListResponse -from hindsight_client_api.models.recall_request import RecallRequest as RecallRequest -from hindsight_client_api.models.recall_response import RecallResponse as RecallResponse -from hindsight_client_api.models.recall_result import RecallResult as RecallResult -from hindsight_client_api.models.reflect_fact import ReflectFact as ReflectFact -from hindsight_client_api.models.reflect_include_options import ReflectIncludeOptions as ReflectIncludeOptions -from hindsight_client_api.models.reflect_request import ReflectRequest as ReflectRequest -from hindsight_client_api.models.reflect_response import ReflectResponse as ReflectResponse -from hindsight_client_api.models.retain_request import RetainRequest as RetainRequest -from hindsight_client_api.models.retain_response import RetainResponse as RetainResponse -from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest as UpdateDispositionRequest -from hindsight_client_api.models.validation_error import ValidationError as ValidationError -from hindsight_client_api.models.validation_error_loc_inner import ValidationErrorLocInner as ValidationErrorLocInner - +from hindsight_client_api.models.add_background_request import AddBackgroundRequest +from hindsight_client_api.models.background_response import BackgroundResponse +from hindsight_client_api.models.bank_list_item import BankListItem +from hindsight_client_api.models.bank_list_response import BankListResponse +from hindsight_client_api.models.bank_profile_response import BankProfileResponse +from hindsight_client_api.models.bank_stats_response import BankStatsResponse +from hindsight_client_api.models.budget import Budget +from hindsight_client_api.models.cancel_operation_response import CancelOperationResponse +from hindsight_client_api.models.chunk_data import ChunkData +from hindsight_client_api.models.chunk_include_options import ChunkIncludeOptions +from hindsight_client_api.models.chunk_response import ChunkResponse +from hindsight_client_api.models.create_bank_request import CreateBankRequest +from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse +from hindsight_client_api.models.delete_response import DeleteResponse +from hindsight_client_api.models.disposition_traits import DispositionTraits +from hindsight_client_api.models.document_response import DocumentResponse +from hindsight_client_api.models.entity_detail_response import EntityDetailResponse +from hindsight_client_api.models.entity_include_options import EntityIncludeOptions +from hindsight_client_api.models.entity_input import EntityInput +from hindsight_client_api.models.entity_list_item import EntityListItem +from hindsight_client_api.models.entity_list_response import EntityListResponse +from hindsight_client_api.models.entity_observation_response import EntityObservationResponse +from hindsight_client_api.models.entity_state_response import EntityStateResponse +from hindsight_client_api.models.graph_data_response import GraphDataResponse +from hindsight_client_api.models.http_validation_error import HTTPValidationError +from hindsight_client_api.models.include_options import IncludeOptions +from hindsight_client_api.models.list_documents_response import ListDocumentsResponse +from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse +from hindsight_client_api.models.memory_item import MemoryItem +from hindsight_client_api.models.operation_response import OperationResponse +from hindsight_client_api.models.operations_list_response import OperationsListResponse +from hindsight_client_api.models.recall_request import RecallRequest +from hindsight_client_api.models.recall_response import RecallResponse +from hindsight_client_api.models.recall_result import RecallResult +from hindsight_client_api.models.reflect_fact import ReflectFact +from hindsight_client_api.models.reflect_include_options import ReflectIncludeOptions +from hindsight_client_api.models.reflect_request import ReflectRequest +from hindsight_client_api.models.reflect_response import ReflectResponse +from hindsight_client_api.models.retain_request import RetainRequest +from hindsight_client_api.models.retain_response import RetainResponse +from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest +from hindsight_client_api.models.validation_error import ValidationError +from hindsight_client_api.models.validation_error_loc_inner import ValidationErrorLocInner diff --git a/hindsight-clients/python/hindsight_client_api/api_client.py b/hindsight-clients/python/hindsight_client_api/api_client.py index 3d5c1158..36e6b5c8 100644 --- a/hindsight-clients/python/hindsight_client_api/api_client.py +++ b/hindsight-clients/python/hindsight_client_api/api_client.py @@ -21,7 +21,6 @@ import mimetypes import os import re import tempfile -import uuid from urllib.parse import quote from typing import Tuple, Optional, List, Dict, Union @@ -360,8 +359,6 @@ class ApiClient: return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj - elif isinstance(obj, uuid.UUID): - return str(obj) elif isinstance(obj, list): return [ self.sanitize_for_serialization(sub_obj) for sub_obj in obj @@ -388,10 +385,6 @@ class ApiClient: else: obj_dict = obj.__dict__ - if isinstance(obj_dict, list): - # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() - return self.sanitize_for_serialization(obj_dict) - return { key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() @@ -414,7 +407,7 @@ class ApiClient: data = json.loads(response_text) except ValueError: data = response_text - elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): if response_text == "": data = "" else: @@ -463,13 +456,13 @@ class ApiClient: if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass is object: + elif klass == object: return self.__deserialize_object(data) - elif klass is datetime.date: + elif klass == datetime.date: return self.__deserialize_date(data) - elif klass is datetime.datetime: + elif klass == datetime.datetime: return self.__deserialize_datetime(data) - elif klass is decimal.Decimal: + elif klass == decimal.Decimal: return decimal.Decimal(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) @@ -527,7 +520,7 @@ class ApiClient: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, quote(str(value))) for value in v) + new_params.extend((k, str(value)) for value in v) else: if collection_format == 'ssv': delimiter = ' ' diff --git a/hindsight-clients/python/hindsight_client_api/configuration.py b/hindsight-clients/python/hindsight_client_api/configuration.py index 861590dd..ad3e2133 100644 --- a/hindsight-clients/python/hindsight_client_api/configuration.py +++ b/hindsight-clients/python/hindsight_client_api/configuration.py @@ -17,7 +17,7 @@ import http.client as httplib import logging from logging import FileHandler import sys -from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict from typing_extensions import NotRequired, Self import urllib3 @@ -159,10 +159,6 @@ class Configuration: :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. :param retries: Number of retries for API requests. - :param ca_cert_data: verify the peer using concatenated CA certificate data - in PEM (str) or DER (bytes) format. - :param cert_file: the path to a client certificate file, for mTLS. - :param key_file: the path to a client key file, for mTLS. """ @@ -176,16 +172,13 @@ class Configuration: username: Optional[str]=None, password: Optional[str]=None, access_token: Optional[str]=None, - server_index: Optional[int]=None, + server_index: Optional[int]=None, server_variables: Optional[ServerVariablesT]=None, server_operation_index: Optional[Dict[int, int]]=None, server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, ignore_operation_servers: bool=False, ssl_ca_cert: Optional[str]=None, retries: Optional[int] = None, - ca_cert_data: Optional[Union[str, bytes]] = None, - cert_file: Optional[str]=None, - key_file: Optional[str]=None, *, debug: Optional[bool] = None, ) -> None: @@ -263,14 +256,10 @@ class Configuration: self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.ca_cert_data = ca_cert_data - """Set this to verify the peer using PEM (str) or DER (bytes) - certificate data. - """ - self.cert_file = cert_file + self.cert_file = None """client certificate file """ - self.key_file = key_file + self.key_file = None """client key file """ self.assert_hostname = None diff --git a/hindsight-clients/python/hindsight_client_api/docs/AddBackgroundRequest.md b/hindsight-clients/python/hindsight_client_api/docs/AddBackgroundRequest.md deleted file mode 100644 index 3f000fd2..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/AddBackgroundRequest.md +++ /dev/null @@ -1,31 +0,0 @@ -# AddBackgroundRequest - -Request model for adding/merging background information. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **str** | New background information to add or merge | -**update_disposition** | **bool** | If true, infer disposition traits from the merged background (default: true) | [optional] [default to True] - -## Example - -```python -from hindsight_client_api.models.add_background_request import AddBackgroundRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of AddBackgroundRequest from a JSON string -add_background_request_instance = AddBackgroundRequest.from_json(json) -# print the JSON string representation of the object -print(AddBackgroundRequest.to_json()) - -# convert the object into a dict -add_background_request_dict = add_background_request_instance.to_dict() -# create an instance of AddBackgroundRequest from a dict -add_background_request_from_dict = AddBackgroundRequest.from_dict(add_background_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BackgroundResponse.md b/hindsight-clients/python/hindsight_client_api/docs/BackgroundResponse.md deleted file mode 100644 index f0079179..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BackgroundResponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# BackgroundResponse - -Response model for background update. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**background** | **str** | | -**disposition** | [**DispositionTraits**](DispositionTraits.md) | | [optional] - -## Example - -```python -from hindsight_client_api.models.background_response import BackgroundResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BackgroundResponse from a JSON string -background_response_instance = BackgroundResponse.from_json(json) -# print the JSON string representation of the object -print(BackgroundResponse.to_json()) - -# convert the object into a dict -background_response_dict = background_response_instance.to_dict() -# create an instance of BackgroundResponse from a dict -background_response_from_dict = BackgroundResponse.from_dict(background_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BankListItem.md b/hindsight-clients/python/hindsight_client_api/docs/BankListItem.md deleted file mode 100644 index b8070758..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BankListItem.md +++ /dev/null @@ -1,35 +0,0 @@ -# BankListItem - -Bank list item with profile summary. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_id** | **str** | | -**name** | **str** | | [optional] -**disposition** | [**DispositionTraits**](DispositionTraits.md) | | -**background** | **str** | | [optional] -**created_at** | **str** | | [optional] -**updated_at** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.bank_list_item import BankListItem - -# TODO update the JSON string below -json = "{}" -# create an instance of BankListItem from a JSON string -bank_list_item_instance = BankListItem.from_json(json) -# print the JSON string representation of the object -print(BankListItem.to_json()) - -# convert the object into a dict -bank_list_item_dict = bank_list_item_instance.to_dict() -# create an instance of BankListItem from a dict -bank_list_item_from_dict = BankListItem.from_dict(bank_list_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BankListResponse.md b/hindsight-clients/python/hindsight_client_api/docs/BankListResponse.md deleted file mode 100644 index 57d51c66..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BankListResponse.md +++ /dev/null @@ -1,30 +0,0 @@ -# BankListResponse - -Response model for listing all banks. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**banks** | [**List[BankListItem]**](BankListItem.md) | | - -## Example - -```python -from hindsight_client_api.models.bank_list_response import BankListResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BankListResponse from a JSON string -bank_list_response_instance = BankListResponse.from_json(json) -# print the JSON string representation of the object -print(BankListResponse.to_json()) - -# convert the object into a dict -bank_list_response_dict = bank_list_response_instance.to_dict() -# create an instance of BankListResponse from a dict -bank_list_response_from_dict = BankListResponse.from_dict(bank_list_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BankProfileResponse.md b/hindsight-clients/python/hindsight_client_api/docs/BankProfileResponse.md deleted file mode 100644 index 960bf3d6..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BankProfileResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# BankProfileResponse - -Response model for bank profile. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_id** | **str** | | -**name** | **str** | | -**disposition** | [**DispositionTraits**](DispositionTraits.md) | | -**background** | **str** | | - -## Example - -```python -from hindsight_client_api.models.bank_profile_response import BankProfileResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BankProfileResponse from a JSON string -bank_profile_response_instance = BankProfileResponse.from_json(json) -# print the JSON string representation of the object -print(BankProfileResponse.to_json()) - -# convert the object into a dict -bank_profile_response_dict = bank_profile_response_instance.to_dict() -# create an instance of BankProfileResponse from a dict -bank_profile_response_from_dict = BankProfileResponse.from_dict(bank_profile_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BankStatsResponse.md b/hindsight-clients/python/hindsight_client_api/docs/BankStatsResponse.md deleted file mode 100644 index 64505971..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BankStatsResponse.md +++ /dev/null @@ -1,39 +0,0 @@ -# BankStatsResponse - -Response model for bank statistics endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_id** | **str** | | -**total_nodes** | **int** | | -**total_links** | **int** | | -**total_documents** | **int** | | -**nodes_by_fact_type** | **Dict[str, int]** | | -**links_by_link_type** | **Dict[str, int]** | | -**links_by_fact_type** | **Dict[str, int]** | | -**links_breakdown** | **Dict[str, Dict[str, int]]** | | -**pending_operations** | **int** | | -**failed_operations** | **int** | | - -## Example - -```python -from hindsight_client_api.models.bank_stats_response import BankStatsResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of BankStatsResponse from a JSON string -bank_stats_response_instance = BankStatsResponse.from_json(json) -# print the JSON string representation of the object -print(BankStatsResponse.to_json()) - -# convert the object into a dict -bank_stats_response_dict = bank_stats_response_instance.to_dict() -# create an instance of BankStatsResponse from a dict -bank_stats_response_from_dict = BankStatsResponse.from_dict(bank_stats_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/BanksApi.md b/hindsight-clients/python/hindsight_client_api/docs/BanksApi.md deleted file mode 100644 index 6a2618ab..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/BanksApi.md +++ /dev/null @@ -1,517 +0,0 @@ -# hindsight_client_api.BanksApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**add_bank_background**](BanksApi.md#add_bank_background) | **POST** /v1/default/banks/{bank_id}/background | Add/merge memory bank background -[**create_or_update_bank**](BanksApi.md#create_or_update_bank) | **PUT** /v1/default/banks/{bank_id} | Create or update memory bank -[**delete_bank**](BanksApi.md#delete_bank) | **DELETE** /v1/default/banks/{bank_id} | Delete memory bank -[**get_agent_stats**](BanksApi.md#get_agent_stats) | **GET** /v1/default/banks/{bank_id}/stats | Get statistics for memory bank -[**get_bank_profile**](BanksApi.md#get_bank_profile) | **GET** /v1/default/banks/{bank_id}/profile | Get memory bank profile -[**list_banks**](BanksApi.md#list_banks) | **GET** /v1/default/banks | List all memory banks -[**update_bank_disposition**](BanksApi.md#update_bank_disposition) | **PUT** /v1/default/banks/{bank_id}/profile | Update memory bank disposition - - -# **add_bank_background** -> BackgroundResponse add_bank_background(bank_id, add_background_request, authorization=authorization) - -Add/merge memory bank background - -Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.add_background_request import AddBackgroundRequest -from hindsight_client_api.models.background_response import BackgroundResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - add_background_request = hindsight_client_api.AddBackgroundRequest() # AddBackgroundRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Add/merge memory bank background - api_response = await api_instance.add_bank_background(bank_id, add_background_request, authorization=authorization) - print("The response of BanksApi->add_bank_background:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->add_bank_background: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **add_background_request** | [**AddBackgroundRequest**](AddBackgroundRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**BackgroundResponse**](BackgroundResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **create_or_update_bank** -> BankProfileResponse create_or_update_bank(bank_id, create_bank_request, authorization=authorization) - -Create or update memory bank - -Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.bank_profile_response import BankProfileResponse -from hindsight_client_api.models.create_bank_request import CreateBankRequest -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - create_bank_request = hindsight_client_api.CreateBankRequest() # CreateBankRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Create or update memory bank - api_response = await api_instance.create_or_update_bank(bank_id, create_bank_request, authorization=authorization) - print("The response of BanksApi->create_or_update_bank:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->create_or_update_bank: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **create_bank_request** | [**CreateBankRequest**](CreateBankRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**BankProfileResponse**](BankProfileResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **delete_bank** -> DeleteResponse delete_bank(bank_id, authorization=authorization) - -Delete memory bank - -Delete an entire memory bank including all memories, entities, documents, and the bank profile itself. This is a destructive operation that cannot be undone. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.delete_response import DeleteResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Delete memory bank - api_response = await api_instance.delete_bank(bank_id, authorization=authorization) - print("The response of BanksApi->delete_bank:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->delete_bank: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**DeleteResponse**](DeleteResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_agent_stats** -> BankStatsResponse get_agent_stats(bank_id) - -Get statistics for memory bank - -Get statistics about nodes and links for a specific agent - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.bank_stats_response import BankStatsResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - - try: - # Get statistics for memory bank - api_response = await api_instance.get_agent_stats(bank_id) - print("The response of BanksApi->get_agent_stats:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->get_agent_stats: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - -### Return type - -[**BankStatsResponse**](BankStatsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_bank_profile** -> BankProfileResponse get_bank_profile(bank_id, authorization=authorization) - -Get memory bank profile - -Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.bank_profile_response import BankProfileResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Get memory bank profile - api_response = await api_instance.get_bank_profile(bank_id, authorization=authorization) - print("The response of BanksApi->get_bank_profile:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->get_bank_profile: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**BankProfileResponse**](BankProfileResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_banks** -> BankListResponse list_banks(authorization=authorization) - -List all memory banks - -Get a list of all agents with their profiles - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.bank_list_response import BankListResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - authorization = 'authorization_example' # str | (optional) - - try: - # List all memory banks - api_response = await api_instance.list_banks(authorization=authorization) - print("The response of BanksApi->list_banks:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->list_banks: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **authorization** | **str**| | [optional] - -### Return type - -[**BankListResponse**](BankListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **update_bank_disposition** -> BankProfileResponse update_bank_disposition(bank_id, update_disposition_request, authorization=authorization) - -Update memory bank disposition - -Update bank's disposition traits (skepticism, literalism, empathy) - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.bank_profile_response import BankProfileResponse -from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.BanksApi(api_client) - bank_id = 'bank_id_example' # str | - update_disposition_request = hindsight_client_api.UpdateDispositionRequest() # UpdateDispositionRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Update memory bank disposition - api_response = await api_instance.update_bank_disposition(bank_id, update_disposition_request, authorization=authorization) - print("The response of BanksApi->update_bank_disposition:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling BanksApi->update_bank_disposition: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **update_disposition_request** | [**UpdateDispositionRequest**](UpdateDispositionRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**BankProfileResponse**](BankProfileResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/Budget.md b/hindsight-clients/python/hindsight_client_api/docs/Budget.md deleted file mode 100644 index 3e0ce4aa..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/Budget.md +++ /dev/null @@ -1,15 +0,0 @@ -# Budget - -Budget levels for recall/reflect operations. - -## Enum - -* `LOW` (value: `'low'`) - -* `MID` (value: `'mid'`) - -* `HIGH` (value: `'high'`) - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/CancelOperationResponse.md b/hindsight-clients/python/hindsight_client_api/docs/CancelOperationResponse.md deleted file mode 100644 index 0015b5a1..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/CancelOperationResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# CancelOperationResponse - -Response model for cancel operation endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | -**message** | **str** | | -**operation_id** | **str** | | - -## Example - -```python -from hindsight_client_api.models.cancel_operation_response import CancelOperationResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of CancelOperationResponse from a JSON string -cancel_operation_response_instance = CancelOperationResponse.from_json(json) -# print the JSON string representation of the object -print(CancelOperationResponse.to_json()) - -# convert the object into a dict -cancel_operation_response_dict = cancel_operation_response_instance.to_dict() -# create an instance of CancelOperationResponse from a dict -cancel_operation_response_from_dict = CancelOperationResponse.from_dict(cancel_operation_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ChunkData.md b/hindsight-clients/python/hindsight_client_api/docs/ChunkData.md deleted file mode 100644 index 226c0487..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ChunkData.md +++ /dev/null @@ -1,33 +0,0 @@ -# ChunkData - -Chunk data for a single chunk. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**text** | **str** | | -**chunk_index** | **int** | | -**truncated** | **bool** | Whether the chunk text was truncated due to token limits | [optional] [default to False] - -## Example - -```python -from hindsight_client_api.models.chunk_data import ChunkData - -# TODO update the JSON string below -json = "{}" -# create an instance of ChunkData from a JSON string -chunk_data_instance = ChunkData.from_json(json) -# print the JSON string representation of the object -print(ChunkData.to_json()) - -# convert the object into a dict -chunk_data_dict = chunk_data_instance.to_dict() -# create an instance of ChunkData from a dict -chunk_data_from_dict = ChunkData.from_dict(chunk_data_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ChunkIncludeOptions.md b/hindsight-clients/python/hindsight_client_api/docs/ChunkIncludeOptions.md deleted file mode 100644 index 20fe36e0..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ChunkIncludeOptions.md +++ /dev/null @@ -1,30 +0,0 @@ -# ChunkIncludeOptions - -Options for including chunks in recall results. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**max_tokens** | **int** | Maximum tokens for chunks (chunks may be truncated) | [optional] [default to 8192] - -## Example - -```python -from hindsight_client_api.models.chunk_include_options import ChunkIncludeOptions - -# TODO update the JSON string below -json = "{}" -# create an instance of ChunkIncludeOptions from a JSON string -chunk_include_options_instance = ChunkIncludeOptions.from_json(json) -# print the JSON string representation of the object -print(ChunkIncludeOptions.to_json()) - -# convert the object into a dict -chunk_include_options_dict = chunk_include_options_instance.to_dict() -# create an instance of ChunkIncludeOptions from a dict -chunk_include_options_from_dict = ChunkIncludeOptions.from_dict(chunk_include_options_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ChunkResponse.md b/hindsight-clients/python/hindsight_client_api/docs/ChunkResponse.md deleted file mode 100644 index 078bf775..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ChunkResponse.md +++ /dev/null @@ -1,35 +0,0 @@ -# ChunkResponse - -Response model for get chunk endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**chunk_id** | **str** | | -**document_id** | **str** | | -**bank_id** | **str** | | -**chunk_index** | **int** | | -**chunk_text** | **str** | | -**created_at** | **str** | | - -## Example - -```python -from hindsight_client_api.models.chunk_response import ChunkResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of ChunkResponse from a JSON string -chunk_response_instance = ChunkResponse.from_json(json) -# print the JSON string representation of the object -print(ChunkResponse.to_json()) - -# convert the object into a dict -chunk_response_dict = chunk_response_instance.to_dict() -# create an instance of ChunkResponse from a dict -chunk_response_from_dict = ChunkResponse.from_dict(chunk_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/CreateBankRequest.md b/hindsight-clients/python/hindsight_client_api/docs/CreateBankRequest.md deleted file mode 100644 index 268a4a6b..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/CreateBankRequest.md +++ /dev/null @@ -1,32 +0,0 @@ -# CreateBankRequest - -Request model for creating/updating a bank. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**disposition** | [**DispositionTraits**](DispositionTraits.md) | | [optional] -**background** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.create_bank_request import CreateBankRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of CreateBankRequest from a JSON string -create_bank_request_instance = CreateBankRequest.from_json(json) -# print the JSON string representation of the object -print(CreateBankRequest.to_json()) - -# convert the object into a dict -create_bank_request_dict = create_bank_request_instance.to_dict() -# create an instance of CreateBankRequest from a dict -create_bank_request_from_dict = CreateBankRequest.from_dict(create_bank_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/DeleteDocumentResponse.md b/hindsight-clients/python/hindsight_client_api/docs/DeleteDocumentResponse.md deleted file mode 100644 index 34fd9abb..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/DeleteDocumentResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# DeleteDocumentResponse - -Response model for delete document endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | -**message** | **str** | | -**document_id** | **str** | | -**memory_units_deleted** | **int** | | - -## Example - -```python -from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of DeleteDocumentResponse from a JSON string -delete_document_response_instance = DeleteDocumentResponse.from_json(json) -# print the JSON string representation of the object -print(DeleteDocumentResponse.to_json()) - -# convert the object into a dict -delete_document_response_dict = delete_document_response_instance.to_dict() -# create an instance of DeleteDocumentResponse from a dict -delete_document_response_from_dict = DeleteDocumentResponse.from_dict(delete_document_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/DeleteResponse.md b/hindsight-clients/python/hindsight_client_api/docs/DeleteResponse.md deleted file mode 100644 index c7be16b4..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/DeleteResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# DeleteResponse - -Response model for delete operations. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | -**message** | **str** | | [optional] -**deleted_count** | **int** | | [optional] - -## Example - -```python -from hindsight_client_api.models.delete_response import DeleteResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of DeleteResponse from a JSON string -delete_response_instance = DeleteResponse.from_json(json) -# print the JSON string representation of the object -print(DeleteResponse.to_json()) - -# convert the object into a dict -delete_response_dict = delete_response_instance.to_dict() -# create an instance of DeleteResponse from a dict -delete_response_from_dict = DeleteResponse.from_dict(delete_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/DispositionTraits.md b/hindsight-clients/python/hindsight_client_api/docs/DispositionTraits.md deleted file mode 100644 index 4996890c..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/DispositionTraits.md +++ /dev/null @@ -1,32 +0,0 @@ -# DispositionTraits - -Disposition traits that influence how memories are formed and interpreted. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**skepticism** | **int** | How skeptical vs trusting (1=trusting, 5=skeptical) | -**literalism** | **int** | How literally to interpret information (1=flexible, 5=literal) | -**empathy** | **int** | How much to consider emotional context (1=detached, 5=empathetic) | - -## Example - -```python -from hindsight_client_api.models.disposition_traits import DispositionTraits - -# TODO update the JSON string below -json = "{}" -# create an instance of DispositionTraits from a JSON string -disposition_traits_instance = DispositionTraits.from_json(json) -# print the JSON string representation of the object -print(DispositionTraits.to_json()) - -# convert the object into a dict -disposition_traits_dict = disposition_traits_instance.to_dict() -# create an instance of DispositionTraits from a dict -disposition_traits_from_dict = DispositionTraits.from_dict(disposition_traits_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/DocumentResponse.md b/hindsight-clients/python/hindsight_client_api/docs/DocumentResponse.md deleted file mode 100644 index 1bca8c70..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/DocumentResponse.md +++ /dev/null @@ -1,36 +0,0 @@ -# DocumentResponse - -Response model for get document endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**bank_id** | **str** | | -**original_text** | **str** | | -**content_hash** | **str** | | -**created_at** | **str** | | -**updated_at** | **str** | | -**memory_unit_count** | **int** | | - -## Example - -```python -from hindsight_client_api.models.document_response import DocumentResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of DocumentResponse from a JSON string -document_response_instance = DocumentResponse.from_json(json) -# print the JSON string representation of the object -print(DocumentResponse.to_json()) - -# convert the object into a dict -document_response_dict = document_response_instance.to_dict() -# create an instance of DocumentResponse from a dict -document_response_from_dict = DocumentResponse.from_dict(document_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/DocumentsApi.md b/hindsight-clients/python/hindsight_client_api/docs/DocumentsApi.md deleted file mode 100644 index 69d6af33..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/DocumentsApi.md +++ /dev/null @@ -1,313 +0,0 @@ -# hindsight_client_api.DocumentsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**delete_document**](DocumentsApi.md#delete_document) | **DELETE** /v1/default/banks/{bank_id}/documents/{document_id} | Delete a document -[**get_chunk**](DocumentsApi.md#get_chunk) | **GET** /v1/default/chunks/{chunk_id} | Get chunk details -[**get_document**](DocumentsApi.md#get_document) | **GET** /v1/default/banks/{bank_id}/documents/{document_id} | Get document details -[**list_documents**](DocumentsApi.md#list_documents) | **GET** /v1/default/banks/{bank_id}/documents | List documents - - -# **delete_document** -> DeleteDocumentResponse delete_document(bank_id, document_id, authorization=authorization) - -Delete a document - -Delete a document and all its associated memory units and links. - -This will cascade delete: -- The document itself -- All memory units extracted from this document -- All links (temporal, semantic, entity) associated with those memory units - -This operation cannot be undone. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.delete_document_response import DeleteDocumentResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.DocumentsApi(api_client) - bank_id = 'bank_id_example' # str | - document_id = 'document_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Delete a document - api_response = await api_instance.delete_document(bank_id, document_id, authorization=authorization) - print("The response of DocumentsApi->delete_document:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DocumentsApi->delete_document: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **document_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**DeleteDocumentResponse**](DeleteDocumentResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_chunk** -> ChunkResponse get_chunk(chunk_id, authorization=authorization) - -Get chunk details - -Get a specific chunk by its ID - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.chunk_response import ChunkResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.DocumentsApi(api_client) - chunk_id = 'chunk_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Get chunk details - api_response = await api_instance.get_chunk(chunk_id, authorization=authorization) - print("The response of DocumentsApi->get_chunk:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DocumentsApi->get_chunk: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **chunk_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**ChunkResponse**](ChunkResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_document** -> DocumentResponse get_document(bank_id, document_id, authorization=authorization) - -Get document details - -Get a specific document including its original text - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.document_response import DocumentResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.DocumentsApi(api_client) - bank_id = 'bank_id_example' # str | - document_id = 'document_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Get document details - api_response = await api_instance.get_document(bank_id, document_id, authorization=authorization) - print("The response of DocumentsApi->get_document:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DocumentsApi->get_document: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **document_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**DocumentResponse**](DocumentResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_documents** -> ListDocumentsResponse list_documents(bank_id, q=q, limit=limit, offset=offset, authorization=authorization) - -List documents - -List documents with pagination and optional search. Documents are the source content from which memory units are extracted. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.list_documents_response import ListDocumentsResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.DocumentsApi(api_client) - bank_id = 'bank_id_example' # str | - q = 'q_example' # str | (optional) - limit = 100 # int | (optional) (default to 100) - offset = 0 # int | (optional) (default to 0) - authorization = 'authorization_example' # str | (optional) - - try: - # List documents - api_response = await api_instance.list_documents(bank_id, q=q, limit=limit, offset=offset, authorization=authorization) - print("The response of DocumentsApi->list_documents:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling DocumentsApi->list_documents: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **q** | **str**| | [optional] - **limit** | **int**| | [optional] [default to 100] - **offset** | **int**| | [optional] [default to 0] - **authorization** | **str**| | [optional] - -### Return type - -[**ListDocumentsResponse**](ListDocumentsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntitiesApi.md b/hindsight-clients/python/hindsight_client_api/docs/EntitiesApi.md deleted file mode 100644 index 5079a1ef..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntitiesApi.md +++ /dev/null @@ -1,230 +0,0 @@ -# hindsight_client_api.EntitiesApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_entity**](EntitiesApi.md#get_entity) | **GET** /v1/default/banks/{bank_id}/entities/{entity_id} | Get entity details -[**list_entities**](EntitiesApi.md#list_entities) | **GET** /v1/default/banks/{bank_id}/entities | List entities -[**regenerate_entity_observations**](EntitiesApi.md#regenerate_entity_observations) | **POST** /v1/default/banks/{bank_id}/entities/{entity_id}/regenerate | Regenerate entity observations - - -# **get_entity** -> EntityDetailResponse get_entity(bank_id, entity_id, authorization=authorization) - -Get entity details - -Get detailed information about an entity including observations (mental model). - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.entity_detail_response import EntityDetailResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.EntitiesApi(api_client) - bank_id = 'bank_id_example' # str | - entity_id = 'entity_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Get entity details - api_response = await api_instance.get_entity(bank_id, entity_id, authorization=authorization) - print("The response of EntitiesApi->get_entity:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling EntitiesApi->get_entity: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **entity_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**EntityDetailResponse**](EntityDetailResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_entities** -> EntityListResponse list_entities(bank_id, limit=limit, authorization=authorization) - -List entities - -List all entities (people, organizations, etc.) known by the bank, ordered by mention count. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.entity_list_response import EntityListResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.EntitiesApi(api_client) - bank_id = 'bank_id_example' # str | - limit = 100 # int | Maximum number of entities to return (optional) (default to 100) - authorization = 'authorization_example' # str | (optional) - - try: - # List entities - api_response = await api_instance.list_entities(bank_id, limit=limit, authorization=authorization) - print("The response of EntitiesApi->list_entities:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling EntitiesApi->list_entities: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **limit** | **int**| Maximum number of entities to return | [optional] [default to 100] - **authorization** | **str**| | [optional] - -### Return type - -[**EntityListResponse**](EntityListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **regenerate_entity_observations** -> EntityDetailResponse regenerate_entity_observations(bank_id, entity_id, authorization=authorization) - -Regenerate entity observations - -Regenerate observations for an entity based on all facts mentioning it. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.entity_detail_response import EntityDetailResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.EntitiesApi(api_client) - bank_id = 'bank_id_example' # str | - entity_id = 'entity_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Regenerate entity observations - api_response = await api_instance.regenerate_entity_observations(bank_id, entity_id, authorization=authorization) - print("The response of EntitiesApi->regenerate_entity_observations:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling EntitiesApi->regenerate_entity_observations: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **entity_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**EntityDetailResponse**](EntityDetailResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityDetailResponse.md b/hindsight-clients/python/hindsight_client_api/docs/EntityDetailResponse.md deleted file mode 100644 index 1061a7af..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityDetailResponse.md +++ /dev/null @@ -1,36 +0,0 @@ -# EntityDetailResponse - -Response model for entity detail endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**canonical_name** | **str** | | -**mention_count** | **int** | | -**first_seen** | **str** | | [optional] -**last_seen** | **str** | | [optional] -**metadata** | **Dict[str, object]** | | [optional] -**observations** | [**List[EntityObservationResponse]**](EntityObservationResponse.md) | | - -## Example - -```python -from hindsight_client_api.models.entity_detail_response import EntityDetailResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityDetailResponse from a JSON string -entity_detail_response_instance = EntityDetailResponse.from_json(json) -# print the JSON string representation of the object -print(EntityDetailResponse.to_json()) - -# convert the object into a dict -entity_detail_response_dict = entity_detail_response_instance.to_dict() -# create an instance of EntityDetailResponse from a dict -entity_detail_response_from_dict = EntityDetailResponse.from_dict(entity_detail_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityIncludeOptions.md b/hindsight-clients/python/hindsight_client_api/docs/EntityIncludeOptions.md deleted file mode 100644 index d568f2f9..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityIncludeOptions.md +++ /dev/null @@ -1,30 +0,0 @@ -# EntityIncludeOptions - -Options for including entity observations in recall results. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**max_tokens** | **int** | Maximum tokens for entity observations | [optional] [default to 500] - -## Example - -```python -from hindsight_client_api.models.entity_include_options import EntityIncludeOptions - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityIncludeOptions from a JSON string -entity_include_options_instance = EntityIncludeOptions.from_json(json) -# print the JSON string representation of the object -print(EntityIncludeOptions.to_json()) - -# convert the object into a dict -entity_include_options_dict = entity_include_options_instance.to_dict() -# create an instance of EntityIncludeOptions from a dict -entity_include_options_from_dict = EntityIncludeOptions.from_dict(entity_include_options_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityListItem.md b/hindsight-clients/python/hindsight_client_api/docs/EntityListItem.md deleted file mode 100644 index 28d9aa17..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityListItem.md +++ /dev/null @@ -1,35 +0,0 @@ -# EntityListItem - -Entity list item with summary. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**canonical_name** | **str** | | -**mention_count** | **int** | | -**first_seen** | **str** | | [optional] -**last_seen** | **str** | | [optional] -**metadata** | **Dict[str, object]** | | [optional] - -## Example - -```python -from hindsight_client_api.models.entity_list_item import EntityListItem - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityListItem from a JSON string -entity_list_item_instance = EntityListItem.from_json(json) -# print the JSON string representation of the object -print(EntityListItem.to_json()) - -# convert the object into a dict -entity_list_item_dict = entity_list_item_instance.to_dict() -# create an instance of EntityListItem from a dict -entity_list_item_from_dict = EntityListItem.from_dict(entity_list_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityListResponse.md b/hindsight-clients/python/hindsight_client_api/docs/EntityListResponse.md deleted file mode 100644 index 04c500f0..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityListResponse.md +++ /dev/null @@ -1,30 +0,0 @@ -# EntityListResponse - -Response model for entity list endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**List[EntityListItem]**](EntityListItem.md) | | - -## Example - -```python -from hindsight_client_api.models.entity_list_response import EntityListResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityListResponse from a JSON string -entity_list_response_instance = EntityListResponse.from_json(json) -# print the JSON string representation of the object -print(EntityListResponse.to_json()) - -# convert the object into a dict -entity_list_response_dict = entity_list_response_instance.to_dict() -# create an instance of EntityListResponse from a dict -entity_list_response_from_dict = EntityListResponse.from_dict(entity_list_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityObservationResponse.md b/hindsight-clients/python/hindsight_client_api/docs/EntityObservationResponse.md deleted file mode 100644 index 1fdc1edc..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityObservationResponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# EntityObservationResponse - -An observation about an entity. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text** | **str** | | -**mentioned_at** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.entity_observation_response import EntityObservationResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityObservationResponse from a JSON string -entity_observation_response_instance = EntityObservationResponse.from_json(json) -# print the JSON string representation of the object -print(EntityObservationResponse.to_json()) - -# convert the object into a dict -entity_observation_response_dict = entity_observation_response_instance.to_dict() -# create an instance of EntityObservationResponse from a dict -entity_observation_response_from_dict = EntityObservationResponse.from_dict(entity_observation_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/EntityStateResponse.md b/hindsight-clients/python/hindsight_client_api/docs/EntityStateResponse.md deleted file mode 100644 index 593a9227..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/EntityStateResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# EntityStateResponse - -Current mental model of an entity. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**entity_id** | **str** | | -**canonical_name** | **str** | | -**observations** | [**List[EntityObservationResponse]**](EntityObservationResponse.md) | | - -## Example - -```python -from hindsight_client_api.models.entity_state_response import EntityStateResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of EntityStateResponse from a JSON string -entity_state_response_instance = EntityStateResponse.from_json(json) -# print the JSON string representation of the object -print(EntityStateResponse.to_json()) - -# convert the object into a dict -entity_state_response_dict = entity_state_response_instance.to_dict() -# create an instance of EntityStateResponse from a dict -entity_state_response_from_dict = EntityStateResponse.from_dict(entity_state_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/GraphDataResponse.md b/hindsight-clients/python/hindsight_client_api/docs/GraphDataResponse.md deleted file mode 100644 index 0f3e65ae..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/GraphDataResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# GraphDataResponse - -Response model for graph data endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nodes** | **List[Dict[str, object]]** | | -**edges** | **List[Dict[str, object]]** | | -**table_rows** | **List[Dict[str, object]]** | | -**total_units** | **int** | | - -## Example - -```python -from hindsight_client_api.models.graph_data_response import GraphDataResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of GraphDataResponse from a JSON string -graph_data_response_instance = GraphDataResponse.from_json(json) -# print the JSON string representation of the object -print(GraphDataResponse.to_json()) - -# convert the object into a dict -graph_data_response_dict = graph_data_response_instance.to_dict() -# create an instance of GraphDataResponse from a dict -graph_data_response_from_dict = GraphDataResponse.from_dict(graph_data_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/HTTPValidationError.md b/hindsight-clients/python/hindsight_client_api/docs/HTTPValidationError.md deleted file mode 100644 index f1d0e7a1..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/HTTPValidationError.md +++ /dev/null @@ -1,29 +0,0 @@ -# HTTPValidationError - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**detail** | [**List[ValidationError]**](ValidationError.md) | | [optional] - -## Example - -```python -from hindsight_client_api.models.http_validation_error import HTTPValidationError - -# TODO update the JSON string below -json = "{}" -# create an instance of HTTPValidationError from a JSON string -http_validation_error_instance = HTTPValidationError.from_json(json) -# print the JSON string representation of the object -print(HTTPValidationError.to_json()) - -# convert the object into a dict -http_validation_error_dict = http_validation_error_instance.to_dict() -# create an instance of HTTPValidationError from a dict -http_validation_error_from_dict = HTTPValidationError.from_dict(http_validation_error_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/IncludeOptions.md b/hindsight-clients/python/hindsight_client_api/docs/IncludeOptions.md deleted file mode 100644 index c158ae08..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/IncludeOptions.md +++ /dev/null @@ -1,31 +0,0 @@ -# IncludeOptions - -Options for including additional data in recall results. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**entities** | [**EntityIncludeOptions**](EntityIncludeOptions.md) | | [optional] -**chunks** | [**ChunkIncludeOptions**](ChunkIncludeOptions.md) | | [optional] - -## Example - -```python -from hindsight_client_api.models.include_options import IncludeOptions - -# TODO update the JSON string below -json = "{}" -# create an instance of IncludeOptions from a JSON string -include_options_instance = IncludeOptions.from_json(json) -# print the JSON string representation of the object -print(IncludeOptions.to_json()) - -# convert the object into a dict -include_options_dict = include_options_instance.to_dict() -# create an instance of IncludeOptions from a dict -include_options_from_dict = IncludeOptions.from_dict(include_options_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ListDocumentsResponse.md b/hindsight-clients/python/hindsight_client_api/docs/ListDocumentsResponse.md deleted file mode 100644 index 6474ee19..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ListDocumentsResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# ListDocumentsResponse - -Response model for list documents endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | **List[Dict[str, object]]** | | -**total** | **int** | | -**limit** | **int** | | -**offset** | **int** | | - -## Example - -```python -from hindsight_client_api.models.list_documents_response import ListDocumentsResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of ListDocumentsResponse from a JSON string -list_documents_response_instance = ListDocumentsResponse.from_json(json) -# print the JSON string representation of the object -print(ListDocumentsResponse.to_json()) - -# convert the object into a dict -list_documents_response_dict = list_documents_response_instance.to_dict() -# create an instance of ListDocumentsResponse from a dict -list_documents_response_from_dict = ListDocumentsResponse.from_dict(list_documents_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ListMemoryUnitsResponse.md b/hindsight-clients/python/hindsight_client_api/docs/ListMemoryUnitsResponse.md deleted file mode 100644 index 05579867..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ListMemoryUnitsResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# ListMemoryUnitsResponse - -Response model for list memory units endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | **List[Dict[str, object]]** | | -**total** | **int** | | -**limit** | **int** | | -**offset** | **int** | | - -## Example - -```python -from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of ListMemoryUnitsResponse from a JSON string -list_memory_units_response_instance = ListMemoryUnitsResponse.from_json(json) -# print the JSON string representation of the object -print(ListMemoryUnitsResponse.to_json()) - -# convert the object into a dict -list_memory_units_response_dict = list_memory_units_response_instance.to_dict() -# create an instance of ListMemoryUnitsResponse from a dict -list_memory_units_response_from_dict = ListMemoryUnitsResponse.from_dict(list_memory_units_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/MemoryApi.md b/hindsight-clients/python/hindsight_client_api/docs/MemoryApi.md deleted file mode 100644 index 8432e842..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/MemoryApi.md +++ /dev/null @@ -1,499 +0,0 @@ -# hindsight_client_api.MemoryApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**clear_bank_memories**](MemoryApi.md#clear_bank_memories) | **DELETE** /v1/default/banks/{bank_id}/memories | Clear memory bank memories -[**get_graph**](MemoryApi.md#get_graph) | **GET** /v1/default/banks/{bank_id}/graph | Get memory graph data -[**list_memories**](MemoryApi.md#list_memories) | **GET** /v1/default/banks/{bank_id}/memories/list | List memory units -[**recall_memories**](MemoryApi.md#recall_memories) | **POST** /v1/default/banks/{bank_id}/memories/recall | Recall memory -[**reflect**](MemoryApi.md#reflect) | **POST** /v1/default/banks/{bank_id}/reflect | Reflect and generate answer -[**retain_memories**](MemoryApi.md#retain_memories) | **POST** /v1/default/banks/{bank_id}/memories | Retain memories - - -# **clear_bank_memories** -> DeleteResponse clear_bank_memories(bank_id, type=type, authorization=authorization) - -Clear memory bank memories - -Delete memory units for a memory bank. Optionally filter by type (world, experience, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (disposition and background) will be preserved. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.delete_response import DeleteResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - type = 'type_example' # str | Optional fact type filter (world, experience, opinion) (optional) - authorization = 'authorization_example' # str | (optional) - - try: - # Clear memory bank memories - api_response = await api_instance.clear_bank_memories(bank_id, type=type, authorization=authorization) - print("The response of MemoryApi->clear_bank_memories:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->clear_bank_memories: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **type** | **str**| Optional fact type filter (world, experience, opinion) | [optional] - **authorization** | **str**| | [optional] - -### Return type - -[**DeleteResponse**](DeleteResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **get_graph** -> GraphDataResponse get_graph(bank_id, type=type, authorization=authorization) - -Get memory graph data - -Retrieve graph data for visualization, optionally filtered by type (world/experience/opinion). Limited to 1000 most recent items. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.graph_data_response import GraphDataResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - type = 'type_example' # str | (optional) - authorization = 'authorization_example' # str | (optional) - - try: - # Get memory graph data - api_response = await api_instance.get_graph(bank_id, type=type, authorization=authorization) - print("The response of MemoryApi->get_graph:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->get_graph: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **type** | **str**| | [optional] - **authorization** | **str**| | [optional] - -### Return type - -[**GraphDataResponse**](GraphDataResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_memories** -> ListMemoryUnitsResponse list_memories(bank_id, type=type, q=q, limit=limit, offset=offset, authorization=authorization) - -List memory units - -List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC). - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.list_memory_units_response import ListMemoryUnitsResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - type = 'type_example' # str | (optional) - q = 'q_example' # str | (optional) - limit = 100 # int | (optional) (default to 100) - offset = 0 # int | (optional) (default to 0) - authorization = 'authorization_example' # str | (optional) - - try: - # List memory units - api_response = await api_instance.list_memories(bank_id, type=type, q=q, limit=limit, offset=offset, authorization=authorization) - print("The response of MemoryApi->list_memories:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->list_memories: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **type** | **str**| | [optional] - **q** | **str**| | [optional] - **limit** | **int**| | [optional] [default to 100] - **offset** | **int**| | [optional] [default to 0] - **authorization** | **str**| | [optional] - -### Return type - -[**ListMemoryUnitsResponse**](ListMemoryUnitsResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **recall_memories** -> RecallResponse recall_memories(bank_id, recall_request, authorization=authorization) - -Recall memory - -Recall memory using semantic similarity and spreading activation. - -The type parameter is optional and must be one of: -- `world`: General knowledge about people, places, events, and things that happen -- `experience`: Memories about experience, conversations, actions taken, and tasks performed -- `opinion`: The bank's formed beliefs, perspectives, and viewpoints - -Set `include_entities=true` to get entity observations alongside recall results. - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.recall_request import RecallRequest -from hindsight_client_api.models.recall_response import RecallResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - recall_request = hindsight_client_api.RecallRequest() # RecallRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Recall memory - api_response = await api_instance.recall_memories(bank_id, recall_request, authorization=authorization) - print("The response of MemoryApi->recall_memories:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->recall_memories: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **recall_request** | [**RecallRequest**](RecallRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**RecallResponse**](RecallResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **reflect** -> ReflectResponse reflect(bank_id, reflect_request, authorization=authorization) - -Reflect and generate answer - -Reflect and formulate an answer using bank identity, world facts, and opinions. - -This endpoint: -1. Retrieves experience (conversations and events) -2. Retrieves world facts relevant to the query -3. Retrieves existing opinions (bank's perspectives) -4. Uses LLM to formulate a contextual answer -5. Extracts and stores any new opinions formed -6. Returns plain text answer, the facts used, and new opinions - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.reflect_request import ReflectRequest -from hindsight_client_api.models.reflect_response import ReflectResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - reflect_request = hindsight_client_api.ReflectRequest() # ReflectRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Reflect and generate answer - api_response = await api_instance.reflect(bank_id, reflect_request, authorization=authorization) - print("The response of MemoryApi->reflect:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->reflect: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **reflect_request** | [**ReflectRequest**](ReflectRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**ReflectResponse**](ReflectResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **retain_memories** -> RetainResponse retain_memories(bank_id, retain_request, authorization=authorization) - -Retain memories - -Retain memory items with automatic fact extraction. - -This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the `async` parameter. - -**Features:** -- Efficient batch processing -- Automatic fact extraction from natural language -- Entity recognition and linking -- Document tracking with automatic upsert (when document_id is provided) -- Temporal and semantic linking -- Optional asynchronous processing - -**The system automatically:** -1. Extracts semantic facts from the content -2. Generates embeddings -3. Deduplicates similar facts -4. Creates temporal, semantic, and entity links -5. Tracks document metadata - -**When `async=true`:** Returns immediately after queuing. Use the operations endpoint to monitor progress. - -**When `async=false` (default):** Waits for processing to complete. - -**Note:** If a memory item has a `document_id` that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior). - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.retain_request import RetainRequest -from hindsight_client_api.models.retain_response import RetainResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MemoryApi(api_client) - bank_id = 'bank_id_example' # str | - retain_request = hindsight_client_api.RetainRequest() # RetainRequest | - authorization = 'authorization_example' # str | (optional) - - try: - # Retain memories - api_response = await api_instance.retain_memories(bank_id, retain_request, authorization=authorization) - print("The response of MemoryApi->retain_memories:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MemoryApi->retain_memories: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **retain_request** | [**RetainRequest**](RetainRequest.md)| | - **authorization** | **str**| | [optional] - -### Return type - -[**RetainResponse**](RetainResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/MemoryItem.md b/hindsight-clients/python/hindsight_client_api/docs/MemoryItem.md deleted file mode 100644 index dea0f812..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/MemoryItem.md +++ /dev/null @@ -1,34 +0,0 @@ -# MemoryItem - -Single memory item for retain. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **str** | | -**timestamp** | **datetime** | | [optional] -**context** | **str** | | [optional] -**metadata** | **Dict[str, str]** | | [optional] -**document_id** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.memory_item import MemoryItem - -# TODO update the JSON string below -json = "{}" -# create an instance of MemoryItem from a JSON string -memory_item_instance = MemoryItem.from_json(json) -# print the JSON string representation of the object -print(MemoryItem.to_json()) - -# convert the object into a dict -memory_item_dict = memory_item_instance.to_dict() -# create an instance of MemoryItem from a dict -memory_item_from_dict = MemoryItem.from_dict(memory_item_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/MonitoringApi.md b/hindsight-clients/python/hindsight_client_api/docs/MonitoringApi.md deleted file mode 100644 index 151553d9..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/MonitoringApi.md +++ /dev/null @@ -1,136 +0,0 @@ -# hindsight_client_api.MonitoringApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**health_endpoint_health_get**](MonitoringApi.md#health_endpoint_health_get) | **GET** /health | Health check endpoint -[**metrics_endpoint_metrics_get**](MonitoringApi.md#metrics_endpoint_metrics_get) | **GET** /metrics | Prometheus metrics endpoint - - -# **health_endpoint_health_get** -> object health_endpoint_health_get() - -Health check endpoint - -Checks the health of the API and database connection - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MonitoringApi(api_client) - - try: - # Health check endpoint - api_response = await api_instance.health_endpoint_health_get() - print("The response of MonitoringApi->health_endpoint_health_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MonitoringApi->health_endpoint_health_get: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**object** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **metrics_endpoint_metrics_get** -> object metrics_endpoint_metrics_get() - -Prometheus metrics endpoint - -Exports metrics in Prometheus format for scraping - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.MonitoringApi(api_client) - - try: - # Prometheus metrics endpoint - api_response = await api_instance.metrics_endpoint_metrics_get() - print("The response of MonitoringApi->metrics_endpoint_metrics_get:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling MonitoringApi->metrics_endpoint_metrics_get: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**object** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/OperationResponse.md b/hindsight-clients/python/hindsight_client_api/docs/OperationResponse.md deleted file mode 100644 index fb985ab3..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/OperationResponse.md +++ /dev/null @@ -1,36 +0,0 @@ -# OperationResponse - -Response model for a single async operation. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**task_type** | **str** | | -**items_count** | **int** | | -**document_id** | **str** | | -**created_at** | **str** | | -**status** | **str** | | -**error_message** | **str** | | - -## Example - -```python -from hindsight_client_api.models.operation_response import OperationResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of OperationResponse from a JSON string -operation_response_instance = OperationResponse.from_json(json) -# print the JSON string representation of the object -print(OperationResponse.to_json()) - -# convert the object into a dict -operation_response_dict = operation_response_instance.to_dict() -# create an instance of OperationResponse from a dict -operation_response_from_dict = OperationResponse.from_dict(operation_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/OperationsApi.md b/hindsight-clients/python/hindsight_client_api/docs/OperationsApi.md deleted file mode 100644 index a8f91346..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/OperationsApi.md +++ /dev/null @@ -1,154 +0,0 @@ -# hindsight_client_api.OperationsApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**cancel_operation**](OperationsApi.md#cancel_operation) | **DELETE** /v1/default/banks/{bank_id}/operations/{operation_id} | Cancel a pending async operation -[**list_operations**](OperationsApi.md#list_operations) | **GET** /v1/default/banks/{bank_id}/operations | List async operations - - -# **cancel_operation** -> CancelOperationResponse cancel_operation(bank_id, operation_id, authorization=authorization) - -Cancel a pending async operation - -Cancel a pending async operation by removing it from the queue - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.cancel_operation_response import CancelOperationResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.OperationsApi(api_client) - bank_id = 'bank_id_example' # str | - operation_id = 'operation_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # Cancel a pending async operation - api_response = await api_instance.cancel_operation(bank_id, operation_id, authorization=authorization) - print("The response of OperationsApi->cancel_operation:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling OperationsApi->cancel_operation: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **operation_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**CancelOperationResponse**](CancelOperationResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **list_operations** -> OperationsListResponse list_operations(bank_id, authorization=authorization) - -List async operations - -Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations - -### Example - - -```python -import hindsight_client_api -from hindsight_client_api.models.operations_list_response import OperationsListResponse -from hindsight_client_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to http://localhost -# See configuration.py for a list of all supported configuration parameters. -configuration = hindsight_client_api.Configuration( - host = "http://localhost" -) - - -# Enter a context with an instance of the API client -async with hindsight_client_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = hindsight_client_api.OperationsApi(api_client) - bank_id = 'bank_id_example' # str | - authorization = 'authorization_example' # str | (optional) - - try: - # List async operations - api_response = await api_instance.list_operations(bank_id, authorization=authorization) - print("The response of OperationsApi->list_operations:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling OperationsApi->list_operations: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **bank_id** | **str**| | - **authorization** | **str**| | [optional] - -### Return type - -[**OperationsListResponse**](OperationsListResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful Response | - | -**422** | Validation Error | - | - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/hindsight-clients/python/hindsight_client_api/docs/OperationsListResponse.md b/hindsight-clients/python/hindsight_client_api/docs/OperationsListResponse.md deleted file mode 100644 index 13dbd891..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/OperationsListResponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# OperationsListResponse - -Response model for list operations endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_id** | **str** | | -**operations** | [**List[OperationResponse]**](OperationResponse.md) | | - -## Example - -```python -from hindsight_client_api.models.operations_list_response import OperationsListResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of OperationsListResponse from a JSON string -operations_list_response_instance = OperationsListResponse.from_json(json) -# print the JSON string representation of the object -print(OperationsListResponse.to_json()) - -# convert the object into a dict -operations_list_response_dict = operations_list_response_instance.to_dict() -# create an instance of OperationsListResponse from a dict -operations_list_response_from_dict = OperationsListResponse.from_dict(operations_list_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/RecallRequest.md b/hindsight-clients/python/hindsight_client_api/docs/RecallRequest.md deleted file mode 100644 index a308cec5..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/RecallRequest.md +++ /dev/null @@ -1,36 +0,0 @@ -# RecallRequest - -Request model for recall endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **str** | | -**types** | **List[str]** | | [optional] -**budget** | [**Budget**](Budget.md) | | [optional] -**max_tokens** | **int** | | [optional] [default to 4096] -**trace** | **bool** | | [optional] [default to False] -**query_timestamp** | **str** | | [optional] -**include** | [**IncludeOptions**](IncludeOptions.md) | Options for including additional data (entities are included by default) | [optional] - -## Example - -```python -from hindsight_client_api.models.recall_request import RecallRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of RecallRequest from a JSON string -recall_request_instance = RecallRequest.from_json(json) -# print the JSON string representation of the object -print(RecallRequest.to_json()) - -# convert the object into a dict -recall_request_dict = recall_request_instance.to_dict() -# create an instance of RecallRequest from a dict -recall_request_from_dict = RecallRequest.from_dict(recall_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/RecallResponse.md b/hindsight-clients/python/hindsight_client_api/docs/RecallResponse.md deleted file mode 100644 index fa81a5b3..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/RecallResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# RecallResponse - -Response model for recall endpoints. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**results** | [**List[RecallResult]**](RecallResult.md) | | -**trace** | **Dict[str, object]** | | [optional] -**entities** | [**Dict[str, EntityStateResponse]**](EntityStateResponse.md) | | [optional] -**chunks** | [**Dict[str, ChunkData]**](ChunkData.md) | | [optional] - -## Example - -```python -from hindsight_client_api.models.recall_response import RecallResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of RecallResponse from a JSON string -recall_response_instance = RecallResponse.from_json(json) -# print the JSON string representation of the object -print(RecallResponse.to_json()) - -# convert the object into a dict -recall_response_dict = recall_response_instance.to_dict() -# create an instance of RecallResponse from a dict -recall_response_from_dict = RecallResponse.from_dict(recall_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/RecallResult.md b/hindsight-clients/python/hindsight_client_api/docs/RecallResult.md deleted file mode 100644 index 49a912da..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/RecallResult.md +++ /dev/null @@ -1,40 +0,0 @@ -# RecallResult - -Single recall result item. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | -**text** | **str** | | -**type** | **str** | | [optional] -**entities** | **List[str]** | | [optional] -**context** | **str** | | [optional] -**occurred_start** | **str** | | [optional] -**occurred_end** | **str** | | [optional] -**mentioned_at** | **str** | | [optional] -**document_id** | **str** | | [optional] -**metadata** | **Dict[str, str]** | | [optional] -**chunk_id** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.recall_result import RecallResult - -# TODO update the JSON string below -json = "{}" -# create an instance of RecallResult from a JSON string -recall_result_instance = RecallResult.from_json(json) -# print the JSON string representation of the object -print(RecallResult.to_json()) - -# convert the object into a dict -recall_result_dict = recall_result_instance.to_dict() -# create an instance of RecallResult from a dict -recall_result_from_dict = RecallResult.from_dict(recall_result_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ReflectFact.md b/hindsight-clients/python/hindsight_client_api/docs/ReflectFact.md deleted file mode 100644 index 1022a5a9..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ReflectFact.md +++ /dev/null @@ -1,35 +0,0 @@ -# ReflectFact - -A fact used in think response. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**text** | **str** | | -**type** | **str** | | [optional] -**context** | **str** | | [optional] -**occurred_start** | **str** | | [optional] -**occurred_end** | **str** | | [optional] - -## Example - -```python -from hindsight_client_api.models.reflect_fact import ReflectFact - -# TODO update the JSON string below -json = "{}" -# create an instance of ReflectFact from a JSON string -reflect_fact_instance = ReflectFact.from_json(json) -# print the JSON string representation of the object -print(ReflectFact.to_json()) - -# convert the object into a dict -reflect_fact_dict = reflect_fact_instance.to_dict() -# create an instance of ReflectFact from a dict -reflect_fact_from_dict = ReflectFact.from_dict(reflect_fact_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ReflectIncludeOptions.md b/hindsight-clients/python/hindsight_client_api/docs/ReflectIncludeOptions.md deleted file mode 100644 index c4953fc1..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ReflectIncludeOptions.md +++ /dev/null @@ -1,30 +0,0 @@ -# ReflectIncludeOptions - -Options for including additional data in reflect results. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**facts** | **object** | Options for including facts (based_on) in reflect results. | [optional] - -## Example - -```python -from hindsight_client_api.models.reflect_include_options import ReflectIncludeOptions - -# TODO update the JSON string below -json = "{}" -# create an instance of ReflectIncludeOptions from a JSON string -reflect_include_options_instance = ReflectIncludeOptions.from_json(json) -# print the JSON string representation of the object -print(ReflectIncludeOptions.to_json()) - -# convert the object into a dict -reflect_include_options_dict = reflect_include_options_instance.to_dict() -# create an instance of ReflectIncludeOptions from a dict -reflect_include_options_from_dict = ReflectIncludeOptions.from_dict(reflect_include_options_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ReflectRequest.md b/hindsight-clients/python/hindsight_client_api/docs/ReflectRequest.md deleted file mode 100644 index afb95e23..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ReflectRequest.md +++ /dev/null @@ -1,35 +0,0 @@ -# ReflectRequest - -Request model for reflect endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**query** | **str** | | -**budget** | [**Budget**](Budget.md) | | [optional] -**context** | **str** | | [optional] -**max_tokens** | **int** | Maximum tokens for the response | [optional] [default to 4096] -**include** | [**ReflectIncludeOptions**](ReflectIncludeOptions.md) | Options for including additional data (disabled by default) | [optional] -**response_schema** | **Dict[str, object]** | | [optional] - -## Example - -```python -from hindsight_client_api.models.reflect_request import ReflectRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of ReflectRequest from a JSON string -reflect_request_instance = ReflectRequest.from_json(json) -# print the JSON string representation of the object -print(ReflectRequest.to_json()) - -# convert the object into a dict -reflect_request_dict = reflect_request_instance.to_dict() -# create an instance of ReflectRequest from a dict -reflect_request_from_dict = ReflectRequest.from_dict(reflect_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ReflectResponse.md b/hindsight-clients/python/hindsight_client_api/docs/ReflectResponse.md deleted file mode 100644 index 27f28498..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ReflectResponse.md +++ /dev/null @@ -1,32 +0,0 @@ -# ReflectResponse - -Response model for think endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**text** | **str** | | -**based_on** | [**List[ReflectFact]**](ReflectFact.md) | | [optional] [default to []] -**structured_output** | **Dict[str, object]** | | [optional] - -## Example - -```python -from hindsight_client_api.models.reflect_response import ReflectResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of ReflectResponse from a JSON string -reflect_response_instance = ReflectResponse.from_json(json) -# print the JSON string representation of the object -print(ReflectResponse.to_json()) - -# convert the object into a dict -reflect_response_dict = reflect_response_instance.to_dict() -# create an instance of ReflectResponse from a dict -reflect_response_from_dict = ReflectResponse.from_dict(reflect_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/RetainRequest.md b/hindsight-clients/python/hindsight_client_api/docs/RetainRequest.md deleted file mode 100644 index 5ea27f06..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/RetainRequest.md +++ /dev/null @@ -1,31 +0,0 @@ -# RetainRequest - -Request model for retain endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**List[MemoryItem]**](MemoryItem.md) | | -**var_async** | **bool** | If true, process asynchronously in background. If false, wait for completion (default: false) | [optional] [default to False] - -## Example - -```python -from hindsight_client_api.models.retain_request import RetainRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of RetainRequest from a JSON string -retain_request_instance = RetainRequest.from_json(json) -# print the JSON string representation of the object -print(RetainRequest.to_json()) - -# convert the object into a dict -retain_request_dict = retain_request_instance.to_dict() -# create an instance of RetainRequest from a dict -retain_request_from_dict = RetainRequest.from_dict(retain_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/RetainResponse.md b/hindsight-clients/python/hindsight_client_api/docs/RetainResponse.md deleted file mode 100644 index 89b3f1da..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/RetainResponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# RetainResponse - -Response model for retain endpoint. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**success** | **bool** | | -**bank_id** | **str** | | -**items_count** | **int** | | -**var_async** | **bool** | Whether the operation was processed asynchronously | - -## Example - -```python -from hindsight_client_api.models.retain_response import RetainResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of RetainResponse from a JSON string -retain_response_instance = RetainResponse.from_json(json) -# print the JSON string representation of the object -print(RetainResponse.to_json()) - -# convert the object into a dict -retain_response_dict = retain_response_instance.to_dict() -# create an instance of RetainResponse from a dict -retain_response_from_dict = RetainResponse.from_dict(retain_response_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/UpdateDispositionRequest.md b/hindsight-clients/python/hindsight_client_api/docs/UpdateDispositionRequest.md deleted file mode 100644 index 38389ff0..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/UpdateDispositionRequest.md +++ /dev/null @@ -1,30 +0,0 @@ -# UpdateDispositionRequest - -Request model for updating disposition traits. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**disposition** | [**DispositionTraits**](DispositionTraits.md) | | - -## Example - -```python -from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest - -# TODO update the JSON string below -json = "{}" -# create an instance of UpdateDispositionRequest from a JSON string -update_disposition_request_instance = UpdateDispositionRequest.from_json(json) -# print the JSON string representation of the object -print(UpdateDispositionRequest.to_json()) - -# convert the object into a dict -update_disposition_request_dict = update_disposition_request_instance.to_dict() -# create an instance of UpdateDispositionRequest from a dict -update_disposition_request_from_dict = UpdateDispositionRequest.from_dict(update_disposition_request_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ValidationError.md b/hindsight-clients/python/hindsight_client_api/docs/ValidationError.md deleted file mode 100644 index 69684b4f..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ValidationError.md +++ /dev/null @@ -1,31 +0,0 @@ -# ValidationError - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**loc** | [**List[ValidationErrorLocInner]**](ValidationErrorLocInner.md) | | -**msg** | **str** | | -**type** | **str** | | - -## Example - -```python -from hindsight_client_api.models.validation_error import ValidationError - -# TODO update the JSON string below -json = "{}" -# create an instance of ValidationError from a JSON string -validation_error_instance = ValidationError.from_json(json) -# print the JSON string representation of the object -print(ValidationError.to_json()) - -# convert the object into a dict -validation_error_dict = validation_error_instance.to_dict() -# create an instance of ValidationError from a dict -validation_error_from_dict = ValidationError.from_dict(validation_error_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/docs/ValidationErrorLocInner.md b/hindsight-clients/python/hindsight_client_api/docs/ValidationErrorLocInner.md deleted file mode 100644 index 78ac99a4..00000000 --- a/hindsight-clients/python/hindsight_client_api/docs/ValidationErrorLocInner.md +++ /dev/null @@ -1,28 +0,0 @@ -# ValidationErrorLocInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Example - -```python -from hindsight_client_api.models.validation_error_loc_inner import ValidationErrorLocInner - -# TODO update the JSON string below -json = "{}" -# create an instance of ValidationErrorLocInner from a JSON string -validation_error_loc_inner_instance = ValidationErrorLocInner.from_json(json) -# print the JSON string representation of the object -print(ValidationErrorLocInner.to_json()) - -# convert the object into a dict -validation_error_loc_inner_dict = validation_error_loc_inner_instance.to_dict() -# create an instance of ValidationErrorLocInner from a dict -validation_error_loc_inner_from_dict = ValidationErrorLocInner.from_dict(validation_error_loc_inner_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/hindsight-clients/python/hindsight_client_api/exceptions.py b/hindsight-clients/python/hindsight_client_api/exceptions.py index be4a64fb..5affed0b 100644 --- a/hindsight-clients/python/hindsight_client_api/exceptions.py +++ b/hindsight-clients/python/hindsight_client_api/exceptions.py @@ -150,13 +150,6 @@ class ApiException(OpenApiException): if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) - # Added new conditions for 409 and 422 - if http_resp.status == 409: - raise ConflictException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 422: - raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) - if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -169,11 +162,8 @@ class ApiException(OpenApiException): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - if self.data: - error_message += "HTTP response data: {0}\n".format(self.data) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message @@ -198,16 +188,6 @@ class ServiceException(ApiException): pass -class ConflictException(ApiException): - """Exception for HTTP 409 Conflict.""" - pass - - -class UnprocessableEntityException(ApiException): - """Exception for HTTP 422 Unprocessable Entity.""" - pass - - def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/hindsight-clients/python/hindsight_client_api/models/__init__.py b/hindsight-clients/python/hindsight_client_api/models/__init__.py index 794bf21e..5cb0bab9 100644 --- a/hindsight-clients/python/hindsight_client_api/models/__init__.py +++ b/hindsight-clients/python/hindsight_client_api/models/__init__.py @@ -12,6 +12,7 @@ Do not edit the class manually. """ # noqa: E501 + # import models into model package from hindsight_client_api.models.add_background_request import AddBackgroundRequest from hindsight_client_api.models.background_response import BackgroundResponse @@ -56,4 +57,3 @@ from hindsight_client_api.models.retain_response import RetainResponse from hindsight_client_api.models.update_disposition_request import UpdateDispositionRequest from hindsight_client_api.models.validation_error import ValidationError from hindsight_client_api.models.validation_error_loc_inner import ValidationErrorLocInner - diff --git a/hindsight-clients/python/hindsight_client_api/models/entity_input.py b/hindsight-clients/python/hindsight_client_api/models/entity_input.py index d9af3b92..4a9f9f4e 100644 --- a/hindsight-clients/python/hindsight_client_api/models/entity_input.py +++ b/hindsight-clients/python/hindsight_client_api/models/entity_input.py @@ -22,16 +22,12 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self - class EntityInput(BaseModel): """ Entity to associate with retained content. - """ # noqa: E501 - + """ # noqa: E501 text: StrictStr = Field(description="The entity name/text") - type: Optional[StrictStr] = Field( - default=None, description="Optional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT')" - ) + type: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["text", "type"] model_config = ConfigDict( @@ -40,12 +36,14 @@ class EntityInput(BaseModel): protected_namespaces=(), ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod @@ -54,8 +52,17 @@ class EntityInput(BaseModel): return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias.""" - excluded_fields: Set[str] = set([]) + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) _dict = self.model_dump( by_alias=True, @@ -65,7 +72,7 @@ class EntityInput(BaseModel): # set to None if type (nullable) is None # and model_fields_set contains the field if self.type is None and "type" in self.model_fields_set: - _dict["type"] = None + _dict['type'] = None return _dict @@ -78,5 +85,10 @@ class EntityInput(BaseModel): if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"text": obj.get("text"), "type": obj.get("type")}) + _obj = cls.model_validate({ + "text": obj.get("text"), + "type": obj.get("type") + }) return _obj + + diff --git a/hindsight-clients/python/hindsight_client_api/models/memory_item.py b/hindsight-clients/python/hindsight_client_api/models/memory_item.py index 51eb824d..89b51d05 100644 --- a/hindsight-clients/python/hindsight_client_api/models/memory_item.py +++ b/hindsight-clients/python/hindsight_client_api/models/memory_item.py @@ -18,11 +18,11 @@ import re # noqa: F401 import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional +from hindsight_client_api.models.entity_input import EntityInput from typing import Optional, Set from typing_extensions import Self -from hindsight_client_api.models.entity_input import EntityInput class MemoryItem(BaseModel): """ @@ -33,10 +33,7 @@ class MemoryItem(BaseModel): context: Optional[StrictStr] = None metadata: Optional[Dict[str, StrictStr]] = None document_id: Optional[StrictStr] = None - entities: Optional[List[EntityInput]] = Field( - default=None, - description="Optional entities to combine with auto-extracted entities." - ) + entities: Optional[List[EntityInput]] = None __properties: ClassVar[List[str]] = ["content", "timestamp", "context", "metadata", "document_id", "entities"] model_config = ConfigDict( @@ -78,6 +75,13 @@ class MemoryItem(BaseModel): exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of each item in entities (list) + _items = [] + if self.entities: + for _item_entities in self.entities: + if _item_entities: + _items.append(_item_entities.to_dict()) + _dict['entities'] = _items # set to None if timestamp (nullable) is None # and model_fields_set contains the field if self.timestamp is None and "timestamp" in self.model_fields_set: diff --git a/hindsight-clients/python/hindsight_client_api/rest.py b/hindsight-clients/python/hindsight_client_api/rest.py index f2b05460..0fdaa068 100644 --- a/hindsight-clients/python/hindsight_client_api/rest.py +++ b/hindsight-clients/python/hindsight_client_api/rest.py @@ -52,36 +52,75 @@ class RESTResponse(io.IOBase): class RESTClientObject: def __init__(self, configuration) -> None: - - # maxsize is number of requests to host that are allowed in parallel - self.maxsize = configuration.connection_pool_maxsize - - self.ssl_context = ssl.create_default_context( - cafile=configuration.ssl_ca_cert, - cadata=configuration.ca_cert_data, - ) - if configuration.cert_file: - self.ssl_context.load_cert_chain( - configuration.cert_file, keyfile=configuration.key_file - ) - - if not configuration.verify_ssl: - self.ssl_context.check_hostname = False - self.ssl_context.verify_mode = ssl.CERT_NONE + # Store configuration for deferred initialization + # aiohttp.TCPConnector requires a running event loop, so we defer + # creation until the first request (which runs in async context) + self._configuration = configuration + self._pool_manager: Optional[aiohttp.ClientSession] = None + self._retry_client: Optional[aiohttp_retry.RetryClient] = None self.proxy = configuration.proxy self.proxy_headers = configuration.proxy_headers - self.retries = configuration.retries + def _ensure_session(self) -> None: + """Create aiohttp session lazily (must be called from async context).""" + if self._pool_manager is not None: + return - self.pool_manager: Optional[aiohttp.ClientSession] = None - self.retry_client: Optional[aiohttp_retry.RetryClient] = None + configuration = self._configuration + maxsize = configuration.connection_pool_maxsize - async def close(self) -> None: - if self.pool_manager: - await self.pool_manager.close() - if self.retry_client is not None: - await self.retry_client.close() + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector( + limit=maxsize, + ssl=ssl_context + ) + + self._pool_manager = aiohttp.ClientSession( + connector=connector, + trust_env=True + ) + + retries = configuration.retries + if retries is not None: + self._retry_client = aiohttp_retry.RetryClient( + client_session=self._pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + ) + + @property + def pool_manager(self) -> aiohttp.ClientSession: + """Get the pool manager, initializing if needed.""" + self._ensure_session() + return self._pool_manager + + @property + def retry_client(self) -> Optional[aiohttp_retry.RetryClient]: + """Get the retry client, initializing if needed.""" + self._ensure_session() + return self._retry_client + + async def close(self): + if self._pool_manager is not None: + await self._pool_manager.close() + if self._retry_client is not None: + await self._retry_client.close() async def request( self, @@ -186,27 +225,10 @@ class RESTClientObject: raise ApiException(status=0, reason=msg) pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] - - # https pool manager - if self.pool_manager is None: - self.pool_manager = aiohttp.ClientSession( - connector=aiohttp.TCPConnector(limit=self.maxsize, ssl=self.ssl_context), - trust_env=True, - ) - pool_manager = self.pool_manager - - if self.retries is not None and method in ALLOW_RETRY_METHODS: - if self.retry_client is None: - self.retry_client = aiohttp_retry.RetryClient( - client_session=self.pool_manager, - retry_options=aiohttp_retry.ExponentialRetry( - attempts=self.retries, - factor=2.0, - start_timeout=0.1, - max_timeout=120.0 - ) - ) + if self.retry_client is not None and method in ALLOW_RETRY_METHODS: pool_manager = self.retry_client + else: + pool_manager = self.pool_manager r = await pool_manager.request(**args) diff --git a/hindsight-clients/python/openapi-generator-config.yaml b/hindsight-clients/python/openapi-generator-config.yaml index 1dcf7ff2..3d4bd8d4 100644 --- a/hindsight-clients/python/openapi-generator-config.yaml +++ b/hindsight-clients/python/openapi-generator-config.yaml @@ -3,7 +3,9 @@ projectName: hindsight-client packageVersion: 0.0.7 library: asyncio generateSourceCodeOnly: true -# Don't generate auto tests - we have our own integration tests +# Don't generate auto tests or docs - we have our own globalProperties: apiTests: false modelTests: false + apiDocs: false + modelDocs: false diff --git a/hindsight-clients/rust/Cargo.lock b/hindsight-clients/rust/Cargo.lock index 4c479b05..ee836e72 100644 --- a/hindsight-clients/rust/Cargo.lock +++ b/hindsight-clients/rust/Cargo.lock @@ -26,28 +26,6 @@ dependencies = [ "libc", ] -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "atomic-waker" version = "1.1.2" @@ -86,9 +64,9 @@ checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" [[package]] name = "cc" -version = "1.2.50" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f50d563227a1c37cc0a263f64eca3334388c01c5e4c4861a9def205c614383c" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ "find-msvc-tools", "shlex", @@ -180,9 +158,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" [[package]] name = "fnv" @@ -627,9 +605,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", @@ -637,9 +615,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee5b5339afb4c41626dde77b7a611bd4f2c202b897852b4bcf5d03eddc61010" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" @@ -653,9 +631,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.178" +version = "0.2.179" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" +checksum = "c5a2d376baa530d1238d133232d15e239abad80d05838b4b59354e5268af431f" [[package]] name = "linux-raw-sys" @@ -862,9 +840,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" dependencies = [ "unicode-ident", ] @@ -1109,9 +1087,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62049b2877bf12821e8f9ad256ee38fdc31db7387ec2d3b3f403024de2034aea" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" [[package]] name = "schannel" @@ -1230,15 +1208,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.146" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217ca874ae0207aac254aa02c957ded05585a90892cc8d87f9e5fa49669dadd8" +checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] @@ -1286,10 +1264,11 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.7" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7664a098b8e616bdfcc2dc0e9ac44eb231eedf41db4e9fe95d8d32ec728dedad" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -1329,9 +1308,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.111" +version = "2.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" +checksum = "678faa00651c9eb72dd2020cbdf275d92eccb2400d568e419efdd64838145cb4" dependencies = [ "proc-macro2", "quote", @@ -1381,9 +1360,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.23.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ "fastrand", "getrandom 0.3.4", @@ -1444,9 +1423,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.48.0" +version = "1.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" dependencies = [ "bytes", "libc", @@ -1492,9 +1471,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -1503,12 +1482,10 @@ dependencies = [ [[package]] name = "tokio-test" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468baabc3311435b55dd935f702f42cd1b8abb7e754fb7dfb16bd36aa88f9f7" +checksum = "3f6d24790a10a7af737693a3e8f1d03faef7e6ca0cc99aae5066f533766de545" dependencies = [ - "async-stream", - "bytes", "futures-core", "tokio", "tokio-stream", @@ -1516,9 +1493,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -2122,3 +2099,9 @@ dependencies = [ "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30e0d8dffbae3d840f64bda38e28391faef673a7b5a6017840f2a106c8145868" diff --git a/hindsight-clients/rust/build.rs b/hindsight-clients/rust/build.rs index 80910a95..66bff92e 100644 --- a/hindsight-clients/rust/build.rs +++ b/hindsight-clients/rust/build.rs @@ -73,13 +73,15 @@ fn convert_anyof_to_nullable(value: &mut serde_json::Value) { } fn main() { - // Get the OpenAPI spec path from the project root (two levels up) + // Get the OpenAPI spec path from hindsight-docs/static (single source of truth) let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); let openapi_path = manifest_dir .parent() .unwrap() .parent() .unwrap() + .join("hindsight-docs") + .join("static") .join("openapi.json"); // Tell Cargo to rebuild if the OpenAPI spec changes diff --git a/hindsight-clients/rust/src/lib.rs b/hindsight-clients/rust/src/lib.rs index f1f71062..bd78fcf8 100644 --- a/hindsight-clients/rust/src/lib.rs +++ b/hindsight-clients/rust/src/lib.rs @@ -63,6 +63,7 @@ mod tests { document_id: None, metadata: None, timestamp: None, + entities: None, }, types::MemoryItem { content: "Bob works with Alice on the search team".to_string(), @@ -70,6 +71,7 @@ mod tests { document_id: None, metadata: None, timestamp: None, + entities: None, }, ], }; diff --git a/hindsight-clients/typescript/generated/types.gen.ts b/hindsight-clients/typescript/generated/types.gen.ts index 9ae183ba..6eb760e8 100644 --- a/hindsight-clients/typescript/generated/types.gen.ts +++ b/hindsight-clients/typescript/generated/types.gen.ts @@ -431,6 +431,26 @@ export type EntityIncludeOptions = { max_tokens?: number; }; +/** + * EntityInput + * + * Entity to associate with retained content. + */ +export type EntityInput = { + /** + * Text + * + * The entity name/text + */ + text: string; + /** + * Type + * + * Optional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT') + */ + type?: string | null; +}; + /** * EntityListItem * @@ -660,6 +680,12 @@ export type MemoryItem = { * Optional document ID for this memory item. */ document_id?: string | null; + /** + * Entities + * + * Optional entities to combine with auto-extracted entities. + */ + entities?: Array | null; }; /** diff --git a/hindsight-clients/typescript/openapi-ts.config.ts b/hindsight-clients/typescript/openapi-ts.config.ts index f5836685..71ca734d 100644 --- a/hindsight-clients/typescript/openapi-ts.config.ts +++ b/hindsight-clients/typescript/openapi-ts.config.ts @@ -2,7 +2,7 @@ import { defineConfig } from '@hey-api/openapi-ts'; export default defineConfig({ client: '@hey-api/client-fetch', - input: '../../openapi.json', + input: '../../hindsight-docs/static/openapi.json', output: { path: './generated', format: 'prettier', diff --git a/hindsight-dev/hindsight_dev/generate_openapi.py b/hindsight-dev/hindsight_dev/generate_openapi.py index 62f7c216..a473c14c 100644 --- a/hindsight-dev/hindsight_dev/generate_openapi.py +++ b/hindsight-dev/hindsight_dev/generate_openapi.py @@ -16,11 +16,11 @@ from hindsight_api.api import create_app def generate_openapi_spec(output_path: str = None): """Generate OpenAPI spec and save to file.""" - # Default to root openapi.json if no path specified + # Default to hindsight-docs/static/openapi.json (single source of truth) if output_path is None: # Get the root of the project (3 levels up from this file) root_dir = Path(__file__).parent.parent.parent - output_path = str(root_dir / "openapi.json") + output_path = str(root_dir / "hindsight-docs" / "static" / "openapi.json") # Create a temporary memory instance for OpenAPI generation _memory = MemoryEngine( diff --git a/hindsight-docs/docs/changelog/index.md b/hindsight-docs/docs/changelog/index.md index 2ec56ff3..a00a5c1a 100644 --- a/hindsight-docs/docs/changelog/index.md +++ b/hindsight-docs/docs/changelog/index.md @@ -8,6 +8,27 @@ This changelog highlights user-facing changes only. Internal maintenance, CI/CD, For full release details, see [GitHub Releases](https://github.com/vectorize-io/hindsight/releases). +## [0.2.0](https://github.com/vectorize-io/hindsight/releases/tag/v0.2.0) + +**Features** + +- Add additional model provider support, including Anthropic Claude and LM Studio. ([`787ed60`](https://github.com/vectorize-io/hindsight/commit/787ed60)) +- Add multi-bank access and new MCP tools for interacting with multiple memory banks via MCP. ([`6b5f593`](https://github.com/vectorize-io/hindsight/commit/6b5f593)) +- Allow supplying custom entities when retaining memories via the retain endpoint. ([`dd59bc8`](https://github.com/vectorize-io/hindsight/commit/dd59bc8)) +- Enhance the /reflect endpoint with max_tokens control and optional structured output responses. ([`d49e820`](https://github.com/vectorize-io/hindsight/commit/d49e820)) + + +**Improvements** + +- Improve local LLM support for reasoning-capable models and streamline Docker startup for local deployments. ([`eea0f27`](https://github.com/vectorize-io/hindsight/commit/eea0f27)) +- Support operation validator extensions and return proper HTTP errors when validation fails. ([`ce45d30`](https://github.com/vectorize-io/hindsight/commit/ce45d30)) +- Add configurable observation thresholds to control when observations are created/updated. ([`54e2df0`](https://github.com/vectorize-io/hindsight/commit/54e2df0)) +- Improve graph visualization to the control plane for exploring memory relationships. ([`1a62069`](https://github.com/vectorize-io/hindsight/commit/1a62069)) + +**Bug Fixes** + +- Fix MCP server lifecycle handling so MCP lifespan is correctly tied to the FastAPI app lifespan. ([`6b78f7d`](https://github.com/vectorize-io/hindsight/commit/6b78f7d)) + ## [0.1.15](https://github.com/vectorize-io/hindsight/releases/tag/v0.1.15) **Features** diff --git a/hindsight-docs/docusaurus.config.ts b/hindsight-docs/docusaurus.config.ts index 97bafeec..30a3b0ab 100644 --- a/hindsight-docs/docusaurus.config.ts +++ b/hindsight-docs/docusaurus.config.ts @@ -81,7 +81,7 @@ const config: Config = { specs: [ { id: 'hindsight-api', - spec: 'openapi.json', + spec: 'static/openapi.json', route: '/api-reference', url: '/openapi.json', }, diff --git a/hindsight-docs/openapi.json b/hindsight-docs/openapi.json deleted file mode 100644 index 792b296d..00000000 --- a/hindsight-docs/openapi.json +++ /dev/null @@ -1,3509 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Hindsight HTTP API", - "description": "HTTP API for Hindsight", - "contact": { - "name": "Memory System" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.1.0" - }, - "paths": { - "/health": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Health check endpoint", - "description": "Checks the health of the API and database connection", - "operationId": "health_endpoint_health_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/metrics": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Prometheus metrics endpoint", - "description": "Exports metrics in Prometheus format for scraping", - "operationId": "metrics_endpoint_metrics_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/graph": { - "get": { - "tags": [ - "Memory" - ], - "summary": "Get memory graph data", - "description": "Retrieve graph data for visualization, optionally filtered by type (world/experience/opinion). Limited to 1000 most recent items.", - "operationId": "get_graph", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GraphDataResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories/list": { - "get": { - "tags": [ - "Memory" - ], - "summary": "List memory units", - "description": "List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).", - "operationId": "list_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Q" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "title": "Limit" - } - }, - { - "name": "offset", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 0, - "title": "Offset" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListMemoryUnitsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories/recall": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Recall memory", - "description": "Recall memory using semantic similarity and spreading activation.\n\nThe type parameter is optional and must be one of:\n- `world`: General knowledge about people, places, events, and things that happen\n- `experience`: Memories about experience, conversations, actions taken, and tasks performed\n- `opinion`: The bank's formed beliefs, perspectives, and viewpoints\n\nSet `include_entities=true` to get entity observations alongside recall results.", - "operationId": "recall_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecallRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecallResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/reflect": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Reflect and generate answer", - "description": "Reflect and formulate an answer using bank identity, world facts, and opinions.\n\nThis endpoint:\n1. Retrieves experience (conversations and events)\n2. Retrieves world facts relevant to the query\n3. Retrieves existing opinions (bank's perspectives)\n4. Uses LLM to formulate a contextual answer\n5. Extracts and stores any new opinions formed\n6. Returns plain text answer, the facts used, and new opinions", - "operationId": "reflect", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReflectRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReflectResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks": { - "get": { - "tags": [ - "Banks" - ], - "summary": "List all memory banks", - "description": "Get a list of all agents with their profiles", - "operationId": "list_banks", - "parameters": [ - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/stats": { - "get": { - "tags": [ - "Banks" - ], - "summary": "Get statistics for memory bank", - "description": "Get statistics about nodes and links for a specific agent", - "operationId": "get_agent_stats", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankStatsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities": { - "get": { - "tags": [ - "Entities" - ], - "summary": "List entities", - "description": "List all entities (people, organizations, etc.) known by the bank, ordered by mention count.", - "operationId": "list_entities", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "description": "Maximum number of entities to return", - "default": 100, - "title": "Limit" - }, - "description": "Maximum number of entities to return" - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities/{entity_id}": { - "get": { - "tags": [ - "Entities" - ], - "summary": "Get entity details", - "description": "Get detailed information about an entity including observations (mental model).", - "operationId": "get_entity", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "entity_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Entity Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDetailResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate": { - "post": { - "tags": [ - "Entities" - ], - "summary": "Regenerate entity observations", - "description": "Regenerate observations for an entity based on all facts mentioning it.", - "operationId": "regenerate_entity_observations", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "entity_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Entity Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDetailResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/documents": { - "get": { - "tags": [ - "Documents" - ], - "summary": "List documents", - "description": "List documents with pagination and optional search. Documents are the source content from which memory units are extracted.", - "operationId": "list_documents", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Q" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "title": "Limit" - } - }, - { - "name": "offset", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 0, - "title": "Offset" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListDocumentsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/documents/{document_id}": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Get document details", - "description": "Get a specific document including its original text", - "operationId": "get_document", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "document_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Document Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Documents" - ], - "summary": "Delete a document", - "description": "Delete a document and all its associated memory units and links.\n\nThis will cascade delete:\n- The document itself\n- All memory units extracted from this document\n- All links (temporal, semantic, entity) associated with those memory units\n\nThis operation cannot be undone.", - "operationId": "delete_document", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "document_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Document Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteDocumentResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/chunks/{chunk_id}": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Get chunk details", - "description": "Get a specific chunk by its ID", - "operationId": "get_chunk", - "parameters": [ - { - "name": "chunk_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Chunk Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChunkResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/operations": { - "get": { - "tags": [ - "Operations" - ], - "summary": "List async operations", - "description": "Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations", - "operationId": "list_operations", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OperationsListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/operations/{operation_id}": { - "delete": { - "tags": [ - "Operations" - ], - "summary": "Cancel a pending async operation", - "description": "Cancel a pending async operation by removing it from the queue", - "operationId": "cancel_operation", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "operation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Operation Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelOperationResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/profile": { - "get": { - "tags": [ - "Banks" - ], - "summary": "Get memory bank profile", - "description": "Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists.", - "operationId": "get_bank_profile", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "put": { - "tags": [ - "Banks" - ], - "summary": "Update memory bank disposition", - "description": "Update bank's disposition traits (skepticism, literalism, empathy)", - "operationId": "update_bank_disposition", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateDispositionRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/background": { - "post": { - "tags": [ - "Banks" - ], - "summary": "Add/merge memory bank background", - "description": "Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits.", - "operationId": "add_bank_background", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddBackgroundRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BackgroundResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}": { - "put": { - "tags": [ - "Banks" - ], - "summary": "Create or update memory bank", - "description": "Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults.", - "operationId": "create_or_update_bank", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateBankRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Banks" - ], - "summary": "Delete memory bank", - "description": "Delete an entire memory bank including all memories, entities, documents, and the bank profile itself. This is a destructive operation that cannot be undone.", - "operationId": "delete_bank", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Retain memories", - "description": "Retain memory items with automatic fact extraction.\n\nThis is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the `async` parameter.\n\n**Features:**\n- Efficient batch processing\n- Automatic fact extraction from natural language\n- Entity recognition and linking\n- Document tracking with automatic upsert (when document_id is provided)\n- Temporal and semantic linking\n- Optional asynchronous processing\n\n**The system automatically:**\n1. Extracts semantic facts from the content\n2. Generates embeddings\n3. Deduplicates similar facts\n4. Creates temporal, semantic, and entity links\n5. Tracks document metadata\n\n**When `async=true`:** Returns immediately after queuing. Use the operations endpoint to monitor progress.\n\n**When `async=false` (default):** Waits for processing to complete.\n\n**Note:** If a memory item has a `document_id` that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).", - "operationId": "retain_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RetainRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RetainResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Memory" - ], - "summary": "Clear memory bank memories", - "description": "Delete memory units for a memory bank. Optionally filter by type (world, experience, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (disposition and background) will be preserved.", - "operationId": "clear_bank_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional fact type filter (world, experience, opinion)", - "title": "Type" - }, - "description": "Optional fact type filter (world, experience, opinion)" - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "AddBackgroundRequest": { - "properties": { - "content": { - "type": "string", - "title": "Content", - "description": "New background information to add or merge" - }, - "update_disposition": { - "type": "boolean", - "title": "Update Disposition", - "description": "If true, infer disposition traits from the merged background (default: true)", - "default": true - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "AddBackgroundRequest", - "description": "Request model for adding/merging background information.", - "example": { - "content": "I was born in Texas", - "update_disposition": true - } - }, - "BackgroundResponse": { - "properties": { - "background": { - "type": "string", - "title": "Background" - }, - "disposition": { - "anyOf": [ - { - "$ref": "#/components/schemas/DispositionTraits" - }, - { - "type": "null" - } - ] - } - }, - "type": "object", - "required": [ - "background" - ], - "title": "BackgroundResponse", - "description": "Response model for background update.", - "example": { - "background": "I was born in Texas. I am a software engineer with 10 years of experience.", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - } - } - }, - "BankListItem": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Name" - }, - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - }, - "background": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Background" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "type": "object", - "required": [ - "bank_id", - "disposition" - ], - "title": "BankListItem", - "description": "Bank list item with profile summary." - }, - "BankListResponse": { - "properties": { - "banks": { - "items": { - "$ref": "#/components/schemas/BankListItem" - }, - "type": "array", - "title": "Banks" - } - }, - "type": "object", - "required": [ - "banks" - ], - "title": "BankListResponse", - "description": "Response model for listing all banks.", - "example": { - "banks": [ - { - "background": "I am a software engineer", - "bank_id": "user123", - "created_at": "2024-01-15T10:30:00Z", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice", - "updated_at": "2024-01-16T14:20:00Z" - } - ] - } - }, - "BankProfileResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - }, - "background": { - "type": "string", - "title": "Background" - } - }, - "type": "object", - "required": [ - "bank_id", - "name", - "disposition", - "background" - ], - "title": "BankProfileResponse", - "description": "Response model for bank profile.", - "example": { - "background": "I am a software engineer with 10 years of experience in startups", - "bank_id": "user123", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice" - } - }, - "BankStatsResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "total_nodes": { - "type": "integer", - "title": "Total Nodes" - }, - "total_links": { - "type": "integer", - "title": "Total Links" - }, - "total_documents": { - "type": "integer", - "title": "Total Documents" - }, - "nodes_by_fact_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Nodes By Fact Type" - }, - "links_by_link_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Links By Link Type" - }, - "links_by_fact_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Links By Fact Type" - }, - "links_breakdown": { - "additionalProperties": { - "additionalProperties": { - "type": "integer" - }, - "type": "object" - }, - "type": "object", - "title": "Links Breakdown" - }, - "pending_operations": { - "type": "integer", - "title": "Pending Operations" - }, - "failed_operations": { - "type": "integer", - "title": "Failed Operations" - } - }, - "type": "object", - "required": [ - "bank_id", - "total_nodes", - "total_links", - "total_documents", - "nodes_by_fact_type", - "links_by_link_type", - "links_by_fact_type", - "links_breakdown", - "pending_operations", - "failed_operations" - ], - "title": "BankStatsResponse", - "description": "Response model for bank statistics endpoint.", - "example": { - "bank_id": "user123", - "failed_operations": 0, - "links_breakdown": { - "fact": { - "entity": 40, - "semantic": 60, - "temporal": 100 - } - }, - "links_by_fact_type": { - "fact": 200, - "observation": 40, - "preference": 60 - }, - "links_by_link_type": { - "entity": 50, - "semantic": 100, - "temporal": 150 - }, - "nodes_by_fact_type": { - "fact": 100, - "observation": 20, - "preference": 30 - }, - "pending_operations": 2, - "total_documents": 10, - "total_links": 300, - "total_nodes": 150 - } - }, - "Budget": { - "type": "string", - "enum": [ - "low", - "mid", - "high" - ], - "title": "Budget", - "description": "Budget levels for recall/reflect operations." - }, - "CancelOperationResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "type": "string", - "title": "Message" - }, - "operation_id": { - "type": "string", - "title": "Operation Id" - } - }, - "type": "object", - "required": [ - "success", - "message", - "operation_id" - ], - "title": "CancelOperationResponse", - "description": "Response model for cancel operation endpoint.", - "example": { - "message": "Operation 550e8400-e29b-41d4-a716-446655440000 cancelled", - "operation_id": "550e8400-e29b-41d4-a716-446655440000", - "success": true - } - }, - "ChunkData": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "chunk_index": { - "type": "integer", - "title": "Chunk Index" - }, - "truncated": { - "type": "boolean", - "title": "Truncated", - "description": "Whether the chunk text was truncated due to token limits", - "default": false - } - }, - "type": "object", - "required": [ - "id", - "text", - "chunk_index" - ], - "title": "ChunkData", - "description": "Chunk data for a single chunk." - }, - "ChunkIncludeOptions": { - "properties": { - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for chunks (chunks may be truncated)", - "default": 8192 - } - }, - "type": "object", - "title": "ChunkIncludeOptions", - "description": "Options for including chunks in recall results." - }, - "ChunkResponse": { - "properties": { - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "document_id": { - "type": "string", - "title": "Document Id" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "chunk_index": { - "type": "integer", - "title": "Chunk Index" - }, - "chunk_text": { - "type": "string", - "title": "Chunk Text" - }, - "created_at": { - "type": "string", - "title": "Created At" - } - }, - "type": "object", - "required": [ - "chunk_id", - "document_id", - "bank_id", - "chunk_index", - "chunk_text", - "created_at" - ], - "title": "ChunkResponse", - "description": "Response model for get chunk endpoint.", - "example": { - "bank_id": "user123", - "chunk_id": "user123_session_1_0", - "chunk_index": 0, - "chunk_text": "This is the first chunk of the document...", - "created_at": "2024-01-15T10:30:00Z", - "document_id": "session_1" - } - }, - "CreateBankRequest": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Name" - }, - "disposition": { - "anyOf": [ - { - "$ref": "#/components/schemas/DispositionTraits" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Background" - } - }, - "type": "object", - "title": "CreateBankRequest", - "description": "Request model for creating/updating a bank.", - "example": { - "background": "I am a creative software engineer with 10 years of experience", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice" - } - }, - "DeleteDocumentResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "type": "string", - "title": "Message" - }, - "document_id": { - "type": "string", - "title": "Document Id" - }, - "memory_units_deleted": { - "type": "integer", - "title": "Memory Units Deleted" - } - }, - "type": "object", - "required": [ - "success", - "message", - "document_id", - "memory_units_deleted" - ], - "title": "DeleteDocumentResponse", - "description": "Response model for delete document endpoint.", - "example": { - "document_id": "session_1", - "memory_units_deleted": 5, - "message": "Document 'session_1' and 5 associated memory units deleted successfully", - "success": true - } - }, - "DeleteResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Message" - }, - "deleted_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Deleted Count" - } - }, - "type": "object", - "required": [ - "success" - ], - "title": "DeleteResponse", - "description": "Response model for delete operations.", - "example": { - "deleted_count": 10, - "message": "Deleted successfully", - "success": true - } - }, - "DispositionTraits": { - "properties": { - "skepticism": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Skepticism", - "description": "How skeptical vs trusting (1=trusting, 5=skeptical)" - }, - "literalism": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Literalism", - "description": "How literally to interpret information (1=flexible, 5=literal)" - }, - "empathy": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Empathy", - "description": "How much to consider emotional context (1=detached, 5=empathetic)" - } - }, - "type": "object", - "required": [ - "skepticism", - "literalism", - "empathy" - ], - "title": "DispositionTraits", - "description": "Disposition traits that influence how memories are formed and interpreted.", - "example": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - } - }, - "DocumentResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "original_text": { - "type": "string", - "title": "Original Text" - }, - "content_hash": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Content Hash" - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "updated_at": { - "type": "string", - "title": "Updated At" - }, - "memory_unit_count": { - "type": "integer", - "title": "Memory Unit Count" - } - }, - "type": "object", - "required": [ - "id", - "bank_id", - "original_text", - "content_hash", - "created_at", - "updated_at", - "memory_unit_count" - ], - "title": "DocumentResponse", - "description": "Response model for get document endpoint.", - "example": { - "bank_id": "user123", - "content_hash": "abc123", - "created_at": "2024-01-15T10:30:00Z", - "id": "session_1", - "memory_unit_count": 15, - "original_text": "Full document text here...", - "updated_at": "2024-01-15T10:30:00Z" - } - }, - "EntityDetailResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "mention_count": { - "type": "integer", - "title": "Mention Count" - }, - "first_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "First Seen" - }, - "last_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Seen" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "observations": { - "items": { - "$ref": "#/components/schemas/EntityObservationResponse" - }, - "type": "array", - "title": "Observations" - } - }, - "type": "object", - "required": [ - "id", - "canonical_name", - "mention_count", - "observations" - ], - "title": "EntityDetailResponse", - "description": "Response model for entity detail endpoint.", - "example": { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15, - "observations": [ - { - "mentioned_at": "2024-01-15T10:30:00Z", - "text": "John works at Google" - } - ] - } - }, - "EntityIncludeOptions": { - "properties": { - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for entity observations", - "default": 500 - } - }, - "type": "object", - "title": "EntityIncludeOptions", - "description": "Options for including entity observations in recall results." - }, - "EntityListItem": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "mention_count": { - "type": "integer", - "title": "Mention Count" - }, - "first_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "First Seen" - }, - "last_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Seen" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "id", - "canonical_name", - "mention_count" - ], - "title": "EntityListItem", - "description": "Entity list item with summary.", - "example": { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15 - } - }, - "EntityListResponse": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/EntityListItem" - }, - "type": "array", - "title": "Items" - } - }, - "type": "object", - "required": [ - "items" - ], - "title": "EntityListResponse", - "description": "Response model for entity list endpoint.", - "example": { - "items": [ - { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15 - } - ] - } - }, - "EntityObservationResponse": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "mentioned_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mentioned At" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "EntityObservationResponse", - "description": "An observation about an entity." - }, - "EntityStateResponse": { - "properties": { - "entity_id": { - "type": "string", - "title": "Entity Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "observations": { - "items": { - "$ref": "#/components/schemas/EntityObservationResponse" - }, - "type": "array", - "title": "Observations" - } - }, - "type": "object", - "required": [ - "entity_id", - "canonical_name", - "observations" - ], - "title": "EntityStateResponse", - "description": "Current mental model of an entity." - }, - "FactsIncludeOptions": { - "properties": {}, - "type": "object", - "title": "FactsIncludeOptions", - "description": "Options for including facts (based_on) in reflect results." - }, - "GraphDataResponse": { - "properties": { - "nodes": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Nodes" - }, - "edges": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Edges" - }, - "table_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Table Rows" - }, - "total_units": { - "type": "integer", - "title": "Total Units" - } - }, - "type": "object", - "required": [ - "nodes", - "edges", - "table_rows", - "total_units" - ], - "title": "GraphDataResponse", - "description": "Response model for graph data endpoint.", - "example": { - "edges": [ - { - "from": "1", - "to": "2", - "type": "semantic", - "weight": 0.8 - } - ], - "nodes": [ - { - "id": "1", - "label": "Alice works at Google", - "type": "world" - }, - { - "id": "2", - "label": "Bob went hiking", - "type": "world" - } - ], - "table_rows": [ - { - "context": "Work info", - "date": "2024-01-15 10:30", - "entities": "Alice (PERSON), Google (ORGANIZATION)", - "id": "abc12345...", - "text": "Alice works at Google" - } - ], - "total_units": 2 - } - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "IncludeOptions": { - "properties": { - "entities": { - "anyOf": [ - { - "$ref": "#/components/schemas/EntityIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include entity observations. Set to null to disable entity inclusion.", - "default": { - "max_tokens": 500 - } - }, - "chunks": { - "anyOf": [ - { - "$ref": "#/components/schemas/ChunkIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include raw chunks. Set to {} to enable, null to disable (default: disabled)." - } - }, - "type": "object", - "title": "IncludeOptions", - "description": "Options for including additional data in recall results." - }, - "ListDocumentsResponse": { - "properties": { - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "limit": { - "type": "integer", - "title": "Limit" - }, - "offset": { - "type": "integer", - "title": "Offset" - } - }, - "type": "object", - "required": [ - "items", - "total", - "limit", - "offset" - ], - "title": "ListDocumentsResponse", - "description": "Response model for list documents endpoint.", - "example": { - "items": [ - { - "bank_id": "user123", - "content_hash": "abc123", - "created_at": "2024-01-15T10:30:00Z", - "id": "session_1", - "memory_unit_count": 15, - "text_length": 5420, - "updated_at": "2024-01-15T10:30:00Z" - } - ], - "limit": 100, - "offset": 0, - "total": 50 - } - }, - "ListMemoryUnitsResponse": { - "properties": { - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "limit": { - "type": "integer", - "title": "Limit" - }, - "offset": { - "type": "integer", - "title": "Offset" - } - }, - "type": "object", - "required": [ - "items", - "total", - "limit", - "offset" - ], - "title": "ListMemoryUnitsResponse", - "description": "Response model for list memory units endpoint.", - "example": { - "items": [ - { - "context": "Work conversation", - "date": "2024-01-15T10:30:00Z", - "entities": "Alice (PERSON), Google (ORGANIZATION)", - "id": "550e8400-e29b-41d4-a716-446655440000", - "text": "Alice works at Google on the AI team", - "type": "world" - } - ], - "limit": 100, - "offset": 0, - "total": 150 - } - }, - "MemoryItem": { - "properties": { - "content": { - "type": "string", - "title": "Content" - }, - "timestamp": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "Timestamp" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id", - "description": "Optional document ID for this memory item." - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "MemoryItem", - "description": "Single memory item for retain.", - "example": { - "content": "Alice mentioned she's working on a new ML model", - "context": "team meeting", - "document_id": "meeting_notes_2024_01_15", - "metadata": { - "channel": "engineering", - "source": "slack" - }, - "timestamp": "2024-01-15T10:30:00Z" - } - }, - "OperationResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "task_type": { - "type": "string", - "title": "Task Type" - }, - "items_count": { - "type": "integer", - "title": "Items Count" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id" - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "status": { - "type": "string", - "title": "Status" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - } - }, - "type": "object", - "required": [ - "id", - "task_type", - "items_count", - "document_id", - "created_at", - "status", - "error_message" - ], - "title": "OperationResponse", - "description": "Response model for a single async operation.", - "example": { - "created_at": "2024-01-15T10:30:00Z", - "document_id": "meeting-notes-2024", - "id": "550e8400-e29b-41d4-a716-446655440000", - "items_count": 5, - "status": "pending", - "task_type": "retain" - } - }, - "OperationsListResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "operations": { - "items": { - "$ref": "#/components/schemas/OperationResponse" - }, - "type": "array", - "title": "Operations" - } - }, - "type": "object", - "required": [ - "bank_id", - "operations" - ], - "title": "OperationsListResponse", - "description": "Response model for list operations endpoint.", - "example": { - "bank_id": "user123", - "operations": [ - { - "created_at": "2024-01-15T10:30:00Z", - "id": "550e8400-e29b-41d4-a716-446655440000", - "items_count": 5, - "status": "pending", - "task_type": "retain" - } - ] - } - }, - "RecallRequest": { - "properties": { - "query": { - "type": "string", - "title": "Query" - }, - "types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Types", - "description": "List of fact types to recall (defaults to all if not specified)" - }, - "budget": { - "$ref": "#/components/schemas/Budget", - "default": "mid" - }, - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "default": 4096 - }, - "trace": { - "type": "boolean", - "title": "Trace", - "default": false - }, - "query_timestamp": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Query Timestamp", - "description": "ISO format date string (e.g., '2023-05-30T23:40:00')" - }, - "include": { - "$ref": "#/components/schemas/IncludeOptions", - "description": "Options for including additional data (entities are included by default)" - } - }, - "type": "object", - "required": [ - "query" - ], - "title": "RecallRequest", - "description": "Request model for recall endpoint.", - "example": { - "budget": "mid", - "include": { - "entities": { - "max_tokens": 500 - } - }, - "max_tokens": 4096, - "query": "What did Alice say about machine learning?", - "query_timestamp": "2023-05-30T23:40:00", - "trace": true, - "types": [ - "world", - "experience" - ] - } - }, - "RecallResponse": { - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/RecallResult" - }, - "type": "array", - "title": "Results" - }, - "trace": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Trace" - }, - "entities": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/EntityStateResponse" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Entities", - "description": "Entity states for entities mentioned in results" - }, - "chunks": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/ChunkData" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Chunks", - "description": "Chunks for facts, keyed by chunk_id" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "RecallResponse", - "description": "Response model for recall endpoints.", - "example": { - "chunks": { - "456e7890-e12b-34d5-a678-901234567890": { - "chunk_index": 0, - "id": "456e7890-e12b-34d5-a678-901234567890", - "text": "Alice works at Google on the AI team. She's been there for 3 years..." - } - }, - "entities": { - "Alice": { - "canonical_name": "Alice", - "entity_id": "123e4567-e89b-12d3-a456-426614174001", - "observations": [ - { - "mentioned_at": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team" - } - ] - } - }, - "results": [ - { - "chunk_id": "456e7890-e12b-34d5-a678-901234567890", - "context": "work info", - "entities": [ - "Alice", - "Google" - ], - "id": "123e4567-e89b-12d3-a456-426614174000", - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team", - "type": "world" - } - ], - "trace": { - "num_results": 1, - "query": "What did Alice say about machine learning?", - "time_seconds": 0.123 - } - } - }, - "RecallResult": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - }, - "entities": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Entities" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "occurred_start": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred Start" - }, - "occurred_end": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred End" - }, - "mentioned_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mentioned At" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "chunk_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Chunk Id" - } - }, - "type": "object", - "required": [ - "id", - "text" - ], - "title": "RecallResult", - "description": "Single recall result item.", - "example": { - "chunk_id": "456e7890-e12b-34d5-a678-901234567890", - "context": "work info", - "document_id": "session_abc123", - "entities": [ - "Alice", - "Google" - ], - "id": "123e4567-e89b-12d3-a456-426614174000", - "mentioned_at": "2024-01-15T10:30:00Z", - "metadata": { - "source": "slack" - }, - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team", - "type": "world" - } - }, - "ReflectFact": { - "properties": { - "id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "occurred_start": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred Start" - }, - "occurred_end": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred End" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "ReflectFact", - "description": "A fact used in think response.", - "example": { - "context": "healthcare discussion", - "id": "123e4567-e89b-12d3-a456-426614174000", - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "AI is used in healthcare", - "type": "world" - } - }, - "ReflectIncludeOptions": { - "properties": { - "facts": { - "anyOf": [ - { - "$ref": "#/components/schemas/FactsIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include facts that the answer is based on. Set to {} to enable, null to disable (default: disabled)." - } - }, - "type": "object", - "title": "ReflectIncludeOptions", - "description": "Options for including additional data in reflect results." - }, - "ReflectRequest": { - "properties": { - "query": { - "type": "string", - "title": "Query" - }, - "budget": { - "$ref": "#/components/schemas/Budget", - "default": "low" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for the response", - "default": 4096 - }, - "include": { - "$ref": "#/components/schemas/ReflectIncludeOptions", - "description": "Options for including additional data (disabled by default)" - }, - "response_schema": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Response Schema", - "description": "Optional JSON Schema for structured output. When provided, the response will include a 'structured_output' field with the LLM response parsed according to this schema." - } - }, - "type": "object", - "required": [ - "query" - ], - "title": "ReflectRequest", - "description": "Request model for reflect endpoint.", - "example": { - "budget": "low", - "context": "This is for a research paper on AI ethics", - "include": { - "facts": {} - }, - "max_tokens": 4096, - "query": "What do you think about artificial intelligence?", - "response_schema": { - "properties": { - "summary": { - "type": "string" - }, - "key_points": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "summary", - "key_points" - ], - "type": "object" - } - } - }, - "ReflectResponse": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "based_on": { - "items": { - "$ref": "#/components/schemas/ReflectFact" - }, - "type": "array", - "title": "Based On", - "default": [] - }, - "structured_output": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Structured Output", - "description": "Structured output parsed according to the request's response_schema. Only present when response_schema was provided in the request." - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "ReflectResponse", - "description": "Response model for think endpoint.", - "example": { - "based_on": [ - { - "id": "123", - "text": "AI is used in healthcare", - "type": "world" - }, - { - "id": "456", - "text": "I discussed AI applications last week", - "type": "experience" - } - ], - "structured_output": { - "key_points": [ - "Used in healthcare", - "Discussed recently" - ], - "summary": "AI is transformative" - }, - "text": "Based on my understanding, AI is a transformative technology..." - } - }, - "RetainRequest": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/MemoryItem" - }, - "type": "array", - "title": "Items" - }, - "async": { - "type": "boolean", - "title": "Async", - "description": "If true, process asynchronously in background. If false, wait for completion (default: false)", - "default": false - } - }, - "type": "object", - "required": [ - "items" - ], - "title": "RetainRequest", - "description": "Request model for retain endpoint.", - "example": { - "async": false, - "items": [ - { - "content": "Alice works at Google", - "context": "work", - "document_id": "conversation_123" - }, - { - "content": "Bob went hiking yesterday", - "document_id": "conversation_123", - "timestamp": "2024-01-15T10:00:00Z" - } - ] - } - }, - "RetainResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "items_count": { - "type": "integer", - "title": "Items Count" - }, - "async": { - "type": "boolean", - "title": "Async", - "description": "Whether the operation was processed asynchronously" - } - }, - "type": "object", - "required": [ - "success", - "bank_id", - "items_count", - "async" - ], - "title": "RetainResponse", - "description": "Response model for retain endpoint.", - "example": { - "async": false, - "bank_id": "user123", - "items_count": 2, - "success": true - } - }, - "UpdateDispositionRequest": { - "properties": { - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - } - }, - "type": "object", - "required": [ - "disposition" - ], - "title": "UpdateDispositionRequest", - "description": "Request model for updating disposition traits." - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "type": "array", - "title": "Location" - }, - "msg": { - "type": "string", - "title": "Message" - }, - "type": { - "type": "string", - "title": "Error Type" - } - }, - "type": "object", - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError" - } - } - } -} \ No newline at end of file diff --git a/hindsight-docs/static/openapi.json b/hindsight-docs/static/openapi.json index 792b296d..820f628b 100644 --- a/hindsight-docs/static/openapi.json +++ b/hindsight-docs/static/openapi.json @@ -2297,6 +2297,33 @@ "title": "EntityIncludeOptions", "description": "Options for including entity observations in recall results." }, + "EntityInput": { + "properties": { + "text": { + "type": "string", + "title": "Text", + "description": "The entity name/text" + }, + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Type", + "description": "Optional entity type (e.g., 'PERSON', 'ORG', 'CONCEPT')" + } + }, + "type": "object", + "required": [ + "text" + ], + "title": "EntityInput", + "description": "Entity to associate with retained content." + }, "EntityListItem": { "properties": { "id": { @@ -2717,6 +2744,21 @@ ], "title": "Document Id", "description": "Optional document ID for this memory item." + }, + "entities": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/EntityInput" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Entities", + "description": "Optional entities to combine with auto-extracted entities." } }, "type": "object", @@ -2729,6 +2771,15 @@ "content": "Alice mentioned she's working on a new ML model", "context": "team meeting", "document_id": "meeting_notes_2024_01_15", + "entities": [ + { + "text": "Alice" + }, + { + "text": "ML model", + "type": "CONCEPT" + } + ], "metadata": { "channel": "engineering", "source": "slack" diff --git a/openapi.json b/openapi.json deleted file mode 100644 index 792b296d..00000000 --- a/openapi.json +++ /dev/null @@ -1,3509 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Hindsight HTTP API", - "description": "HTTP API for Hindsight", - "contact": { - "name": "Memory System" - }, - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "0.1.0" - }, - "paths": { - "/health": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Health check endpoint", - "description": "Checks the health of the API and database connection", - "operationId": "health_endpoint_health_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/metrics": { - "get": { - "tags": [ - "Monitoring" - ], - "summary": "Prometheus metrics endpoint", - "description": "Exports metrics in Prometheus format for scraping", - "operationId": "metrics_endpoint_metrics_get", - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": {} - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/graph": { - "get": { - "tags": [ - "Memory" - ], - "summary": "Get memory graph data", - "description": "Retrieve graph data for visualization, optionally filtered by type (world/experience/opinion). Limited to 1000 most recent items.", - "operationId": "get_graph", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GraphDataResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories/list": { - "get": { - "tags": [ - "Memory" - ], - "summary": "List memory units", - "description": "List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).", - "operationId": "list_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Q" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "title": "Limit" - } - }, - { - "name": "offset", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 0, - "title": "Offset" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListMemoryUnitsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories/recall": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Recall memory", - "description": "Recall memory using semantic similarity and spreading activation.\n\nThe type parameter is optional and must be one of:\n- `world`: General knowledge about people, places, events, and things that happen\n- `experience`: Memories about experience, conversations, actions taken, and tasks performed\n- `opinion`: The bank's formed beliefs, perspectives, and viewpoints\n\nSet `include_entities=true` to get entity observations alongside recall results.", - "operationId": "recall_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecallRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RecallResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/reflect": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Reflect and generate answer", - "description": "Reflect and formulate an answer using bank identity, world facts, and opinions.\n\nThis endpoint:\n1. Retrieves experience (conversations and events)\n2. Retrieves world facts relevant to the query\n3. Retrieves existing opinions (bank's perspectives)\n4. Uses LLM to formulate a contextual answer\n5. Extracts and stores any new opinions formed\n6. Returns plain text answer, the facts used, and new opinions", - "operationId": "reflect", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReflectRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReflectResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks": { - "get": { - "tags": [ - "Banks" - ], - "summary": "List all memory banks", - "description": "Get a list of all agents with their profiles", - "operationId": "list_banks", - "parameters": [ - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/stats": { - "get": { - "tags": [ - "Banks" - ], - "summary": "Get statistics for memory bank", - "description": "Get statistics about nodes and links for a specific agent", - "operationId": "get_agent_stats", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankStatsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities": { - "get": { - "tags": [ - "Entities" - ], - "summary": "List entities", - "description": "List all entities (people, organizations, etc.) known by the bank, ordered by mention count.", - "operationId": "list_entities", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "description": "Maximum number of entities to return", - "default": 100, - "title": "Limit" - }, - "description": "Maximum number of entities to return" - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities/{entity_id}": { - "get": { - "tags": [ - "Entities" - ], - "summary": "Get entity details", - "description": "Get detailed information about an entity including observations (mental model).", - "operationId": "get_entity", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "entity_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Entity Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDetailResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate": { - "post": { - "tags": [ - "Entities" - ], - "summary": "Regenerate entity observations", - "description": "Regenerate observations for an entity based on all facts mentioning it.", - "operationId": "regenerate_entity_observations", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "entity_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Entity Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EntityDetailResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/documents": { - "get": { - "tags": [ - "Documents" - ], - "summary": "List documents", - "description": "List documents with pagination and optional search. Documents are the source content from which memory units are extracted.", - "operationId": "list_documents", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "q", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Q" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 100, - "title": "Limit" - } - }, - { - "name": "offset", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 0, - "title": "Offset" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListDocumentsResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/documents/{document_id}": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Get document details", - "description": "Get a specific document including its original text", - "operationId": "get_document", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "document_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Document Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DocumentResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Documents" - ], - "summary": "Delete a document", - "description": "Delete a document and all its associated memory units and links.\n\nThis will cascade delete:\n- The document itself\n- All memory units extracted from this document\n- All links (temporal, semantic, entity) associated with those memory units\n\nThis operation cannot be undone.", - "operationId": "delete_document", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "document_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Document Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteDocumentResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/chunks/{chunk_id}": { - "get": { - "tags": [ - "Documents" - ], - "summary": "Get chunk details", - "description": "Get a specific chunk by its ID", - "operationId": "get_chunk", - "parameters": [ - { - "name": "chunk_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Chunk Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ChunkResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/operations": { - "get": { - "tags": [ - "Operations" - ], - "summary": "List async operations", - "description": "Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations", - "operationId": "list_operations", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OperationsListResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/operations/{operation_id}": { - "delete": { - "tags": [ - "Operations" - ], - "summary": "Cancel a pending async operation", - "description": "Cancel a pending async operation by removing it from the queue", - "operationId": "cancel_operation", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "operation_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Operation Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CancelOperationResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/profile": { - "get": { - "tags": [ - "Banks" - ], - "summary": "Get memory bank profile", - "description": "Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists.", - "operationId": "get_bank_profile", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "put": { - "tags": [ - "Banks" - ], - "summary": "Update memory bank disposition", - "description": "Update bank's disposition traits (skepticism, literalism, empathy)", - "operationId": "update_bank_disposition", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateDispositionRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/background": { - "post": { - "tags": [ - "Banks" - ], - "summary": "Add/merge memory bank background", - "description": "Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits.", - "operationId": "add_bank_background", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AddBackgroundRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BackgroundResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}": { - "put": { - "tags": [ - "Banks" - ], - "summary": "Create or update memory bank", - "description": "Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults.", - "operationId": "create_or_update_bank", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateBankRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BankProfileResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Banks" - ], - "summary": "Delete memory bank", - "description": "Delete an entire memory bank including all memories, entities, documents, and the bank profile itself. This is a destructive operation that cannot be undone.", - "operationId": "delete_bank", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - }, - "/v1/default/banks/{bank_id}/memories": { - "post": { - "tags": [ - "Memory" - ], - "summary": "Retain memories", - "description": "Retain memory items with automatic fact extraction.\n\nThis is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the `async` parameter.\n\n**Features:**\n- Efficient batch processing\n- Automatic fact extraction from natural language\n- Entity recognition and linking\n- Document tracking with automatic upsert (when document_id is provided)\n- Temporal and semantic linking\n- Optional asynchronous processing\n\n**The system automatically:**\n1. Extracts semantic facts from the content\n2. Generates embeddings\n3. Deduplicates similar facts\n4. Creates temporal, semantic, and entity links\n5. Tracks document metadata\n\n**When `async=true`:** Returns immediately after queuing. Use the operations endpoint to monitor progress.\n\n**When `async=false` (default):** Waits for processing to complete.\n\n**Note:** If a memory item has a `document_id` that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).", - "operationId": "retain_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RetainRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RetainResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Memory" - ], - "summary": "Clear memory bank memories", - "description": "Delete memory units for a memory bank. Optionally filter by type (world, experience, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (disposition and background) will be preserved.", - "operationId": "clear_bank_memories", - "parameters": [ - { - "name": "bank_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "title": "Bank Id" - } - }, - { - "name": "type", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Optional fact type filter (world, experience, opinion)", - "title": "Type" - }, - "description": "Optional fact type filter (world, experience, opinion)" - }, - { - "name": "authorization", - "in": "header", - "required": false, - "schema": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Authorization" - } - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "AddBackgroundRequest": { - "properties": { - "content": { - "type": "string", - "title": "Content", - "description": "New background information to add or merge" - }, - "update_disposition": { - "type": "boolean", - "title": "Update Disposition", - "description": "If true, infer disposition traits from the merged background (default: true)", - "default": true - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "AddBackgroundRequest", - "description": "Request model for adding/merging background information.", - "example": { - "content": "I was born in Texas", - "update_disposition": true - } - }, - "BackgroundResponse": { - "properties": { - "background": { - "type": "string", - "title": "Background" - }, - "disposition": { - "anyOf": [ - { - "$ref": "#/components/schemas/DispositionTraits" - }, - { - "type": "null" - } - ] - } - }, - "type": "object", - "required": [ - "background" - ], - "title": "BackgroundResponse", - "description": "Response model for background update.", - "example": { - "background": "I was born in Texas. I am a software engineer with 10 years of experience.", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - } - } - }, - "BankListItem": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Name" - }, - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - }, - "background": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Background" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" - } - }, - "type": "object", - "required": [ - "bank_id", - "disposition" - ], - "title": "BankListItem", - "description": "Bank list item with profile summary." - }, - "BankListResponse": { - "properties": { - "banks": { - "items": { - "$ref": "#/components/schemas/BankListItem" - }, - "type": "array", - "title": "Banks" - } - }, - "type": "object", - "required": [ - "banks" - ], - "title": "BankListResponse", - "description": "Response model for listing all banks.", - "example": { - "banks": [ - { - "background": "I am a software engineer", - "bank_id": "user123", - "created_at": "2024-01-15T10:30:00Z", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice", - "updated_at": "2024-01-16T14:20:00Z" - } - ] - } - }, - "BankProfileResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - }, - "background": { - "type": "string", - "title": "Background" - } - }, - "type": "object", - "required": [ - "bank_id", - "name", - "disposition", - "background" - ], - "title": "BankProfileResponse", - "description": "Response model for bank profile.", - "example": { - "background": "I am a software engineer with 10 years of experience in startups", - "bank_id": "user123", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice" - } - }, - "BankStatsResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "total_nodes": { - "type": "integer", - "title": "Total Nodes" - }, - "total_links": { - "type": "integer", - "title": "Total Links" - }, - "total_documents": { - "type": "integer", - "title": "Total Documents" - }, - "nodes_by_fact_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Nodes By Fact Type" - }, - "links_by_link_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Links By Link Type" - }, - "links_by_fact_type": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Links By Fact Type" - }, - "links_breakdown": { - "additionalProperties": { - "additionalProperties": { - "type": "integer" - }, - "type": "object" - }, - "type": "object", - "title": "Links Breakdown" - }, - "pending_operations": { - "type": "integer", - "title": "Pending Operations" - }, - "failed_operations": { - "type": "integer", - "title": "Failed Operations" - } - }, - "type": "object", - "required": [ - "bank_id", - "total_nodes", - "total_links", - "total_documents", - "nodes_by_fact_type", - "links_by_link_type", - "links_by_fact_type", - "links_breakdown", - "pending_operations", - "failed_operations" - ], - "title": "BankStatsResponse", - "description": "Response model for bank statistics endpoint.", - "example": { - "bank_id": "user123", - "failed_operations": 0, - "links_breakdown": { - "fact": { - "entity": 40, - "semantic": 60, - "temporal": 100 - } - }, - "links_by_fact_type": { - "fact": 200, - "observation": 40, - "preference": 60 - }, - "links_by_link_type": { - "entity": 50, - "semantic": 100, - "temporal": 150 - }, - "nodes_by_fact_type": { - "fact": 100, - "observation": 20, - "preference": 30 - }, - "pending_operations": 2, - "total_documents": 10, - "total_links": 300, - "total_nodes": 150 - } - }, - "Budget": { - "type": "string", - "enum": [ - "low", - "mid", - "high" - ], - "title": "Budget", - "description": "Budget levels for recall/reflect operations." - }, - "CancelOperationResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "type": "string", - "title": "Message" - }, - "operation_id": { - "type": "string", - "title": "Operation Id" - } - }, - "type": "object", - "required": [ - "success", - "message", - "operation_id" - ], - "title": "CancelOperationResponse", - "description": "Response model for cancel operation endpoint.", - "example": { - "message": "Operation 550e8400-e29b-41d4-a716-446655440000 cancelled", - "operation_id": "550e8400-e29b-41d4-a716-446655440000", - "success": true - } - }, - "ChunkData": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "chunk_index": { - "type": "integer", - "title": "Chunk Index" - }, - "truncated": { - "type": "boolean", - "title": "Truncated", - "description": "Whether the chunk text was truncated due to token limits", - "default": false - } - }, - "type": "object", - "required": [ - "id", - "text", - "chunk_index" - ], - "title": "ChunkData", - "description": "Chunk data for a single chunk." - }, - "ChunkIncludeOptions": { - "properties": { - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for chunks (chunks may be truncated)", - "default": 8192 - } - }, - "type": "object", - "title": "ChunkIncludeOptions", - "description": "Options for including chunks in recall results." - }, - "ChunkResponse": { - "properties": { - "chunk_id": { - "type": "string", - "title": "Chunk Id" - }, - "document_id": { - "type": "string", - "title": "Document Id" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "chunk_index": { - "type": "integer", - "title": "Chunk Index" - }, - "chunk_text": { - "type": "string", - "title": "Chunk Text" - }, - "created_at": { - "type": "string", - "title": "Created At" - } - }, - "type": "object", - "required": [ - "chunk_id", - "document_id", - "bank_id", - "chunk_index", - "chunk_text", - "created_at" - ], - "title": "ChunkResponse", - "description": "Response model for get chunk endpoint.", - "example": { - "bank_id": "user123", - "chunk_id": "user123_session_1_0", - "chunk_index": 0, - "chunk_text": "This is the first chunk of the document...", - "created_at": "2024-01-15T10:30:00Z", - "document_id": "session_1" - } - }, - "CreateBankRequest": { - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Name" - }, - "disposition": { - "anyOf": [ - { - "$ref": "#/components/schemas/DispositionTraits" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Background" - } - }, - "type": "object", - "title": "CreateBankRequest", - "description": "Request model for creating/updating a bank.", - "example": { - "background": "I am a creative software engineer with 10 years of experience", - "disposition": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - }, - "name": "Alice" - } - }, - "DeleteDocumentResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "type": "string", - "title": "Message" - }, - "document_id": { - "type": "string", - "title": "Document Id" - }, - "memory_units_deleted": { - "type": "integer", - "title": "Memory Units Deleted" - } - }, - "type": "object", - "required": [ - "success", - "message", - "document_id", - "memory_units_deleted" - ], - "title": "DeleteDocumentResponse", - "description": "Response model for delete document endpoint.", - "example": { - "document_id": "session_1", - "memory_units_deleted": 5, - "message": "Document 'session_1' and 5 associated memory units deleted successfully", - "success": true - } - }, - "DeleteResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Message" - }, - "deleted_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Deleted Count" - } - }, - "type": "object", - "required": [ - "success" - ], - "title": "DeleteResponse", - "description": "Response model for delete operations.", - "example": { - "deleted_count": 10, - "message": "Deleted successfully", - "success": true - } - }, - "DispositionTraits": { - "properties": { - "skepticism": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Skepticism", - "description": "How skeptical vs trusting (1=trusting, 5=skeptical)" - }, - "literalism": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Literalism", - "description": "How literally to interpret information (1=flexible, 5=literal)" - }, - "empathy": { - "type": "integer", - "maximum": 5.0, - "minimum": 1.0, - "title": "Empathy", - "description": "How much to consider emotional context (1=detached, 5=empathetic)" - } - }, - "type": "object", - "required": [ - "skepticism", - "literalism", - "empathy" - ], - "title": "DispositionTraits", - "description": "Disposition traits that influence how memories are formed and interpreted.", - "example": { - "empathy": 3, - "literalism": 3, - "skepticism": 3 - } - }, - "DocumentResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "original_text": { - "type": "string", - "title": "Original Text" - }, - "content_hash": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Content Hash" - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "updated_at": { - "type": "string", - "title": "Updated At" - }, - "memory_unit_count": { - "type": "integer", - "title": "Memory Unit Count" - } - }, - "type": "object", - "required": [ - "id", - "bank_id", - "original_text", - "content_hash", - "created_at", - "updated_at", - "memory_unit_count" - ], - "title": "DocumentResponse", - "description": "Response model for get document endpoint.", - "example": { - "bank_id": "user123", - "content_hash": "abc123", - "created_at": "2024-01-15T10:30:00Z", - "id": "session_1", - "memory_unit_count": 15, - "original_text": "Full document text here...", - "updated_at": "2024-01-15T10:30:00Z" - } - }, - "EntityDetailResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "mention_count": { - "type": "integer", - "title": "Mention Count" - }, - "first_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "First Seen" - }, - "last_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Seen" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "observations": { - "items": { - "$ref": "#/components/schemas/EntityObservationResponse" - }, - "type": "array", - "title": "Observations" - } - }, - "type": "object", - "required": [ - "id", - "canonical_name", - "mention_count", - "observations" - ], - "title": "EntityDetailResponse", - "description": "Response model for entity detail endpoint.", - "example": { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15, - "observations": [ - { - "mentioned_at": "2024-01-15T10:30:00Z", - "text": "John works at Google" - } - ] - } - }, - "EntityIncludeOptions": { - "properties": { - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for entity observations", - "default": 500 - } - }, - "type": "object", - "title": "EntityIncludeOptions", - "description": "Options for including entity observations in recall results." - }, - "EntityListItem": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "mention_count": { - "type": "integer", - "title": "Mention Count" - }, - "first_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "First Seen" - }, - "last_seen": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Last Seen" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - } - }, - "type": "object", - "required": [ - "id", - "canonical_name", - "mention_count" - ], - "title": "EntityListItem", - "description": "Entity list item with summary.", - "example": { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15 - } - }, - "EntityListResponse": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/EntityListItem" - }, - "type": "array", - "title": "Items" - } - }, - "type": "object", - "required": [ - "items" - ], - "title": "EntityListResponse", - "description": "Response model for entity list endpoint.", - "example": { - "items": [ - { - "canonical_name": "John", - "first_seen": "2024-01-15T10:30:00Z", - "id": "123e4567-e89b-12d3-a456-426614174000", - "last_seen": "2024-02-01T14:00:00Z", - "mention_count": 15 - } - ] - } - }, - "EntityObservationResponse": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "mentioned_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mentioned At" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "EntityObservationResponse", - "description": "An observation about an entity." - }, - "EntityStateResponse": { - "properties": { - "entity_id": { - "type": "string", - "title": "Entity Id" - }, - "canonical_name": { - "type": "string", - "title": "Canonical Name" - }, - "observations": { - "items": { - "$ref": "#/components/schemas/EntityObservationResponse" - }, - "type": "array", - "title": "Observations" - } - }, - "type": "object", - "required": [ - "entity_id", - "canonical_name", - "observations" - ], - "title": "EntityStateResponse", - "description": "Current mental model of an entity." - }, - "FactsIncludeOptions": { - "properties": {}, - "type": "object", - "title": "FactsIncludeOptions", - "description": "Options for including facts (based_on) in reflect results." - }, - "GraphDataResponse": { - "properties": { - "nodes": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Nodes" - }, - "edges": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Edges" - }, - "table_rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Table Rows" - }, - "total_units": { - "type": "integer", - "title": "Total Units" - } - }, - "type": "object", - "required": [ - "nodes", - "edges", - "table_rows", - "total_units" - ], - "title": "GraphDataResponse", - "description": "Response model for graph data endpoint.", - "example": { - "edges": [ - { - "from": "1", - "to": "2", - "type": "semantic", - "weight": 0.8 - } - ], - "nodes": [ - { - "id": "1", - "label": "Alice works at Google", - "type": "world" - }, - { - "id": "2", - "label": "Bob went hiking", - "type": "world" - } - ], - "table_rows": [ - { - "context": "Work info", - "date": "2024-01-15 10:30", - "entities": "Alice (PERSON), Google (ORGANIZATION)", - "id": "abc12345...", - "text": "Alice works at Google" - } - ], - "total_units": 2 - } - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "IncludeOptions": { - "properties": { - "entities": { - "anyOf": [ - { - "$ref": "#/components/schemas/EntityIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include entity observations. Set to null to disable entity inclusion.", - "default": { - "max_tokens": 500 - } - }, - "chunks": { - "anyOf": [ - { - "$ref": "#/components/schemas/ChunkIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include raw chunks. Set to {} to enable, null to disable (default: disabled)." - } - }, - "type": "object", - "title": "IncludeOptions", - "description": "Options for including additional data in recall results." - }, - "ListDocumentsResponse": { - "properties": { - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "limit": { - "type": "integer", - "title": "Limit" - }, - "offset": { - "type": "integer", - "title": "Offset" - } - }, - "type": "object", - "required": [ - "items", - "total", - "limit", - "offset" - ], - "title": "ListDocumentsResponse", - "description": "Response model for list documents endpoint.", - "example": { - "items": [ - { - "bank_id": "user123", - "content_hash": "abc123", - "created_at": "2024-01-15T10:30:00Z", - "id": "session_1", - "memory_unit_count": 15, - "text_length": 5420, - "updated_at": "2024-01-15T10:30:00Z" - } - ], - "limit": 100, - "offset": 0, - "total": 50 - } - }, - "ListMemoryUnitsResponse": { - "properties": { - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" - }, - "total": { - "type": "integer", - "title": "Total" - }, - "limit": { - "type": "integer", - "title": "Limit" - }, - "offset": { - "type": "integer", - "title": "Offset" - } - }, - "type": "object", - "required": [ - "items", - "total", - "limit", - "offset" - ], - "title": "ListMemoryUnitsResponse", - "description": "Response model for list memory units endpoint.", - "example": { - "items": [ - { - "context": "Work conversation", - "date": "2024-01-15T10:30:00Z", - "entities": "Alice (PERSON), Google (ORGANIZATION)", - "id": "550e8400-e29b-41d4-a716-446655440000", - "text": "Alice works at Google on the AI team", - "type": "world" - } - ], - "limit": 100, - "offset": 0, - "total": 150 - } - }, - "MemoryItem": { - "properties": { - "content": { - "type": "string", - "title": "Content" - }, - "timestamp": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "Timestamp" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id", - "description": "Optional document ID for this memory item." - } - }, - "type": "object", - "required": [ - "content" - ], - "title": "MemoryItem", - "description": "Single memory item for retain.", - "example": { - "content": "Alice mentioned she's working on a new ML model", - "context": "team meeting", - "document_id": "meeting_notes_2024_01_15", - "metadata": { - "channel": "engineering", - "source": "slack" - }, - "timestamp": "2024-01-15T10:30:00Z" - } - }, - "OperationResponse": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "task_type": { - "type": "string", - "title": "Task Type" - }, - "items_count": { - "type": "integer", - "title": "Items Count" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id" - }, - "created_at": { - "type": "string", - "title": "Created At" - }, - "status": { - "type": "string", - "title": "Status" - }, - "error_message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error Message" - } - }, - "type": "object", - "required": [ - "id", - "task_type", - "items_count", - "document_id", - "created_at", - "status", - "error_message" - ], - "title": "OperationResponse", - "description": "Response model for a single async operation.", - "example": { - "created_at": "2024-01-15T10:30:00Z", - "document_id": "meeting-notes-2024", - "id": "550e8400-e29b-41d4-a716-446655440000", - "items_count": 5, - "status": "pending", - "task_type": "retain" - } - }, - "OperationsListResponse": { - "properties": { - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "operations": { - "items": { - "$ref": "#/components/schemas/OperationResponse" - }, - "type": "array", - "title": "Operations" - } - }, - "type": "object", - "required": [ - "bank_id", - "operations" - ], - "title": "OperationsListResponse", - "description": "Response model for list operations endpoint.", - "example": { - "bank_id": "user123", - "operations": [ - { - "created_at": "2024-01-15T10:30:00Z", - "id": "550e8400-e29b-41d4-a716-446655440000", - "items_count": 5, - "status": "pending", - "task_type": "retain" - } - ] - } - }, - "RecallRequest": { - "properties": { - "query": { - "type": "string", - "title": "Query" - }, - "types": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Types", - "description": "List of fact types to recall (defaults to all if not specified)" - }, - "budget": { - "$ref": "#/components/schemas/Budget", - "default": "mid" - }, - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "default": 4096 - }, - "trace": { - "type": "boolean", - "title": "Trace", - "default": false - }, - "query_timestamp": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Query Timestamp", - "description": "ISO format date string (e.g., '2023-05-30T23:40:00')" - }, - "include": { - "$ref": "#/components/schemas/IncludeOptions", - "description": "Options for including additional data (entities are included by default)" - } - }, - "type": "object", - "required": [ - "query" - ], - "title": "RecallRequest", - "description": "Request model for recall endpoint.", - "example": { - "budget": "mid", - "include": { - "entities": { - "max_tokens": 500 - } - }, - "max_tokens": 4096, - "query": "What did Alice say about machine learning?", - "query_timestamp": "2023-05-30T23:40:00", - "trace": true, - "types": [ - "world", - "experience" - ] - } - }, - "RecallResponse": { - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/RecallResult" - }, - "type": "array", - "title": "Results" - }, - "trace": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Trace" - }, - "entities": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/EntityStateResponse" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Entities", - "description": "Entity states for entities mentioned in results" - }, - "chunks": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/components/schemas/ChunkData" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Chunks", - "description": "Chunks for facts, keyed by chunk_id" - } - }, - "type": "object", - "required": [ - "results" - ], - "title": "RecallResponse", - "description": "Response model for recall endpoints.", - "example": { - "chunks": { - "456e7890-e12b-34d5-a678-901234567890": { - "chunk_index": 0, - "id": "456e7890-e12b-34d5-a678-901234567890", - "text": "Alice works at Google on the AI team. She's been there for 3 years..." - } - }, - "entities": { - "Alice": { - "canonical_name": "Alice", - "entity_id": "123e4567-e89b-12d3-a456-426614174001", - "observations": [ - { - "mentioned_at": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team" - } - ] - } - }, - "results": [ - { - "chunk_id": "456e7890-e12b-34d5-a678-901234567890", - "context": "work info", - "entities": [ - "Alice", - "Google" - ], - "id": "123e4567-e89b-12d3-a456-426614174000", - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team", - "type": "world" - } - ], - "trace": { - "num_results": 1, - "query": "What did Alice say about machine learning?", - "time_seconds": 0.123 - } - } - }, - "RecallResult": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - }, - "entities": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Entities" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "occurred_start": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred Start" - }, - "occurred_end": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred End" - }, - "mentioned_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mentioned At" - }, - "document_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Document Id" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "chunk_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Chunk Id" - } - }, - "type": "object", - "required": [ - "id", - "text" - ], - "title": "RecallResult", - "description": "Single recall result item.", - "example": { - "chunk_id": "456e7890-e12b-34d5-a678-901234567890", - "context": "work info", - "document_id": "session_abc123", - "entities": [ - "Alice", - "Google" - ], - "id": "123e4567-e89b-12d3-a456-426614174000", - "mentioned_at": "2024-01-15T10:30:00Z", - "metadata": { - "source": "slack" - }, - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "Alice works at Google on the AI team", - "type": "world" - } - }, - "ReflectFact": { - "properties": { - "id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Id" - }, - "text": { - "type": "string", - "title": "Text" - }, - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Type" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "occurred_start": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred Start" - }, - "occurred_end": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Occurred End" - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "ReflectFact", - "description": "A fact used in think response.", - "example": { - "context": "healthcare discussion", - "id": "123e4567-e89b-12d3-a456-426614174000", - "occurred_end": "2024-01-15T10:30:00Z", - "occurred_start": "2024-01-15T10:30:00Z", - "text": "AI is used in healthcare", - "type": "world" - } - }, - "ReflectIncludeOptions": { - "properties": { - "facts": { - "anyOf": [ - { - "$ref": "#/components/schemas/FactsIncludeOptions" - }, - { - "type": "null" - } - ], - "description": "Include facts that the answer is based on. Set to {} to enable, null to disable (default: disabled)." - } - }, - "type": "object", - "title": "ReflectIncludeOptions", - "description": "Options for including additional data in reflect results." - }, - "ReflectRequest": { - "properties": { - "query": { - "type": "string", - "title": "Query" - }, - "budget": { - "$ref": "#/components/schemas/Budget", - "default": "low" - }, - "context": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Context" - }, - "max_tokens": { - "type": "integer", - "title": "Max Tokens", - "description": "Maximum tokens for the response", - "default": 4096 - }, - "include": { - "$ref": "#/components/schemas/ReflectIncludeOptions", - "description": "Options for including additional data (disabled by default)" - }, - "response_schema": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Response Schema", - "description": "Optional JSON Schema for structured output. When provided, the response will include a 'structured_output' field with the LLM response parsed according to this schema." - } - }, - "type": "object", - "required": [ - "query" - ], - "title": "ReflectRequest", - "description": "Request model for reflect endpoint.", - "example": { - "budget": "low", - "context": "This is for a research paper on AI ethics", - "include": { - "facts": {} - }, - "max_tokens": 4096, - "query": "What do you think about artificial intelligence?", - "response_schema": { - "properties": { - "summary": { - "type": "string" - }, - "key_points": { - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "summary", - "key_points" - ], - "type": "object" - } - } - }, - "ReflectResponse": { - "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "based_on": { - "items": { - "$ref": "#/components/schemas/ReflectFact" - }, - "type": "array", - "title": "Based On", - "default": [] - }, - "structured_output": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Structured Output", - "description": "Structured output parsed according to the request's response_schema. Only present when response_schema was provided in the request." - } - }, - "type": "object", - "required": [ - "text" - ], - "title": "ReflectResponse", - "description": "Response model for think endpoint.", - "example": { - "based_on": [ - { - "id": "123", - "text": "AI is used in healthcare", - "type": "world" - }, - { - "id": "456", - "text": "I discussed AI applications last week", - "type": "experience" - } - ], - "structured_output": { - "key_points": [ - "Used in healthcare", - "Discussed recently" - ], - "summary": "AI is transformative" - }, - "text": "Based on my understanding, AI is a transformative technology..." - } - }, - "RetainRequest": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/MemoryItem" - }, - "type": "array", - "title": "Items" - }, - "async": { - "type": "boolean", - "title": "Async", - "description": "If true, process asynchronously in background. If false, wait for completion (default: false)", - "default": false - } - }, - "type": "object", - "required": [ - "items" - ], - "title": "RetainRequest", - "description": "Request model for retain endpoint.", - "example": { - "async": false, - "items": [ - { - "content": "Alice works at Google", - "context": "work", - "document_id": "conversation_123" - }, - { - "content": "Bob went hiking yesterday", - "document_id": "conversation_123", - "timestamp": "2024-01-15T10:00:00Z" - } - ] - } - }, - "RetainResponse": { - "properties": { - "success": { - "type": "boolean", - "title": "Success" - }, - "bank_id": { - "type": "string", - "title": "Bank Id" - }, - "items_count": { - "type": "integer", - "title": "Items Count" - }, - "async": { - "type": "boolean", - "title": "Async", - "description": "Whether the operation was processed asynchronously" - } - }, - "type": "object", - "required": [ - "success", - "bank_id", - "items_count", - "async" - ], - "title": "RetainResponse", - "description": "Response model for retain endpoint.", - "example": { - "async": false, - "bank_id": "user123", - "items_count": 2, - "success": true - } - }, - "UpdateDispositionRequest": { - "properties": { - "disposition": { - "$ref": "#/components/schemas/DispositionTraits" - } - }, - "type": "object", - "required": [ - "disposition" - ], - "title": "UpdateDispositionRequest", - "description": "Request model for updating disposition traits." - }, - "ValidationError": { - "properties": { - "loc": { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "integer" - } - ] - }, - "type": "array", - "title": "Location" - }, - "msg": { - "type": "string", - "title": "Message" - }, - "type": { - "type": "string", - "title": "Error Type" - } - }, - "type": "object", - "required": [ - "loc", - "msg", - "type" - ], - "title": "ValidationError" - } - } - } -} \ No newline at end of file diff --git a/scripts/generate-clients.sh b/scripts/generate-clients.sh index 56264701..5d6c213d 100755 --- a/scripts/generate-clients.sh +++ b/scripts/generate-clients.sh @@ -5,10 +5,13 @@ set -e # Note: Rust client is auto-generated at build time via build.rs (uses progenitor) # Usage: ./scripts/generate-clients.sh +# Pin openapi-generator version for reproducible builds across local and CI +OPENAPI_GENERATOR_VERSION="v7.10.0" + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" CLIENTS_DIR="$PROJECT_ROOT/hindsight-clients" -OPENAPI_SPEC="$PROJECT_ROOT/openapi.json" +OPENAPI_SPEC="$PROJECT_ROOT/hindsight-docs/static/openapi.json" echo "==================================================" echo "Hindsight API Client Generator" @@ -38,6 +41,7 @@ if ! command -v docker &> /dev/null; then exit 1 fi echo "✓ Docker available" +echo "✓ Using openapi-generator ${OPENAPI_GENERATOR_VERSION}" echo "" # Generate Rust client @@ -100,12 +104,14 @@ done echo "Generating new client with openapi-generator..." cd "$PYTHON_CLIENT_DIR" -# Run openapi-generator via Docker +# Run openapi-generator via Docker (pinned version for reproducibility) +# Use --user to match current user's UID/GID so generated files are writable docker run --rm \ + --user "$(id -u):$(id -g)" \ -v "$OPENAPI_SPEC:/local/openapi.json" \ -v "$PYTHON_CLIENT_DIR:/local/out" \ -v "$PYTHON_CLIENT_DIR/openapi-generator-config.yaml:/local/config.yaml" \ - openapitools/openapi-generator-cli generate \ + "openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_VERSION}" generate \ -i /local/openapi.json \ -g python \ -o /local/out \ @@ -141,6 +147,162 @@ if [ -f "$PYTHON_CLIENT_DIR/hindsight_client_api_README.md" ]; then rm "$PYTHON_CLIENT_DIR/hindsight_client_api_README.md" fi +# Patch rest.py to defer aiohttp initialization (fixes "no running event loop" error) +# The generated code creates aiohttp.TCPConnector in __init__ which requires a running event loop. +# We patch it to defer initialization until the first request (which runs in async context). +echo "Patching rest.py for deferred aiohttp initialization..." +REST_FILE="$PYTHON_CLIENT_DIR/hindsight_client_api/rest.py" +if [ -f "$REST_FILE" ]; then + cd "$PROJECT_ROOT" + python3 << PATCH_SCRIPT +import re + +rest_file = "$PYTHON_CLIENT_DIR/hindsight_client_api/rest.py" + +with open(rest_file, 'r') as f: + content = f.read() + +# Replace the __init__ method to defer initialization +old_init = '''class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + maxsize = configuration.connection_pool_maxsize + + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector( + limit=maxsize, + ssl=ssl_context + ) + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + # https pool manager + self.pool_manager = aiohttp.ClientSession( + connector=connector, + trust_env=True + ) + + retries = configuration.retries + self.retry_client: Optional[aiohttp_retry.RetryClient] + if retries is not None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + ) + else: + self.retry_client = None''' + +new_init = '''class RESTClientObject: + + def __init__(self, configuration) -> None: + # Store configuration for deferred initialization + # aiohttp.TCPConnector requires a running event loop, so we defer + # creation until the first request (which runs in async context) + self._configuration = configuration + self._pool_manager: Optional[aiohttp.ClientSession] = None + self._retry_client: Optional[aiohttp_retry.RetryClient] = None + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + def _ensure_session(self) -> None: + """Create aiohttp session lazily (must be called from async context).""" + if self._pool_manager is not None: + return + + configuration = self._configuration + maxsize = configuration.connection_pool_maxsize + + ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert + ) + if configuration.cert_file: + ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector( + limit=maxsize, + ssl=ssl_context + ) + + self._pool_manager = aiohttp.ClientSession( + connector=connector, + trust_env=True + ) + + retries = configuration.retries + if retries is not None: + self._retry_client = aiohttp_retry.RetryClient( + client_session=self._pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + ) + + @property + def pool_manager(self) -> aiohttp.ClientSession: + """Get the pool manager, initializing if needed.""" + self._ensure_session() + return self._pool_manager + + @property + def retry_client(self) -> Optional[aiohttp_retry.RetryClient]: + """Get the retry client, initializing if needed.""" + self._ensure_session() + return self._retry_client''' + +if old_init in content: + content = content.replace(old_init, new_init) + + # Also update the close method to handle None pool_manager + old_close = ''' async def close(self): + await self.pool_manager.close() + if self.retry_client is not None: + await self.retry_client.close()''' + + new_close = ''' async def close(self): + if self._pool_manager is not None: + await self._pool_manager.close() + if self._retry_client is not None: + await self._retry_client.close()''' + + content = content.replace(old_close, new_close) + + with open(rest_file, 'w') as f: + f.write(content) + print(" ✓ rest.py patched successfully") +else: + print(" ⚠ Could not find expected pattern in rest.py - skipping patch") +PATCH_SCRIPT +fi + echo "✓ Python client generated at $PYTHON_CLIENT_DIR" echo "" diff --git a/scripts/generate-openapi.sh b/scripts/generate-openapi.sh index aa797417..2c892623 100755 --- a/scripts/generate-openapi.sh +++ b/scripts/generate-openapi.sh @@ -11,11 +11,6 @@ echo "Generating OpenAPI specification..." cd hindsight-dev uv run generate-openapi -echo "" -echo "Copying OpenAPI spec to documentation..." -cp "$ROOT_DIR/openapi.json" "$ROOT_DIR/hindsight-docs/openapi.json" -cp "$ROOT_DIR/openapi.json" "$ROOT_DIR/hindsight-docs/static/openapi.json" - echo "" echo "Building documentation..." cd "$ROOT_DIR/hindsight-docs" diff --git a/uv.lock b/uv.lock index e680d4a6..b502fd21 100644 --- a/uv.lock +++ b/uv.lock @@ -1161,7 +1161,7 @@ wheels = [ [[package]] name = "hindsight-all" -version = "0.1.16" +version = "0.2.0" source = { editable = "hindsight" } dependencies = [ { name = "hindsight-api" }, @@ -1185,7 +1185,7 @@ provides-extras = ["test"] [[package]] name = "hindsight-api" -version = "0.1.16" +version = "0.2.0" source = { editable = "hindsight-api" } dependencies = [ { name = "alembic" }, @@ -1293,7 +1293,7 @@ dev = [ [[package]] name = "hindsight-client" -version = "0.1.16" +version = "0.2.0" source = { editable = "hindsight-clients/python" } dependencies = [ { name = "aiohttp" }, @@ -1327,7 +1327,7 @@ provides-extras = ["test"] [[package]] name = "hindsight-dev" -version = "0.1.16" +version = "0.2.0" source = { editable = "hindsight-dev" } dependencies = [ { name = "hindsight-api" }, @@ -1362,7 +1362,7 @@ dev = [ [[package]] name = "hindsight-embed" -version = "0.1.16" +version = "0.2.0" source = { editable = "hindsight-embed" } dependencies = [ { name = "httpx" },