hindsight-api 0.2.1__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. hindsight_api/admin/__init__.py +1 -0
  2. hindsight_api/admin/cli.py +252 -0
  3. hindsight_api/alembic/versions/f1a2b3c4d5e6_add_memory_links_composite_index.py +44 -0
  4. hindsight_api/alembic/versions/g2a3b4c5d6e7_add_tags_column.py +48 -0
  5. hindsight_api/api/http.py +282 -20
  6. hindsight_api/api/mcp.py +47 -52
  7. hindsight_api/config.py +238 -6
  8. hindsight_api/engine/cross_encoder.py +599 -86
  9. hindsight_api/engine/db_budget.py +284 -0
  10. hindsight_api/engine/db_utils.py +11 -0
  11. hindsight_api/engine/embeddings.py +453 -26
  12. hindsight_api/engine/entity_resolver.py +8 -5
  13. hindsight_api/engine/interface.py +8 -4
  14. hindsight_api/engine/llm_wrapper.py +241 -27
  15. hindsight_api/engine/memory_engine.py +609 -122
  16. hindsight_api/engine/query_analyzer.py +4 -3
  17. hindsight_api/engine/response_models.py +38 -0
  18. hindsight_api/engine/retain/fact_extraction.py +388 -192
  19. hindsight_api/engine/retain/fact_storage.py +34 -8
  20. hindsight_api/engine/retain/link_utils.py +24 -16
  21. hindsight_api/engine/retain/orchestrator.py +52 -17
  22. hindsight_api/engine/retain/types.py +9 -0
  23. hindsight_api/engine/search/graph_retrieval.py +42 -13
  24. hindsight_api/engine/search/link_expansion_retrieval.py +256 -0
  25. hindsight_api/engine/search/mpfp_retrieval.py +362 -117
  26. hindsight_api/engine/search/reranking.py +2 -2
  27. hindsight_api/engine/search/retrieval.py +847 -200
  28. hindsight_api/engine/search/tags.py +172 -0
  29. hindsight_api/engine/search/think_utils.py +1 -1
  30. hindsight_api/engine/search/trace.py +12 -0
  31. hindsight_api/engine/search/tracer.py +24 -1
  32. hindsight_api/engine/search/types.py +21 -0
  33. hindsight_api/engine/task_backend.py +109 -18
  34. hindsight_api/engine/utils.py +1 -1
  35. hindsight_api/extensions/context.py +10 -1
  36. hindsight_api/main.py +56 -4
  37. hindsight_api/metrics.py +433 -48
  38. hindsight_api/migrations.py +141 -1
  39. hindsight_api/models.py +3 -1
  40. hindsight_api/pg0.py +53 -0
  41. hindsight_api/server.py +39 -2
  42. {hindsight_api-0.2.1.dist-info → hindsight_api-0.3.0.dist-info}/METADATA +5 -1
  43. hindsight_api-0.3.0.dist-info/RECORD +82 -0
  44. {hindsight_api-0.2.1.dist-info → hindsight_api-0.3.0.dist-info}/entry_points.txt +1 -0
  45. hindsight_api-0.2.1.dist-info/RECORD +0 -75
  46. {hindsight_api-0.2.1.dist-info → hindsight_api-0.3.0.dist-info}/WHEEL +0 -0
@@ -22,6 +22,7 @@ from pathlib import Path
22
22
 
23
23
  from alembic import command
24
24
  from alembic.config import Config
25
+ from alembic.script.revision import ResolutionError
25
26
  from sqlalchemy import create_engine, text
26
27
 
27
28
  logger = logging.getLogger(__name__)
@@ -78,7 +79,18 @@ def _run_migrations_internal(database_url: str, script_location: str, schema: st
78
79
  alembic_cfg.set_main_option("target_schema", schema)
79
80
 
80
81
  # Run migrations
81
- command.upgrade(alembic_cfg, "head")
82
+ try:
83
+ command.upgrade(alembic_cfg, "head")
84
+ except ResolutionError as e:
85
+ # This happens during rolling deployments when a newer version of the code
86
+ # has already run migrations, and this older replica doesn't have the new
87
+ # migration files. The database is already at a newer revision than we know.
88
+ # This is safe to ignore - the newer code has already applied its migrations.
89
+ logger.warning(
90
+ f"Database is at a newer migration revision than this code version knows about. "
91
+ f"This is expected during rolling deployments. Skipping migrations. Error: {e}"
92
+ )
93
+ return
82
94
 
83
95
  logger.info(f"Database migrations completed successfully for schema '{schema_name}'")
84
96
 
@@ -229,3 +241,131 @@ def check_migration_status(
229
241
  except Exception as e:
230
242
  logger.warning(f"Unable to check migration status: {e}")
231
243
  return None, None
244
+
245
+
246
+ def ensure_embedding_dimension(
247
+ database_url: str,
248
+ required_dimension: int,
249
+ schema: str | None = None,
250
+ ) -> None:
251
+ """
252
+ Ensure the embedding column dimension matches the model's dimension.
253
+
254
+ This function checks the current vector column dimension in the database
255
+ and adjusts it if necessary:
256
+ - If dimensions match: no action needed
257
+ - If dimensions differ and table is empty: ALTER COLUMN to new dimension
258
+ - If dimensions differ and table has data: raise error with migration guidance
259
+
260
+ Args:
261
+ database_url: SQLAlchemy database URL
262
+ required_dimension: The embedding dimension required by the model
263
+ schema: Target PostgreSQL schema name (None for public)
264
+
265
+ Raises:
266
+ RuntimeError: If dimension mismatch with existing data
267
+ """
268
+ schema_name = schema or "public"
269
+
270
+ engine = create_engine(database_url)
271
+ with engine.connect() as conn:
272
+ # Check if memory_units table exists
273
+ table_exists = conn.execute(
274
+ text("""
275
+ SELECT EXISTS (
276
+ SELECT 1 FROM information_schema.tables
277
+ WHERE table_schema = :schema AND table_name = 'memory_units'
278
+ )
279
+ """),
280
+ {"schema": schema_name},
281
+ ).scalar()
282
+
283
+ if not table_exists:
284
+ logger.debug(f"memory_units table does not exist in schema '{schema_name}', skipping dimension check")
285
+ return
286
+
287
+ # Get current column dimension from pg_attribute
288
+ # pgvector stores dimension in atttypmod
289
+ current_dim = conn.execute(
290
+ text("""
291
+ SELECT atttypmod
292
+ FROM pg_attribute a
293
+ JOIN pg_class c ON a.attrelid = c.oid
294
+ JOIN pg_namespace n ON c.relnamespace = n.oid
295
+ WHERE n.nspname = :schema
296
+ AND c.relname = 'memory_units'
297
+ AND a.attname = 'embedding'
298
+ """),
299
+ {"schema": schema_name},
300
+ ).scalar()
301
+
302
+ if current_dim is None:
303
+ logger.warning("Could not determine current embedding dimension, skipping check")
304
+ return
305
+
306
+ # pgvector stores dimension directly in atttypmod (no offset like other types)
307
+ current_dimension = current_dim
308
+
309
+ if current_dimension == required_dimension:
310
+ logger.debug(f"Embedding dimension OK: {current_dimension}")
311
+ return
312
+
313
+ logger.info(
314
+ f"Embedding dimension mismatch: database has {current_dimension}, model requires {required_dimension}"
315
+ )
316
+
317
+ # Check if table has data
318
+ row_count = conn.execute(
319
+ text(f"SELECT COUNT(*) FROM {schema_name}.memory_units WHERE embedding IS NOT NULL")
320
+ ).scalar()
321
+
322
+ if row_count > 0:
323
+ raise RuntimeError(
324
+ f"Cannot change embedding dimension from {current_dimension} to {required_dimension}: "
325
+ f"memory_units table contains {row_count} rows with embeddings. "
326
+ f"To change dimensions, you must either:\n"
327
+ f" 1. Re-embed all data: DELETE FROM {schema_name}.memory_units; then restart\n"
328
+ f" 2. Use a model with {current_dimension}-dimensional embeddings"
329
+ )
330
+
331
+ # Table is empty, safe to alter column
332
+ logger.info(f"Altering embedding column dimension from {current_dimension} to {required_dimension}")
333
+
334
+ # Drop the HNSW index on embedding column if it exists
335
+ # Only drop indexes that use 'hnsw' and reference the 'embedding' column
336
+ conn.execute(
337
+ text(f"""
338
+ DO $$
339
+ DECLARE idx_name TEXT;
340
+ BEGIN
341
+ FOR idx_name IN
342
+ SELECT indexname FROM pg_indexes
343
+ WHERE schemaname = '{schema_name}'
344
+ AND tablename = 'memory_units'
345
+ AND indexdef LIKE '%hnsw%'
346
+ AND indexdef LIKE '%embedding%'
347
+ LOOP
348
+ EXECUTE 'DROP INDEX IF EXISTS {schema_name}.' || idx_name;
349
+ END LOOP;
350
+ END $$;
351
+ """)
352
+ )
353
+
354
+ # Alter the column type
355
+ conn.execute(
356
+ text(f"ALTER TABLE {schema_name}.memory_units ALTER COLUMN embedding TYPE vector({required_dimension})")
357
+ )
358
+ conn.commit()
359
+
360
+ # Recreate the HNSW index
361
+ conn.execute(
362
+ text(f"""
363
+ CREATE INDEX IF NOT EXISTS idx_memory_units_embedding_hnsw
364
+ ON {schema_name}.memory_units
365
+ USING hnsw (embedding vector_cosine_ops)
366
+ WITH (m = 16, ef_construction = 64)
367
+ """)
368
+ )
369
+ conn.commit()
370
+
371
+ logger.info(f"Successfully changed embedding dimension to {required_dimension}")
hindsight_api/models.py CHANGED
@@ -41,6 +41,8 @@ from sqlalchemy.dialects.postgresql import JSONB, TIMESTAMP, UUID
41
41
  from sqlalchemy.ext.asyncio import AsyncAttrs
42
42
  from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship
43
43
 
44
+ from .config import EMBEDDING_DIMENSION
45
+
44
46
 
45
47
  class Base(AsyncAttrs, DeclarativeBase):
46
48
  """Base class for all models."""
@@ -81,7 +83,7 @@ class MemoryUnit(Base):
81
83
  bank_id: Mapped[str] = mapped_column(Text, nullable=False)
82
84
  document_id: Mapped[str | None] = mapped_column(Text)
83
85
  text: Mapped[str] = mapped_column(Text, nullable=False)
84
- embedding = mapped_column(Vector(384)) # pgvector type
86
+ embedding = mapped_column(Vector(EMBEDDING_DIMENSION)) # pgvector type
85
87
  context: Mapped[str | None] = mapped_column(Text)
86
88
  event_date: Mapped[datetime] = mapped_column(
87
89
  TIMESTAMP(timezone=True), nullable=False
hindsight_api/pg0.py CHANGED
@@ -132,3 +132,56 @@ async def stop_embedded_postgres() -> None:
132
132
  global _default_instance
133
133
  if _default_instance:
134
134
  await _default_instance.stop()
135
+
136
+
137
+ def parse_pg0_url(db_url: str) -> tuple[bool, str | None, int | None]:
138
+ """
139
+ Parse a database URL and check if it's a pg0:// embedded database URL.
140
+
141
+ Supports:
142
+ - "pg0" -> default instance "hindsight"
143
+ - "pg0://instance-name" -> named instance
144
+ - "pg0://instance-name:port" -> named instance with explicit port
145
+ - Any other URL (e.g., postgresql://) -> not a pg0 URL
146
+
147
+ Args:
148
+ db_url: The database URL to parse
149
+
150
+ Returns:
151
+ Tuple of (is_pg0, instance_name, port)
152
+ - is_pg0: True if this is a pg0 URL
153
+ - instance_name: The instance name (or None if not pg0)
154
+ - port: The explicit port (or None for auto-assign)
155
+ """
156
+ if db_url == "pg0":
157
+ return True, "hindsight", None
158
+
159
+ if db_url.startswith("pg0://"):
160
+ url_part = db_url[6:] # Remove "pg0://"
161
+ if ":" in url_part:
162
+ instance_name, port_str = url_part.rsplit(":", 1)
163
+ return True, instance_name or "hindsight", int(port_str)
164
+ else:
165
+ return True, url_part or "hindsight", None
166
+
167
+ return False, None, None
168
+
169
+
170
+ async def resolve_database_url(db_url: str) -> str:
171
+ """
172
+ Resolve a database URL, handling pg0:// embedded database URLs.
173
+
174
+ If the URL is a pg0:// URL, starts the embedded PostgreSQL and returns
175
+ the actual postgresql:// connection URL. Otherwise, returns the URL unchanged.
176
+
177
+ Args:
178
+ db_url: Database URL (pg0://, pg0, or postgresql://)
179
+
180
+ Returns:
181
+ The resolved postgresql:// connection URL
182
+ """
183
+ is_pg0, instance_name, port = parse_pg0_url(db_url)
184
+ if is_pg0:
185
+ pg0 = EmbeddedPostgres(name=instance_name, port=port)
186
+ return await pg0.ensure_running()
187
+ return db_url
hindsight_api/server.py CHANGED
@@ -7,6 +7,7 @@ This module provides the ASGI app for uvicorn import string usage:
7
7
  For CLI usage, use the hindsight-api command instead.
8
8
  """
9
9
 
10
+ import logging
10
11
  import os
11
12
  import warnings
12
13
 
@@ -17,6 +18,12 @@ warnings.filterwarnings("ignore", message="websockets.server.WebSocketServerProt
17
18
  from hindsight_api import MemoryEngine
18
19
  from hindsight_api.api import create_app
19
20
  from hindsight_api.config import get_config
21
+ from hindsight_api.extensions import (
22
+ DefaultExtensionContext,
23
+ OperationValidatorExtension,
24
+ TenantExtension,
25
+ load_extension,
26
+ )
20
27
 
21
28
  # Disable tokenizers parallelism to avoid warnings
22
29
  os.environ["TOKENIZERS_PARALLELISM"] = "false"
@@ -25,12 +32,42 @@ os.environ["TOKENIZERS_PARALLELISM"] = "false"
25
32
  config = get_config()
26
33
  config.configure_logging()
27
34
 
35
+ # Load operation validator extension if configured
36
+ operation_validator = load_extension("OPERATION_VALIDATOR", OperationValidatorExtension)
37
+ if operation_validator:
38
+ logging.info(f"Loaded operation validator: {operation_validator.__class__.__name__}")
39
+
40
+ # Load tenant extension if configured
41
+ tenant_extension = load_extension("TENANT", TenantExtension)
42
+ if tenant_extension:
43
+ logging.info(f"Loaded tenant extension: {tenant_extension.__class__.__name__}")
44
+
28
45
  # Create app at module level (required for uvicorn import string)
29
46
  # MemoryEngine reads configuration from environment variables automatically
30
- _memory = MemoryEngine()
47
+ # Note: run_migrations=True by default, but migrations are idempotent so safe with workers
48
+ _memory = MemoryEngine(
49
+ operation_validator=operation_validator,
50
+ tenant_extension=tenant_extension,
51
+ run_migrations=config.run_migrations_on_startup,
52
+ )
53
+
54
+ # Set extension context on tenant extension (needed for schema provisioning)
55
+ if tenant_extension:
56
+ extension_context = DefaultExtensionContext(
57
+ database_url=config.database_url,
58
+ memory_engine=_memory,
59
+ )
60
+ tenant_extension.set_context(extension_context)
61
+ logging.info("Extension context set on tenant extension")
31
62
 
32
63
  # Create unified app with both HTTP and optionally MCP
33
- app = create_app(memory=_memory, http_api_enabled=True, mcp_api_enabled=config.mcp_enabled, mcp_mount_path="/mcp")
64
+ app = create_app(
65
+ memory=_memory,
66
+ http_api_enabled=True,
67
+ mcp_api_enabled=config.mcp_enabled,
68
+ mcp_mount_path="/mcp",
69
+ initialize_memory=True,
70
+ )
34
71
 
35
72
 
36
73
  if __name__ == "__main__":
@@ -1,14 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hindsight-api
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Hindsight: Agent Memory That Works Like Human Memory
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: alembic>=1.17.1
7
7
  Requires-Dist: anthropic>=0.40.0
8
8
  Requires-Dist: asyncpg>=0.29.0
9
+ Requires-Dist: cohere>=5.0.0
9
10
  Requires-Dist: dateparser>=1.2.2
10
11
  Requires-Dist: fastapi[standard]>=0.120.3
11
12
  Requires-Dist: fastmcp>=2.3.0
13
+ Requires-Dist: flashrank>=0.2.0
12
14
  Requires-Dist: google-genai>=1.0.0
13
15
  Requires-Dist: greenlet>=3.2.4
14
16
  Requires-Dist: httpx>=0.27.0
@@ -30,7 +32,9 @@ Requires-Dist: sqlalchemy>=2.0.44
30
32
  Requires-Dist: tiktoken>=0.12.0
31
33
  Requires-Dist: torch>=2.0.0
32
34
  Requires-Dist: transformers<4.46.0,>=4.30.0
35
+ Requires-Dist: typer>=0.9.0
33
36
  Requires-Dist: uvicorn>=0.38.0
37
+ Requires-Dist: uvloop>=0.22.1
34
38
  Requires-Dist: wsproto>=1.0.0
35
39
  Provides-Extra: test
36
40
  Requires-Dist: filelock>=3.0.0; extra == 'test'
@@ -0,0 +1,82 @@
1
+ hindsight_api/__init__.py,sha256=lPhgtKMvT8qjORFKWlhlq-LVdwesIu0gbUYNPZQEFiI,1197
2
+ hindsight_api/banner.py,sha256=BXn-jhkXe4xi-YV4JeuaVvjYhTMs96O43XoOMv4Cd28,4591
3
+ hindsight_api/config.py,sha256=cq6-Np4HuDV9w5qvX9jfrW4HYH1yGnIrpF84eBN9Un4,19903
4
+ hindsight_api/daemon.py,sha256=3CKcO_ENQ57dIWrTsmYUj-V4zvoAB1toNtVh3EVkg-c,5982
5
+ hindsight_api/main.py,sha256=P1jpn2WWF2aZ5WcVBzcvXr9-BqCIqJR7xfEetPDrkvY,12736
6
+ hindsight_api/mcp_local.py,sha256=fL2hpwQSNExcjIwZn1E5vy5No6iZFmw78yRNXxJzri0,7371
7
+ hindsight_api/metrics.py,sha256=go3X7wyFAPkc55HFvu7esiaJXDrUsrSrC8Pq5NjcqU0,20692
8
+ hindsight_api/migrations.py,sha256=V4QL_N1cMe6kNF1ejJ3lPIPFXKU2Pzbaiviws7AyMIY,14624
9
+ hindsight_api/models.py,sha256=FrV6DicpmubfwU4h35Y01XM5Jt-n_RIGAmqzgdJH3eU,13011
10
+ hindsight_api/pg0.py,sha256=XORoiemECidQgBP53EBSCF3i0PJegLRRWKl2hU5UPhE,6390
11
+ hindsight_api/server.py,sha256=MU2ZvKe3KWfxKYZq8EEJPgKMmq5diPkRqfQBaz-yOQI,2483
12
+ hindsight_api/admin/__init__.py,sha256=RvaczuwTxg6ajc_Jlk0EhVz5JqlNB3T8su060gRQwfs,26
13
+ hindsight_api/admin/cli.py,sha256=6n3po14XiYBfFoTXBXQBvafU2--_7rMgs33qmtOl_Po,9353
14
+ hindsight_api/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
15
+ hindsight_api/alembic/env.py,sha256=I4sGdtUo8xcXe95MyD36JQeMod_Bvp9JUkW64Ve4XSM,5808
16
+ hindsight_api/alembic/script.py.mako,sha256=04kgeBtNMa4cCnG8CfQcKt6P6rnloIfj8wy0u_DBydM,704
17
+ hindsight_api/alembic/versions/5a366d414dce_initial_schema.py,sha256=g3G7fV70Z10PZxwTrTmR34OAlEZjQTLJKr-Ol54JqrQ,17665
18
+ hindsight_api/alembic/versions/b7c4d8e9f1a2_add_chunks_table.py,sha256=MaHFU4JczUIFLeUMBTKIV3ocuclil55N9fPPim-HRfk,2599
19
+ hindsight_api/alembic/versions/c8e5f2a3b4d1_add_retain_params_to_documents.py,sha256=ChqkHANauZb4-nBt2uepoZN3q0vRzN6aRsWTGueULiA,1146
20
+ hindsight_api/alembic/versions/d9f6a3b4c5e2_rename_bank_to_interactions.py,sha256=s5_B2D0JdaxO7WM-vWC5Yt6hAtTsAUzJhFGLFSkfuQU,1808
21
+ hindsight_api/alembic/versions/e0a1b2c3d4e5_disposition_to_3_traits.py,sha256=IdDP6fgsYj5fCXAF0QT-3t_wcKJsnf7B0mh7qS-cf_w,3806
22
+ hindsight_api/alembic/versions/f1a2b3c4d5e6_add_memory_links_composite_index.py,sha256=tqkOLVD_p1NXVsIRxAc1mBiNpEosU9WkwrNUEGbc9DY,1598
23
+ hindsight_api/alembic/versions/g2a3b4c5d6e7_add_tags_column.py,sha256=4P7OGJf2t9IWxI0wi8ibC3mrQzjWJaTZ5z5QPr67gig,1772
24
+ hindsight_api/alembic/versions/rename_personality_to_disposition.py,sha256=A29-nDJ2Re4u9jdp2sUw29It808j4h6BpcA4wDHJMJ8,2765
25
+ hindsight_api/api/__init__.py,sha256=npF0AAy8WJhHF5a9ehkNn9_iYLk7RQOk2gdkdFb49Hk,3840
26
+ hindsight_api/api/http.py,sha256=JAnsYU1ovOwksdcSTtsSUtTjMVDNFxIjdmG2cknfQqs,90545
27
+ hindsight_api/api/mcp.py,sha256=RMrCzkza6MzZLzIj-4a9os-OmAMJjRRxIKp0za5BIvE,14849
28
+ hindsight_api/engine/__init__.py,sha256=-BwaSwG9fTT_BBO0c_2MBkxG6-tGdclSzIqsgHw4cnw,1633
29
+ hindsight_api/engine/cross_encoder.py,sha256=UJsjlb8V0Q1QhzM92w8F86IrRVqWMMfjS2it4rtgiRM,31018
30
+ hindsight_api/engine/db_budget.py,sha256=1OmZiuszpuEaYz355QlOqwaupXPd9FrnbyENsFboBkg,8642
31
+ hindsight_api/engine/db_utils.py,sha256=Fq1pXETt8ZPhkWYjrcGbgL6glrwmCGWh3_lYJgHqQPo,3067
32
+ hindsight_api/engine/embeddings.py,sha256=qSaPEJb8-wQhI7njWhwDwb2kKtKjiJ-9CTix5i6xilk,25798
33
+ hindsight_api/engine/entity_resolver.py,sha256=qVvWJHnbGEfh0iUFtc1dbM3IUNwPMsQsmg2rMgiX2DY,23794
34
+ hindsight_api/engine/interface.py,sha256=egpn50n4CRNDOip-ggcGZakj4Ddoj15_BUO0c0bzjI0,16496
35
+ hindsight_api/engine/llm_wrapper.py,sha256=yn_SOmDkiYkD1imaWFqdUXdTn3_xiV04iukSO2Mq3kk,48875
36
+ hindsight_api/engine/memory_engine.py,sha256=DhFkKNz6u-1QS4sGJOCbwBAM2NZJ16Ay7PSCsHtG3nA,191874
37
+ hindsight_api/engine/query_analyzer.py,sha256=7APe0MjBcUxjivcMlM03PmMk_w5FjWvlEe20yAJlHlc,19741
38
+ hindsight_api/engine/response_models.py,sha256=84SyIkt0zITSupLdnRmwyTkge6MzFY6qi9s6TKORSsc,10595
39
+ hindsight_api/engine/task_backend.py,sha256=POs2wcBYJErFIKj3sWMGqs7bPwaiPKpE7q_86ttxhQA,12139
40
+ hindsight_api/engine/utils.py,sha256=IPOzdMh6GbLYmggxa4UAVupY4wh1BzB80pwuxE8KaQU,6994
41
+ hindsight_api/engine/retain/__init__.py,sha256=t6q3-_kf4iYTl9j2PVB6laqMSs6UuPeXBSYMW6HT1sA,1152
42
+ hindsight_api/engine/retain/bank_utils.py,sha256=JjrTE-bixHZKaUyl4uPQ6FV9O7hMOOEijXUnqXhOB5g,14097
43
+ hindsight_api/engine/retain/chunk_storage.py,sha256=zXAqbcFeYpjyWlOoi8zeK5G91zHpF75CUVF-6wsEJpU,2064
44
+ hindsight_api/engine/retain/deduplication.py,sha256=kqs7I7eIc_ppvgAF9GlzL6fSGuEEzrgw17-7NdyUDis,3099
45
+ hindsight_api/engine/retain/embedding_processing.py,sha256=R35oyKYIKjuqC-yZl5Ru56F8xRe0N6KW_9p5PZ9CBi0,1649
46
+ hindsight_api/engine/retain/embedding_utils.py,sha256=uulXIBiA7XNsj16K1VGawR3s5jV-hsAmvmoCi-IodpU,1565
47
+ hindsight_api/engine/retain/entity_processing.py,sha256=0x5b48Im7pWjeqg3xTMIRVhrzd4otc4rSkFBjxgOL9Y,3632
48
+ hindsight_api/engine/retain/fact_extraction.py,sha256=5YP-46fLfxYrJWMSoIMmvg9RXonWALNY1B1RpAFNnnM,61808
49
+ hindsight_api/engine/retain/fact_storage.py,sha256=yFOhC97wIAUcB5cU6KgTISqZ0c_kDAXcPzc6-BkPWtQ,6849
50
+ hindsight_api/engine/retain/link_creation.py,sha256=KP2kGU2VCymJptgw0hjaSdsjvncBgNp3P_A4OB_qx-w,3082
51
+ hindsight_api/engine/retain/link_utils.py,sha256=-QaFF5R03vlE8n2M2074k_sl_4L82J_K5lxjZu_zIes,33376
52
+ hindsight_api/engine/retain/observation_regeneration.py,sha256=GByj4cQ-kp5iM_juryWjKYRYN2H63ttsmcpoUJzIIaI,8259
53
+ hindsight_api/engine/retain/orchestrator.py,sha256=8DDv46x20GE3UcGjI9ZNcCgslpdXiOJ1aS1r4dy916Y,22679
54
+ hindsight_api/engine/retain/types.py,sha256=TZ4Zcpv7DP9Wn6-NnOpColPtnqO8rtHPTqYFnGoVrfo,7770
55
+ hindsight_api/engine/search/__init__.py,sha256=YPz_4g7IOabx078Xwg3RBfbOpJ649NRwNfe0gTI9P1U,802
56
+ hindsight_api/engine/search/fusion.py,sha256=cY81BH9U5RyWrPXbQnrDBghtelDMckZWCke9aqMyNnQ,4220
57
+ hindsight_api/engine/search/graph_retrieval.py,sha256=7VVv2LsGwMH9hMrPtoxDi0_qwAosXCBC3VZ2TJZJ7Ak,10192
58
+ hindsight_api/engine/search/link_expansion_retrieval.py,sha256=eYwnKXpw2Jx06DSqdLbHTwUVPLszEIuO7_09SEz_X8E,9438
59
+ hindsight_api/engine/search/mpfp_retrieval.py,sha256=1OlARy2F_QbkjEZ7Q5wZ34qOr6uyrMNr2KcIWcF9KaE,24475
60
+ hindsight_api/engine/search/observation_utils.py,sha256=rlvGA4oFomMZNCZiJvPIQ0iwGaq9XqhRM530unqziCE,4243
61
+ hindsight_api/engine/search/reranking.py,sha256=hNwte352lTB8A7wlez8-05cdL2_Ghy2kbTs93sGyug4,3929
62
+ hindsight_api/engine/search/retrieval.py,sha256=ydyPHczDIU0NRi00qjROZyf7BBRNU9kWPmtfezr1pfw,51774
63
+ hindsight_api/engine/search/scoring.py,sha256=7jbBtdnow7JU0d8xdW-ZqYvP4s-TYX2tqPhu2DiqHUI,5132
64
+ hindsight_api/engine/search/tags.py,sha256=3oxpm3VonwvowyOXn1FPVby50PakVfxvTT1FuEI_iDo,5843
65
+ hindsight_api/engine/search/temporal_extraction.py,sha256=j7hPqpx2jMdR2BqgFrL-rrV2Hzq8HV24MtjYLJqVl2U,1732
66
+ hindsight_api/engine/search/think_utils.py,sha256=ASbkbMxjIVgN5c3VurapHfiOjG2CaRZGDJvte0KylFA,14056
67
+ hindsight_api/engine/search/trace.py,sha256=cRms7r9u6yuUBAy7d421rvkvl_WuawA0JwgBdfKeuhk,11837
68
+ hindsight_api/engine/search/tracer.py,sha256=Oh8xLOIm5xXEmI0misleuNWknPk9ZYSajmwtjE_E_F0,16332
69
+ hindsight_api/engine/search/types.py,sha256=q03ckzA3LC19TnNeM16dhNu-Ym5dK0TzY-8P5ydQ51A,6554
70
+ hindsight_api/extensions/__init__.py,sha256=gt8RxBwz6JOjbwbPPJ1LGE7ugk1nYkEAlD-LN1ap7FE,1926
71
+ hindsight_api/extensions/base.py,sha256=M7zXuM-tbqDnUwXX1mxAxiFs1eXOzNqIJutKLiUE4mU,2357
72
+ hindsight_api/extensions/context.py,sha256=Qq-uy3hhxO6ioDmf6dPXdnIjs_pdm7lTspDiEhJJmPU,4469
73
+ hindsight_api/extensions/http.py,sha256=c-a1g6R6rzibyReyR-WHz8DjRRGr4rVSyV9KB4UxVVU,2907
74
+ hindsight_api/extensions/loader.py,sha256=UwGM0XH7zHGng_xfHUY0VbOQemj9DmjuDaMst1TrFi8,4170
75
+ hindsight_api/extensions/operation_validator.py,sha256=340M0NqA7juSZimOicIhkZ2j0lc9L4M3Uzr94iGnLKA,10720
76
+ hindsight_api/extensions/tenant.py,sha256=gvngBMn3cJtUfd4P0P_288faNJq00T8zPQkeldEsD3g,1903
77
+ hindsight_api/extensions/builtin/__init__.py,sha256=hLx2oFYZ1JtZhTWfab6AYcR02SWP2gIdbEqnZezT8ek,526
78
+ hindsight_api/extensions/builtin/tenant.py,sha256=lsS0GDEUXmfPBzqhqk2FpN4Z_k5cA3Y3PFNYyiiuZjU,1444
79
+ hindsight_api-0.3.0.dist-info/METADATA,sha256=_5AcFNHsdqfULphbm9ExiOScBGU1_rTWRMDSQZT9WvY,5584
80
+ hindsight_api-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
81
+ hindsight_api-0.3.0.dist-info/entry_points.txt,sha256=PD6Uc6yxrI2_XYZNKBqBQY6ZlxNUb0xjna6kVnVn1wA,156
82
+ hindsight_api-0.3.0.dist-info/RECORD,,
@@ -1,3 +1,4 @@
1
1
  [console_scripts]
2
+ hindsight-admin = hindsight_api.admin.cli:main
2
3
  hindsight-api = hindsight_api.main:main
3
4
  hindsight-local-mcp = hindsight_api.mcp_local:main
@@ -1,75 +0,0 @@
1
- hindsight_api/__init__.py,sha256=lPhgtKMvT8qjORFKWlhlq-LVdwesIu0gbUYNPZQEFiI,1197
2
- hindsight_api/banner.py,sha256=BXn-jhkXe4xi-YV4JeuaVvjYhTMs96O43XoOMv4Cd28,4591
3
- hindsight_api/config.py,sha256=cf1vjDJay-HrTKp0ONGPmgk5szcK7Ynz-UJvjup3jb0,8175
4
- hindsight_api/daemon.py,sha256=3CKcO_ENQ57dIWrTsmYUj-V4zvoAB1toNtVh3EVkg-c,5982
5
- hindsight_api/main.py,sha256=ZhUVwAnkt7Po4y2LsGj_EwUUXLi1t-MDkilp8H_gvro,9969
6
- hindsight_api/mcp_local.py,sha256=fL2hpwQSNExcjIwZn1E5vy5No6iZFmw78yRNXxJzri0,7371
7
- hindsight_api/metrics.py,sha256=sQI5MhC2xj9ONZ6Hdjf6r6r3NbYYd3ExyVOn1Uky49A,7239
8
- hindsight_api/migrations.py,sha256=X5jYkrDhbeFzXOUoPRvPzkGHQsjlZ7oz_P71UI82VT4,9104
9
- hindsight_api/models.py,sha256=p-rM84d9TR4TKIwV8-brLyEqDlSoBuP0bYs4Fl-ju2s,12954
10
- hindsight_api/pg0.py,sha256=SEIwYq8xp0s0YbV3CIy_ioZ5-Bfe8_rxdeP0YasAeXk,4677
11
- hindsight_api/server.py,sha256=OrSd0G-79U07EXFc838c1vzUL-1O6wuxTMqUmMINpGY,1247
12
- hindsight_api/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
13
- hindsight_api/alembic/env.py,sha256=I4sGdtUo8xcXe95MyD36JQeMod_Bvp9JUkW64Ve4XSM,5808
14
- hindsight_api/alembic/script.py.mako,sha256=04kgeBtNMa4cCnG8CfQcKt6P6rnloIfj8wy0u_DBydM,704
15
- hindsight_api/alembic/versions/5a366d414dce_initial_schema.py,sha256=g3G7fV70Z10PZxwTrTmR34OAlEZjQTLJKr-Ol54JqrQ,17665
16
- hindsight_api/alembic/versions/b7c4d8e9f1a2_add_chunks_table.py,sha256=MaHFU4JczUIFLeUMBTKIV3ocuclil55N9fPPim-HRfk,2599
17
- hindsight_api/alembic/versions/c8e5f2a3b4d1_add_retain_params_to_documents.py,sha256=ChqkHANauZb4-nBt2uepoZN3q0vRzN6aRsWTGueULiA,1146
18
- hindsight_api/alembic/versions/d9f6a3b4c5e2_rename_bank_to_interactions.py,sha256=s5_B2D0JdaxO7WM-vWC5Yt6hAtTsAUzJhFGLFSkfuQU,1808
19
- hindsight_api/alembic/versions/e0a1b2c3d4e5_disposition_to_3_traits.py,sha256=IdDP6fgsYj5fCXAF0QT-3t_wcKJsnf7B0mh7qS-cf_w,3806
20
- hindsight_api/alembic/versions/rename_personality_to_disposition.py,sha256=A29-nDJ2Re4u9jdp2sUw29It808j4h6BpcA4wDHJMJ8,2765
21
- hindsight_api/api/__init__.py,sha256=npF0AAy8WJhHF5a9ehkNn9_iYLk7RQOk2gdkdFb49Hk,3840
22
- hindsight_api/api/http.py,sha256=R9S55BnIhDxuAfbEbKD2SuMhB-uSHtgoHkDmBn_hijo,80177
23
- hindsight_api/api/mcp.py,sha256=G4EnptAO9aaKc7QjlX1vp_cNNGDvKHgoBvow1olbjjs,15192
24
- hindsight_api/engine/__init__.py,sha256=-BwaSwG9fTT_BBO0c_2MBkxG6-tGdclSzIqsgHw4cnw,1633
25
- hindsight_api/engine/cross_encoder.py,sha256=5WmUx9yfJdIwZ0nA218O-mMKQJ7EKaPOtwhMiDbG8KQ,10483
26
- hindsight_api/engine/db_utils.py,sha256=0T5tL2SZ49JQihfyZYlTDThIfocKzkr1OpxQpJzPCGE,2687
27
- hindsight_api/engine/embeddings.py,sha256=IEdP5-p6oTJRRKV2JzUEojByJGShUEmkInCyA9wM8tg,10219
28
- hindsight_api/engine/entity_resolver.py,sha256=f-fbUDKCrM9a5Sz10J0rW3jV7dib7BmpyGyassspKXg,23510
29
- hindsight_api/engine/interface.py,sha256=zNfBvK5_RV8st7fHdeIfnVk7AMmbpo3O6uVpXHWgiJ4,16297
30
- hindsight_api/engine/llm_wrapper.py,sha256=_xfGWmHth8No93hLHSCOxFaa18IxodUxDdEYJ6Wjcnc,39956
31
- hindsight_api/engine/memory_engine.py,sha256=69KEpqCiWOdTdzGEPRpVM8zOcRaCHwgGqtiZTw50Afc,169504
32
- hindsight_api/engine/query_analyzer.py,sha256=DKFxmyyVVc59zwKbbGx4D22UVp6TxmD7jAa7cg9FGSU,19641
33
- hindsight_api/engine/response_models.py,sha256=UUNkWGquoBBIU7Fm2GfW1GllcSk_4t-PGB-8_qsKUnA,9115
34
- hindsight_api/engine/task_backend.py,sha256=txtcMUzHW1MigDCW7XsVZc5zqvM9FbR_xF_c9BKokBk,8054
35
- hindsight_api/engine/utils.py,sha256=TwuipFRvN0Pu196JLakzQ71E3GAwySc5q6pByC81Ak4,6991
36
- hindsight_api/engine/retain/__init__.py,sha256=t6q3-_kf4iYTl9j2PVB6laqMSs6UuPeXBSYMW6HT1sA,1152
37
- hindsight_api/engine/retain/bank_utils.py,sha256=JjrTE-bixHZKaUyl4uPQ6FV9O7hMOOEijXUnqXhOB5g,14097
38
- hindsight_api/engine/retain/chunk_storage.py,sha256=zXAqbcFeYpjyWlOoi8zeK5G91zHpF75CUVF-6wsEJpU,2064
39
- hindsight_api/engine/retain/deduplication.py,sha256=kqs7I7eIc_ppvgAF9GlzL6fSGuEEzrgw17-7NdyUDis,3099
40
- hindsight_api/engine/retain/embedding_processing.py,sha256=R35oyKYIKjuqC-yZl5Ru56F8xRe0N6KW_9p5PZ9CBi0,1649
41
- hindsight_api/engine/retain/embedding_utils.py,sha256=uulXIBiA7XNsj16K1VGawR3s5jV-hsAmvmoCi-IodpU,1565
42
- hindsight_api/engine/retain/entity_processing.py,sha256=0x5b48Im7pWjeqg3xTMIRVhrzd4otc4rSkFBjxgOL9Y,3632
43
- hindsight_api/engine/retain/fact_extraction.py,sha256=tR7fvk1eH7xcoQARdCregu3D7ETD9upz4WnhLOUlCcM,51641
44
- hindsight_api/engine/retain/fact_storage.py,sha256=zhIiccW1D4wkgnZMFcbxDeMeHy5v4JGKfEPBIFNLch4,5632
45
- hindsight_api/engine/retain/link_creation.py,sha256=KP2kGU2VCymJptgw0hjaSdsjvncBgNp3P_A4OB_qx-w,3082
46
- hindsight_api/engine/retain/link_utils.py,sha256=w8n_pPzs_rd3EMkb7nv4k_qSZttAKDig93hSSjl-Xbc,32854
47
- hindsight_api/engine/retain/observation_regeneration.py,sha256=GByj4cQ-kp5iM_juryWjKYRYN2H63ttsmcpoUJzIIaI,8259
48
- hindsight_api/engine/retain/orchestrator.py,sha256=Qy6g8Df-k666GPhJK2xPvt5TjyVH4IY8jxiEIg_pUug,21052
49
- hindsight_api/engine/retain/types.py,sha256=dgWFvr1oeAq5y4UFVBXWzUjUKA2WB7nlJ0n9V1Ceuvw,7301
50
- hindsight_api/engine/search/__init__.py,sha256=YPz_4g7IOabx078Xwg3RBfbOpJ649NRwNfe0gTI9P1U,802
51
- hindsight_api/engine/search/fusion.py,sha256=cY81BH9U5RyWrPXbQnrDBghtelDMckZWCke9aqMyNnQ,4220
52
- hindsight_api/engine/search/graph_retrieval.py,sha256=KV1LK_y8R_x4dYwikbZaJTVGPp7kXcrCy0IswaXCD4g,8625
53
- hindsight_api/engine/search/mpfp_retrieval.py,sha256=mgUgHTj1uhjFWaz5vvqffyJPon01WgGjLq0A_gTWszw,13945
54
- hindsight_api/engine/search/observation_utils.py,sha256=rlvGA4oFomMZNCZiJvPIQ0iwGaq9XqhRM530unqziCE,4243
55
- hindsight_api/engine/search/reranking.py,sha256=P4jBDLwh5ZhXCwxMuh74VodYLngtx2X75MXXOIMm19A,3917
56
- hindsight_api/engine/search/retrieval.py,sha256=BfEYbVC3I9dMBKXzDOfcRaS3r2hKCIO9wg5POP-GXSo,25316
57
- hindsight_api/engine/search/scoring.py,sha256=7jbBtdnow7JU0d8xdW-ZqYvP4s-TYX2tqPhu2DiqHUI,5132
58
- hindsight_api/engine/search/temporal_extraction.py,sha256=j7hPqpx2jMdR2BqgFrL-rrV2Hzq8HV24MtjYLJqVl2U,1732
59
- hindsight_api/engine/search/think_utils.py,sha256=9YAmM_GTSiGns08n6xL8eYW4fZnwm_2xwn5FX6g9xaI,13907
60
- hindsight_api/engine/search/trace.py,sha256=UTCmNRfAvIvDFGm5ifkuUk6JOKYrLlA_rPA72Zz_DfI,11217
61
- hindsight_api/engine/search/tracer.py,sha256=hjm8fEESqJnOhsQwmwmvO1gthIO87WC3Pd-iiLPCIEc,15466
62
- hindsight_api/engine/search/types.py,sha256=2cK-5oynPTWc7UxnA7TFnwzNkcujCfOUvVf5VCk_srM,5594
63
- hindsight_api/extensions/__init__.py,sha256=gt8RxBwz6JOjbwbPPJ1LGE7ugk1nYkEAlD-LN1ap7FE,1926
64
- hindsight_api/extensions/base.py,sha256=M7zXuM-tbqDnUwXX1mxAxiFs1eXOzNqIJutKLiUE4mU,2357
65
- hindsight_api/extensions/context.py,sha256=nyp-ARqclo4K8SWwkIGhHAxl43XZIY5JEcuQWTAMo3k,3937
66
- hindsight_api/extensions/http.py,sha256=c-a1g6R6rzibyReyR-WHz8DjRRGr4rVSyV9KB4UxVVU,2907
67
- hindsight_api/extensions/loader.py,sha256=UwGM0XH7zHGng_xfHUY0VbOQemj9DmjuDaMst1TrFi8,4170
68
- hindsight_api/extensions/operation_validator.py,sha256=340M0NqA7juSZimOicIhkZ2j0lc9L4M3Uzr94iGnLKA,10720
69
- hindsight_api/extensions/tenant.py,sha256=gvngBMn3cJtUfd4P0P_288faNJq00T8zPQkeldEsD3g,1903
70
- hindsight_api/extensions/builtin/__init__.py,sha256=hLx2oFYZ1JtZhTWfab6AYcR02SWP2gIdbEqnZezT8ek,526
71
- hindsight_api/extensions/builtin/tenant.py,sha256=lsS0GDEUXmfPBzqhqk2FpN4Z_k5cA3Y3PFNYyiiuZjU,1444
72
- hindsight_api-0.2.1.dist-info/METADATA,sha256=RyCudeeIv6lefNtSIS2n-MDGYcp5jHCF8GkjRUIGzfM,5465
73
- hindsight_api-0.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
74
- hindsight_api-0.2.1.dist-info/entry_points.txt,sha256=vqZv5WLHbSx8vyec5RtMlUqtE_ul7DTgEVODSmou6Og,109
75
- hindsight_api-0.2.1.dist-info/RECORD,,