fleet-memory/hindsight-api/hindsight_api/engine/retain
Bjorn Schliebitz 54e2df0baf
feat(config): Add configurable observation thresholds (#83)
Allows tuning of entity observation generation via environment variables.

## New Environment Variables
- `HINDSIGHT_API_OBSERVATION_MIN_FACTS` - Minimum facts required to
  generate entity observations (default: 5)
- `HINDSIGHT_API_OBSERVATION_TOP_ENTITIES` - Maximum entities to process
  per retain batch (default: 5)

## Changes
- Added threshold configuration to HindsightConfig
- Updated memory_engine.py to use config values
- Updated observation_regeneration.py to use config values

## Use Case
Lower thresholds generate more observations (better recall, higher cost).
Higher thresholds are more selective (lower cost, may miss patterns).

Example:
```bash
# Generate more observations
docker run -e HINDSIGHT_API_OBSERVATION_MIN_FACTS=3 \
           -e HINDSIGHT_API_OBSERVATION_TOP_ENTITIES=10 ...
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 16:22:25 +01:00
..
__init__.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
bank_utils.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
chunk_storage.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
deduplication.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
embedding_processing.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
embedding_utils.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
entity_processing.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
fact_extraction.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
fact_storage.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
link_creation.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
link_utils.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
observation_regeneration.py feat(config): Add configurable observation thresholds (#83) 2026-01-01 16:22:25 +01:00
orchestrator.py feat(misc): update clients types, test coverage, improve /health endpoint and add changelog (#70) 2025-12-23 12:49:31 +01:00
types.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00