Skip to content

Add notebook 12: Hindsight on Oracle 23ai#42

Open
DK09876 wants to merge 1 commit into
mainfrom
dk/oracle-backend-cookbook
Open

Add notebook 12: Hindsight on Oracle 23ai#42
DK09876 wants to merge 1 commit into
mainfrom
dk/oracle-backend-cookbook

Conversation

@DK09876

@DK09876 DK09876 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What

A new cookbook notebook, notebooks/12-oracle-backend.ipynb, showing Hindsight running on Oracle Database 23ai — memory stored and searched natively in Oracle (a VECTOR column with an HNSW index, Oracle Text for keyword search, and the entity graph in ordinary tables — no separate vector database).

Written for an audience new to Hindsight, using a customer-support example (Acme Corp). It walks through each feature and, for this Oracle-focused audience, shows the raw SQL underneath each step:

  • retain — teach the agent facts in plain English; LLM extraction into MEMORY_UNITS (native VECTOR) + ENTITIES.
  • recall's lenses, each shown as native Oracle SQL:
    • semantic search — VECTOR_DISTANCE(... COSINE) + HNSW
    • keyword search — Oracle Text CONTAINS()
    • tag scoping, the entity knowledge graph, and temporal/recency (event_date)
  • recall — one fused call (RRF + reranking) returning the memories relevant to a specific question.
  • reflect — the payoff: it reasons across three separately-logged incidents and surfaces a root cause (lock contention on the ORDERS table during overnight jobs) that appears in no single memory, then recommends a fix.
  • mental models — a durable, auto-refreshable summary stored in Oracle with its own VECTOR.

Notes

  • The notebook talks to a Hindsight server configured with the Oracle backend (HINDSIGHT_API_DATABASE_BACKEND=oracle + a connection URL) and uses local sentence-transformers embeddings, so it's self-contained against a local Oracle 23ai.
  • Dependency: the recall (linked-memory) and mental-model paths rely on Oracle backend fixes in hindsight-core (fix(oracle): make recall and mental-model history work on the Oracle backend hindsight#1980). Best merged after those ship.

🤖 Generated with Claude Code

A cookbook walkthrough that drives a Hindsight server backed by Oracle
Database 23ai via the standard hindsight-client: retain, recall (4-way
parallel retrieval), reflect, mental models, directives, and temporal recall.
Each section drops into raw SQL (python-oracledb) to show memories living in
Oracle's native VECTOR type (HNSW index + VECTOR_DISTANCE), Oracle Text
(CONTAINS), and the relational entity graph.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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