Files
semantica/docs/bugs/quickstart_api_mismatch.md
T
KaifAhmad1andClaude Sonnet 4.6 29a608f60e fix: add_decision kwargs support and quickstart VectorStore backend
Fixes #433

- ContextGraph.add_decision() now accepts keyword arguments (category,
  scenario, reasoning, outcome, confidence, entities, decision_maker)
  in addition to a Decision object, matching documented behaviour.
  Both call forms return the decision ID string.
- Quickstart snippets in README, getting-started.md, and index.md
  changed from VectorStore(backend="faiss") to VectorStore(backend="inmemory")
  so they work without faiss-cpu installed.
- docs/reference/context.md methods table updated to reflect the dual
  signature of add_decision().
- docs/bugs/quickstart_api_mismatch.md added to track the issue.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 20:16:56 +05:30

1.2 KiB

title, labels, version
title labels version
Quickstart sample code incompatible with v0.3.0 API bug, documentation 0.3.0

Bug 1 — ContextGraph.add_decision() rejects keyword arguments

Running the README's Context & Decision Tracking sample fails immediately:

TypeError: ContextGraph.add_decision() got an unexpected keyword argument 'category'

add_decision() only accepted a Decision object, but the docs showed and described the kwargs form. Fixed by updating add_decision() to accept kwargs directly (delegates to record_decision); both call patterns now work and return the decision ID.


Bug 2 — VectorStore(backend="faiss") silently drops all stored memories

Running any quickstart snippet with VectorStore(backend="faiss", dimension=768) prints:

Failed to store in vector store:

FAISS requires pip install faiss-cpu, which is not included in the base install. Memories fall back to an in-memory dict silently, so find_precedents and similarity search return empty results. Fixed by changing all quickstart snippets to VectorStore(backend="inmemory").


Reported by: chrisguoado — tracked in KaifAhmad1/semantica#433, fixed in pr-432 follow-up.