fleet-memory/hindsight-api/hindsight_api
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
..
alembic Feature/graph viz (#85) 2026-01-02 16:27:29 +01:00
api Add operation validator extension support with proper HTTP error handling (#86) 2026-01-01 20:19:52 -05:00
engine feat: Add local LLM improvements for reasoning models and Docker startup (#88) 2026-01-05 10:04:58 +01:00
extensions Add operation validator extension support with proper HTTP error handling (#86) 2026-01-01 20:19:52 -05:00
__init__.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
banner.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
config.py feat: Add local LLM improvements for reasoning models and Docker startup (#88) 2026-01-05 10:04:58 +01:00
daemon.py feat: refactor hindsight-embed architecture (#66) 2025-12-22 22:02:40 +01:00
main.py Add operation validator extension support with proper HTTP error handling (#86) 2026-01-01 20:19:52 -05:00
mcp_local.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
metrics.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00
migrations.py Feature/graph viz (#85) 2026-01-02 16:27:29 +01:00
models.py Add operation validator extension support with proper HTTP error handling (#86) 2026-01-01 20:19:52 -05:00
pg0.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
server.py fix: doc build and lint files (#34) 2025-12-16 13:49:09 +01:00