Repository navigation
pycontextdb 0.4.9: active-only pending confirmations, richer MCP schemas, and AI agent discovery
LatestActive-only pending confirmations, richer MCP tool schemas, and AI coding-agent discovery for agent memory — pycontextdb 0.4.9
pycontextdb 0.4.9 ships four correctness, MCP parity, and machine-discovery upgrades in the open-source ContextDB SDK for engineering teams building AI agents on SQLite, PostgreSQL/pgvector, and the Model Context Protocol:
- Active-only
pending_confirmations(): UnslottedContextDB.pending_confirmations()now filters out superseded (superseded_by is not None) and expired (not is_valid_at(moment)) revisions, matching slottedpending_confirmations(entity=..., attribute=...)so agents and confirmation queues never ask users to re-confirm a fact that was already replaced. - Full local MCP (
contextdb.mcp) parameter parity & schemas:rememberacceptsevent_time,recallacceptsas_of, bothrecall_for_actionandpending_confirmationsaccept optionalentityandattributeslot filters, and all six MCP tools publish explicit JSON Schema property descriptions for reliable tool selection. - Warm PostgreSQL lexical cache:
PostgresStore.search_text()serves warm lexical identifier lookups from the in-process revision-gated index cache without an extra SQL round-trip. - Verified AI coding-agent discovery & templates:
pyproject.tomlupdatesDocumentationtohttps://contextdb.ai/docs, addsFor AI Agents,MCP Connector, andChangelogproject URLs, expands PyPI keywords (mcp,model-context-protocol,provenance,pii-redaction,sqlite,postgresql,pgvector,bm25,temporal-memory), and ships verified0.4.9opt-in templates inai-tools/(AGENTS.md,CLAUDE.md,.cursorrules,llms.txt,llms-full.txt).
What was wrong in 0.4.8:
- Unslotted
pending_confirmations()returned historical pending rows even after a newer write superseded the sameentity/attributeslot and closedvalid_until. - Local
contextdb serveMCP schemas omittedevent_time,as_of, and slot-scopedentity/attributeparameters that the Python SDK already supported, and lacked per-property descriptions. pyproject.tomlpointedDocumentationat an unserved domain andai-tools/carried pre-0.4helper signatures.
Install or upgrade
pip install --upgrade 'pycontextdb==0.4.9'No schema migration is required. Existing SQLite and PostgreSQL stores upgrade in place.
Runnable example
Offline, with the mock embedder and mock model:
import asyncio
import tempfile
import contextdb
from contextdb.core.config import ContextDBConfig
async def main() -> None:
folder = tempfile.mkdtemp()
db = contextdb.init(
user_id="synthetic_customer_9",
config=ContextDBConfig(
storage_url=f"sqlite:///{folder}/demo.db",
embedding_model="mock",
llm_model="mock",
llm_api_key="mock",
enable_auto_link=False,
),
)
async with db:
await db.factual.add(
"Customer might want invoices sent to draft@example.com.",
source="agent_inferred",
entity="user",
attribute="billing_email",
)
await db.factual.add(
"Customer might want invoices sent to finance@example.com instead.",
source="agent_inferred",
entity="user",
attribute="billing_email",
)
pending = await db.factual.pending_confirmations()
print("version:", contextdb.__version__)
print("active pending count:", len(pending))
print("active pending content:", [m.content for m in pending])
asyncio.run(main())Verified output on November 15, 2026:
version: 0.4.9
active pending count: 1
active pending content: ['Customer might want invoices sent to [EMAIL] instead.']
Use cases
- Customer-support and billing agents running confirmation queues:
pending_confirmations()surfaces only the current unconfirmed value per slot, eliminating duplicate prompts over superseded guesses. - Platform engineers running self-hosted MCP (
pycontextdb[serve]): coding agents and internal copilots get slot-scopedrecall_for_action(entity=..., attribute=...), temporalevent_time/as_of, and self-describing tool schemas over local HTTP or stdio. - Developers adopting ContextDB in Cursor, Claude Code, Codex, or GitHub Copilot: opt-in
ai-tools/AGENTS.mdandai-tools/CLAUDE.mdfiles configure provenance and action-gating idioms without overriding existing repo storage choices.
Verified behavior
- 226 offline unit, integration, MCP, and trust-model eval tests pass locally, plus full matrix CI across Python 3.10, 3.11, and 3.12 and real PostgreSQL 16 concurrency/evolution suites.
scripts/check_release.pyverified Apache-2.0 open-core boundaries, wheel/sdist contents,LICENSE/NOTICEinclusion, and absolute documentation links.
Compatibility and limitations
- Apache-2.0 grant:
pycontextdb 0.4.9is permanently Apache-2.0 with no profile cap, no license key, and no phone-home check. - No schema migration: SQLite and PostgreSQL schemas are unchanged from
0.4.8. - Host enforcement required:
recall_for_actionreturnsact,ask, orabstain; your host application remains responsible for end-user authentication, authorization, and business-state checks.
Links
- pycontextdb 0.4.9 on PyPI
- Documentation
- AI Agent Integration Guide
- MCP Connector Guide
- Changelog
- Open-Core Boundary
- SDK Source Repository
- Previous Release: 0.4.8
FAQ
Do I need a database migration to upgrade from 0.4.8 to 0.4.9?
No. Both SQLite and PostgreSQL schemas are unchanged.
Does pending_confirmations() delete superseded rows from history?
No. Superseded rows remain in audit/history with superseded_by and valid_until populated; pending_confirmations() simply returns only currently active unconfirmed memories.
Is pycontextdb 0.4.9 Apache-2.0?
Yes. Releases through 0.4.9 are permanently Apache-2.0 with no profile cap.