* feat: add source facts token limits to consolidation and recall
- Add two new configurable (per-bank) parameters:
- consolidation_source_facts_max_tokens: total token budget for source
facts across all observations in the consolidation prompt (-1 = unlimited)
- consolidation_source_facts_max_tokens_per_observation: per-observation
cap so each observation gets a fair share of source facts (-1 = unlimited,
default 256)
- Both are also exposed as recall API parameters via SourceFactsIncludeOptions
(max_tokens and max_tokens_per_observation)
- Consolidation now uses resolve_full_config to respect bank-level overrides
- Improve consolidation prompt: temporal metadata (occurred_start=, | Involving:)
is now clearly separated from observation text, with a concrete example showing
the expected synthesis style and explicit rules not to copy raw fact lines
- Add tests for recall source facts capping and consolidation config forwarding
- Expose all three new fields in the control plane bank config UI
- Document new env vars in configuration.md
- Regenerate OpenAPI spec and all SDK clients
* fix: reorder observations UI fields and rename Label Groups to Entity Labels
* fix: revert Entities section title (only rename inner label)
* doc: add consolidation source facts and batch size fields to memory-banks docs
* feat: add observation history tracking and UI diff view
- Track observation changes over time in a JSONB history column,
appending each update's previous state (text, tags, dates, sources)
instead of overwriting
- Add HINDSIGHT_API_ENABLE_OBSERVATION_HISTORY config flag (default: true)
to toggle history recording
- Expose history field in get_memory_unit for observations
- Fix observations/[modelId] route that was proxying to wrong endpoint
- Add History tab in observation modal and History section in panel,
showing word-level and tag diffs between each change (newest first)
- Extract shared ObservationHistoryView component used by both modal and panel
- Add --random-port flag to start.sh to run multiple dev instances
- Scope Next.js distDir by port to prevent lock file collisions between instances
- Restyle consolidation pending badge (rounded-md with border) and add
inline refresh button; fix loading flicker on data refresh
* feat: dedicated observation history endpoint with source facts diff
- Add GET /memories/{id}/history endpoint returning enriched history with
resolved source fact texts and is_new flags per change
- Deprecate history field in GET /memories/{id} (always returns empty list)
- Reconstruct cumulative source facts per history entry by working backwards
from current state, marking newly added facts with is_new
- Replace inline history panel with "View History" button opening modal
- History modal fetches from dedicated endpoint lazily on tab switch
- Timeline view now opens MemoryDetailModal instead of side panel
- History view uses prev/next navigation (left = older, right = newer)
- Fix --random-port: pass dynamic API_PORT as HINDSIGHT_CP_DATAPLANE_API_URL
to control plane, preserving caller values over .env
40 lines
No EOL
1.3 KiB
Bash
Executable file
40 lines
No EOL
1.3 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
ROOT_DIR="$(git rev-parse --show-toplevel)"
|
|
cd "$ROOT_DIR" || exit 1
|
|
|
|
# Check if .env exists in workspace root
|
|
if [ ! -f "$ROOT_DIR/.env" ]; then
|
|
echo "⚠️ Warning: .env not found in workspace root at $ROOT_DIR/.env"
|
|
echo "📝 Please create a .env file if you need to set HINDSIGHT_CP_DATAPLANE_API_URL"
|
|
echo " Default will use http://localhost:8888"
|
|
echo ""
|
|
fi
|
|
|
|
echo "🔨 Building TypeScript SDK first to ensure it's up to date..."
|
|
npm run build -w @vectorize-io/hindsight-client
|
|
echo "✅ SDK built successfully"
|
|
echo ""
|
|
|
|
echo "🚀 Starting Control Plane (Next.js dev server)..."
|
|
# Save caller-provided values before .env can overwrite them
|
|
_CALLER_PORT="${PORT:-}"
|
|
_CALLER_DATAPLANE_URL="${HINDSIGHT_CP_DATAPLANE_API_URL:-}"
|
|
|
|
if [ -f "$ROOT_DIR/.env" ]; then
|
|
echo "📄 Loading environment from $ROOT_DIR/.env"
|
|
# Load env vars from root .env file
|
|
set -a
|
|
source "$ROOT_DIR/.env"
|
|
set +a
|
|
fi
|
|
|
|
# Map prefixed env vars to Next.js standard vars
|
|
export HOSTNAME="${HINDSIGHT_CP_HOSTNAME:-0.0.0.0}"
|
|
# Caller-provided values take priority over .env
|
|
export PORT="${_CALLER_PORT:-${HINDSIGHT_CP_PORT:-9999}}"
|
|
export HINDSIGHT_CP_DATAPLANE_API_URL="${_CALLER_DATAPLANE_URL:-${HINDSIGHT_CP_DATAPLANE_API_URL:-http://localhost:8888}}"
|
|
|
|
# Run dev server
|
|
npm run dev -w @vectorize-io/hindsight-control-plane |