Metadata-Version: 2.4
Name: agentforge-chat-history-postgres
Version: 0.2.3
Summary: Postgres-backed ChatHistoryStore for AgentForge
Project-URL: Homepage, https://github.com/Scaffoldic/agentforge-py
Project-URL: Repository, https://github.com/Scaffoldic/agentforge-py
Project-URL: Changelog, https://github.com/Scaffoldic/agentforge-py/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/Scaffoldic/agentforge-py/issues
Author: The AgentForge Authors
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agent,ai,chat,history,postgres
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: agentforge-core~=0.2.3
Requires-Dist: asyncpg>=0.30
Description-Content-Type: text/markdown

# agentforge-chat-history-postgres

Postgres-backed `ChatHistoryStore` for AgentForge (feat-020 v0.2).

Sister package to [`agentforge-memory-postgres`](../agentforge-memory-postgres).
Drop-in replacement for `SqliteChatHistory` when chat sessions
need multi-writer concurrency or managed-database guarantees
(Neon / Supabase / RDS / Cloud SQL).

```python
from agentforge_chat_history_postgres import PostgresChatHistory

history = await PostgresChatHistory.from_dsn(
    "postgresql://user:pw@host:5432/agentforge"
)
```

Implements the locked `ChatHistoryStore` contract from
`agentforge-core` plus `init_schema()` that creates the
`chat_sessions` + `chat_turns` tables idempotently
(`CREATE TABLE IF NOT EXISTS`).

Run live integration tests with:

```bash
RUN_LIVE_POSTGRES_DSN=postgresql://postgres:test@localhost:5432/postgres \
  uv run pytest -m live packages/agentforge-chat-history-postgres/
```
