Skip to content

feat: entity-scoped facts, budget-aware recall, cortex ask, scope backfill - #350

Merged
hurttlocker merged 3 commits into
mainfrom
feat/honcho-steal-entity-scope
Mar 23, 2026
Merged

hurttlocker merged 3 commits into
mainfrom
feat/honcho-steal-entity-scope

Conversation

@hurttlocker

Copy link
Copy Markdown
Owner

What changed

  • Entity-scoped facts: observer_agent, observed_entity, session_id, project_id columns with backward-compatible additive migration and backfill from legacy agent_id / linked memory project.
  • Budget-aware recall: --budget flag on cortex search with greedy token packing and structured budget JSON output.
  • cortex ask: new synthesis command with LLM-backed answers + structured citations, with --scope and --budget support.
  • cortex backfill-scope: dry-run by default, --apply to commit, infers scope from linked memory metadata.
  • LLM provider fix: normalized provider-prefixed model override stripping for both Google and OpenRouter.

Why

This lands the first Honcho-inspired memory patterns directly in the Cortex binary without breaking existing users:

  • directional fact scoping
  • budget-aware recall packing
  • a thin memory-grounded synthesis surface
  • a safe migration path for existing fact corpora

Demo results

  • Entity scoping filters correctly:
    • unscoped search returned both scoped facts
    • --scope entity:Q returned only Q-scoped facts
  • cortex ask now produces real synthesized answers with citations on the LoCoMo conv-30 sanity slice.
    • It clearly improves some compositional/commonality cases over raw top-1 retrieval.
    • It still needs future temporal/planner work for harder date questions.

Tests

All passing.

Commands run:

go test ./internal/store ./internal/search ./internal/ingest
go test ./cmd/cortex ./internal/store ./internal/search ./internal/ingest
go test ./internal/ask ./cmd/cortex
go test ./internal/llm ./internal/ask ./cmd/cortex
go test ./...

Notes

  • Backward compatible: omitted scope still behaves as global search.
  • Migration is additive only: ALTER TABLE ADD COLUMN, no table rebuild.
  • Independent of other branches, can merge in any order.

@hurttlocker
hurttlocker force-pushed the feat/honcho-steal-entity-scope branch from 7c4face to 92fe2f8 Compare March 23, 2026 01:53
@hurttlocker
hurttlocker merged commit 4da4d21 into main Mar 23, 2026
4 checks passed
@hurttlocker
hurttlocker deleted the feat/honcho-steal-entity-scope branch March 23, 2026 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant