Memori tutorial: Python memory with SQLite and PostgreSQL
Learn to add Memori to a Python OpenAI client, store memory in SQLite, and configure PostgreSQL in Docker with user namespaces.
Player not loading? Watch on YouTube
The original video is in Hindi. This tutorial introduces Memori as an open source, SQL-native memory engine for LLM applications and AI agent projects. The speaker starts with two separate OpenAI calls using GPT-4: one supplies personal details, while the next asks for those details without passing the earlier conversation. The second response lacks that context.
The Python walkthrough installs the SDK, imports Memori, and adds initialization and enablement code to the existing client. In the demonstrated rerun, the response recalls the supplied name and coding preferences. The speaker then points to a SQLite database in the project directory as the memory store. This local storage example still uses OpenAI API calls; it does not demonstrate offline model inference.
The next section configures PostgreSQL in Docker and passes a database connection URL to Memori. Docker must be running, and the example uses port 5432. A missing PostgreSQL dependency interrupts the first attempt, so the speaker installs additional packages before rerunning. TablePlus shows the resulting chat history and memory tables. A long-term memory entry reports a processing failure, which the tutorial leaves unresolved.
The final examples cover combined memory modes, retrieval, memory filters, and a FastAPI chat application. The speaker explains how namespaces separate memory by user ID and briefly lists other supported client integrations. These examples introduce configuration patterns rather than establish production reliability.