Skip to content

Commit 4b57b82

Browse files
authored
feat(hindsight-embed): external API support + OpenClaw fixes (#263, #264) (#265)
* feat(hindsight-embed): external API support + OpenClaw fixes Adds comprehensive external API support and fixes critical OpenClaw plugin issues. **External API Support:** - Add HINDSIGHT_EMBED_API_URL to connect to external Hindsight API servers - Add HINDSIGHT_EMBED_API_TOKEN for Bearer token authentication - Add HINDSIGHT_EMBED_API_DATABASE_URL for custom PostgreSQL databases - Skip daemon startup when external API URL is configured - Add 10 comprehensive unit tests for external API scenarios **OpenClaw Plugin Fixes:** - Fix #263: Port mismatch (DEFAULT_PORT 8888 → 8889) - Fix #264: Add daemon recovery after OpenClaw SIGUSR1 restarts - Fix OpenRouter support: Pass HINDSIGHT_API_LLM_BASE_URL to daemon - Fix macOS crashes: Auto-set FORCE_CPU flags for MPS/Metal issues **LLM Configuration Refactor:** - Auto-detect provider from standard env vars (OPENAI_API_KEY, etc.) - Support explicit override via HINDSIGHT_API_LLM_* env vars - Update model defaults (gemini-2.5-flash, openai/gpt-oss-20b) - Remove provider-specific base URL support (only HINDSIGHT_API_LLM_BASE_URL) **Documentation Updates:** - Rewrite OpenClaw integration docs with crystal clear examples - Add external API usage examples - Add OpenRouter free model examples - Update Quick Start with simplified provider setup Closes #263, Closes #264 * docs(openclaw): streamline docs and add config inspection - Remove duplicate/verbose sections (468 → 216 lines) - Add section showing how to check ~/.hindsight/embed config file - Add daemon status checking commands - Keep only essential configuration examples - Consolidate troubleshooting sections * fix(test): update daemon health check port from 8889 to 8888 The test was checking port 8889 but we changed the daemon to use port 8888.
1 parent 9c3fda7 commit 4b57b82

File tree

13 files changed

+628
-287
lines changed

13 files changed

+628
-287
lines changed

hindsight-api/hindsight_api/daemon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
logger = logging.getLogger(__name__)
1616

1717
# Default daemon configuration
18-
DEFAULT_DAEMON_PORT = 8889
18+
DEFAULT_DAEMON_PORT = 8888
1919
DEFAULT_IDLE_TIMEOUT = 0 # 0 = no auto-exit (hindsight-embed passes its own timeout)
2020
LOCKFILE_PATH = Path.home() / ".hindsight" / "daemon.lock"
2121
DAEMON_LOG_PATH = Path.home() / ".hindsight" / "daemon.log"

hindsight-docs/docs/sdks/embed.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Zero-configuration local memory system with automatic daemon management. Perfect
1515
1. **First command triggers startup**: When you run any `hindsight-embed` command, it checks if a local daemon is running
1616
2. **Auto-daemon management**: If no daemon exists, it automatically spawns `hindsight-api --daemon` in the background
1717
3. **Embedded database**: The daemon uses `pg0` (embedded PostgreSQL) — no separate database installation required
18-
4. **Command forwarding**: Your command is forwarded to the local daemon via HTTP (localhost:8889)
18+
4. **Command forwarding**: Your command is forwarded to the local daemon via HTTP (localhost:8888)
1919
5. **Auto-shutdown**: After 5 minutes of inactivity (configurable), the daemon gracefully shuts down to free resources
2020

2121
**Key features:**
2222

2323
- **Zero setup** — One `configure` command and you're ready
2424
- **Automatic lifecycle** — Daemon starts on-demand, stops when idle
2525
- **Isolated storage** — Each bank gets its own embedded PostgreSQL database
26-
- **Local-only** — Binds to `127.0.0.1:8889`, not accessible from network
26+
- **Local-only** — Binds to `127.0.0.1:8888`, not accessible from network
2727
- **Production-grade engine** — Uses the same memory engine as the full API service
2828

2929
Think of it as SQLite for long-term memory — all the power of Hindsight without managing servers.
@@ -209,7 +209,7 @@ hindsight-embed daemon logs -f
209209

210210
Common issues:
211211
- **Missing API key**: Set `HINDSIGHT_EMBED_LLM_API_KEY`
212-
- **Port conflict**: Another service using port 8889
212+
- **Port conflict**: Another service using port 8888
213213
- **Permissions**: Check `~/.hindsight/` directory permissions
214214

215215
### Daemon Exits Immediately

0 commit comments

Comments
 (0)