Files
docs/build/snippets/python/code-samples/long-term-memory-create-agent-postgres-py.mdx
T
2026-07-29 10:28:19 +00:00

16 lines
453 B
Plaintext

```python
from langchain.agents import create_agent
from langchain_core.runnables import Runnable
from langgraph.store.postgres import PostgresStore # type: ignore[import-not-found]
DB_URI = "postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable"
with PostgresStore.from_conn_string(DB_URI) as store:
store.setup()
agent: Runnable = create_agent(
"claude-sonnet-4-6",
tools=[],
store=store,
)
```