fleet-memory/hindsight-api/hindsight_api/alembic/versions
Nicolò Boschi aefb3fcf4d
fix: improve async batch retain with large payloads (#366)
* fix: improve async batch retain with large payloads

* fix: improve async batch retain with large payloads

* api

* api

* api

* api

* api

* Clean up perf benchmark: keep only Python files

- Remove README.md and PERFORMANCE_FINDINGS.md
- Remove results/ JSON files (gitignored)
- Remove test_data/ directory
- Keep only __init__.py and retain_perf.py

* docs: explain automatic batch optimization for async retain

- Add section explaining Hindsight automatically handles batch sizing
- Users don't need to manually tune batch sizes with async mode
- Hindsight splits large batches (>10k tokens) into optimized sub-batches
- Include example showing best practices

* docs: remove emojis and code example from performance page

* fix: correct OperationDetails type to match API response

- Change optional fields to use | null instead of ?
- Fixes TypeScript compilation error in control plane build

* fix: use discriminated union for OperationDetails type

- Support both success and error states properly
- Fixes TypeScript error when setting error state

* fix: use unique document_ids in batch retain examples

- Each item in a batch must have unique document_id
- Update both Python and JavaScript examples
- Fixes test-doc-examples CI failure

* chore: trigger CI

* fix: test mocking and duplicate document_ids in examples

- Mock _get_pool() in test_async_retain_tags.py to avoid _initialized error
- Set _initialized = True on mocked MemoryEngine instances
- Fix duplicate document_ids in retain.py and retain.mjs examples

* fix: properly mock async pool/connection and fix more duplicate document_ids

- Use AsyncMock for pool.acquire() to fix 'can't be used in await' error
- Fix duplicate document_ids in retain-async examples (retain.py and retain.mjs)
- Remove batch-level document_id parameter that caused duplicates

* ci: collect all doc example failures and show summary

- Run all Python/Node.js/CLI examples regardless of individual failures
- Collect failure list and display summary at the end
- Show pass/fail count and list of failed files
- Exit with failure only after running all examples

* refactor: extract doc example testing to standalone script

- Create scripts/test-doc-examples.sh to run all examples
- Collects logs of failed examples separately
- Shows full error logs only for failures at the end
- Clean summary with pass/fail counts
- Proper exit codes
- Replaces inline bash in CI workflow

* fix: doc examples - duplicate document_ids and error handling

- retain.py: move document_id to item level to avoid duplicates
- documents.mjs: add error handling for getDocument to show clear error message

* fix: update tests for duplicate document_id validation

- test_async_retain_tags: verify operation structure instead of exact UUID
- test_delete_bank: use unique document_ids (team-doc-1, team-doc-2)
2026-02-16 12:51:42 +01:00
..
5a366d414dce_initial_schema.py feat: support timescale pg_textsearch as text search extension (#359) 2026-02-12 17:38:13 +01:00
b7c4d8e9f1a2_add_chunks_table.py misc: add mcp integration tests and increase test coverage (#98) 2026-01-05 11:16:55 +01:00
c8e5f2a3b4d1_add_retain_params_to_documents.py misc: add mcp integration tests and increase test coverage (#98) 2026-01-05 11:16:55 +01:00
d9f6a3b4c5e2_rename_bank_to_interactions.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
e0a1b2c3d4e5_disposition_to_3_traits.py misc: add mcp integration tests and increase test coverage (#98) 2026-01-05 11:16:55 +01:00
f1a2b3c4d5e6_add_memory_links_composite_index.py fix: improve mpfp retrieval (#146) 2026-01-12 18:58:05 +01:00
g2a3b4c5d6e7_add_tags_column.py feat: add memory tags (#152) 2026-01-13 18:28:40 +01:00
h3c4d5e6f7g8_mental_models_v4.py feat: introduce mental models (#132) 2026-01-16 11:16:41 +01:00
i4d5e6f7g8h9_delete_opinions.py feat: introduce mental models (#132) 2026-01-16 11:16:41 +01:00
j5e6f7g8h9i0_mental_model_versions.py feat: improve mental model refresh and add directives (#166) 2026-01-19 11:38:35 +01:00
k6f7g8h9i0j1_add_directive_subtype.py feat: improve mental model refresh and add directives (#166) 2026-01-19 11:38:35 +01:00
l7g8h9i0j1k2_add_worker_columns.py feat: new 'worker' service (#176) 2026-01-20 10:17:56 +01:00
m8h9i0j1k2l3_mental_model_id_to_text.py feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
n9i0j1k2l3m4_learnings_and_pinned_reflections.py feat: support timescale pg_textsearch as text search extension (#359) 2026-02-12 17:38:13 +01:00
o0j1k2l3m4n5_migrate_mental_models_data.py feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
p1k2l3m4n5o6_new_knowledge_architecture.py feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
q2l3m4n5o6p7_fix_mental_model_fact_type.py feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
r3m4n5o6p7q8_add_reflect_response_to_reflections.py feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
rename_personality_to_disposition.py misc: add mcp integration tests and increase test coverage (#98) 2026-01-05 11:16:55 +01:00
s4n5o6p7q8r9_add_consolidated_at_to_memory_units.py fix: improve mental model consolidation (#197) 2026-01-26 09:54:25 +01:00
t5o6p7q8r9s0_rename_mental_models_to_observations.py chore: internal renames (#204) 2026-01-27 09:53:28 +01:00
u6p7q8r9s0t1_mental_models_text_id.py fix: misc fixes for observations and mental models (#209) 2026-01-27 15:37:57 +01:00
v7q8r9s0t1u2_add_max_tokens_to_mental_models.py fix: misc fixes for observations and mental models (#209) 2026-01-27 15:37:57 +01:00
w8r9s0t1u2v3_fix_mental_models_pk_isolation.py feat: support markdown in reflect and mental models (#307) 2026-02-06 10:49:13 +01:00
x9s0t1u2v3w4_add_bank_config_column.py feat: implement hierarchical configuration (system, tenant, bank) (#329) 2026-02-12 13:14:57 +01:00
y0t1u2v3w4x5_add_result_metadata_gin_index.py fix: improve async batch retain with large payloads (#366) 2026-02-16 12:51:42 +01:00