> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Commit Memory Batch • AI Agent SDK

> commit_memory_batch: Persist a batch of staged memory writes.

# commit\_memory\_batch

Method

> This is a method of the [**Memory**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Memory.md) class in the [**memory**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/memory.md) module.

Persist a batch of staged memory writes.

Mirrors `FileMemory.commit_memory_batch` so the pre-compaction fact
flush (compaction/memory\_flush.py) durably commits extracted facts for
sqlite/chroma/mongodb/mem0 backends instead of raising and being
swallowed. Each staged tuple is `(method_name, args, kwargs)` produced
by \_StagedMemory; `add_*` names map to the `store_*` equivalents.

The `store_*` methods serialize their own SQLite writes with
`_write_lock`; this method therefore must NOT hold that lock while
calling them (it is a non-reentrant `threading.Lock` and doing so
would deadlock). Each write goes through `commit_guard.commit` so a
write is skipped once the flush has been cancelled or the shared
`deadline` has passed, honoring the same atomic-commit contract as the
file backend.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def commit_memory_batch(writes: List[tuple]) -> None
```

## Parameters

**writes** `List[tuple]` *required*

No description available.

## Uses

* `store`

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/memory/memory.py#L419)
>
> `praisonaiagents/memory/memory.py` at line 419

***

## Related Documentation

> [card] [Memory Concept](https://praison.ai/docs/docs/concepts/memory)

> [card] [Memory Overview](https://praison.ai/docs/docs/memory/overview)

> [card] [Memory Configuration](https://praison.ai/docs/docs/configuration/memory-config)

> [card] [Session Resume](https://praison.ai/docs/docs/memory/session-resume)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.