fleet-memory/hindsight-api/hindsight_api/engine
csfet9 eea0f27118
feat: Add local LLM improvements for reasoning models and Docker startup (#88)
* feat: Add local LLM improvements for reasoning models and Docker startup

## Reasoning Model Support
- Strip thinking tags from local LLM responses (<think>, <thinking>, <reasoning>, |startthink|/|endthink|)
- Enables Qwen3, DeepSeek, and other reasoning models to work with JSON extraction
- Non-breaking: only affects responses that contain thinking tags

## Docker Retry Start Script
- New retry-start.sh waits for dependencies before starting Hindsight
- Checks LLM Studio availability at /v1/models endpoint
- Checks database connectivity (skipped for embedded pg0)
- Configurable via HINDSIGHT_RETRY_MAX and HINDSIGHT_RETRY_INTERVAL env vars
- Prevents startup failures when LLM Studio isn't ready yet

Tested on Apple Silicon M4 Max with Qwen3 8B via LM Studio.

* refactor: make thinking token stripping opt-in via env var

* refactor: merge retry logic into start-all.sh (opt-in via HINDSIGHT_WAIT_FOR_DEPS)

* fix: resolve pg0 stale instance config in Docker build

- Remove stale pg0 instance data after pre-caching binaries to avoid
  port conflicts (was using hardcoded port 5555 from build time)
- Remove unused cache copy logic from start-all.sh
- Add database backup instructions to CLAUDE.md

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 10:04:58 +01:00
..
retain Feature/graph viz (#85) 2026-01-02 16:27:29 +01:00
search feat: refactor hindsight-embed architecture (#66) 2025-12-22 22:02:40 +01:00
__init__.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
cross_encoder.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
db_utils.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
embeddings.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
entity_resolver.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
interface.py feat: add max_tokens and structured output to /reflect (#74) 2026-01-01 17:09:39 +01:00
llm_wrapper.py feat: Add local LLM improvements for reasoning models and Docker startup (#88) 2026-01-05 10:04:58 +01:00
memory_engine.py Add operation validator extension support with proper HTTP error handling (#86) 2026-01-01 20:19:52 -05:00
query_analyzer.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
response_models.py feat: add max_tokens and structured output to /reflect (#74) 2026-01-01 17:09:39 +01:00
task_backend.py feat: add hindsight-embed and native agentic skill (#64) 2025-12-22 16:42:11 +01:00
utils.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00