How opula1234/persistent-memory-chatbot works
This repository is a single-file FastAPI chatbot. A client submits a session ID and prompt; the endpoint validates the prompt, loads that session’s saved messages, converts them to LangChain messages, calls Gemini, persists the new exchange, and returns the reply. SQLite table creation occurs during application startup. The main workflow and components are visible in main.py; broader deployment capabilities described in the README are not runtime components in this map.
Main entry points: main.py Chat Endpoint
Components 8
Chat API
- Chat Endpoint
main.py
Persistent Memory
- History Conversion
main.py - Message Records
main.py - SQLite Store
- Table Startup
main.py
AI Response
- LangChain Gemini Client
main.py - Gemini Model
Other components
- Chat Client
Connections 10
- Chat Client → Chat Endpoint: sends request
README.md - Chat Endpoint → SQLite Store: reads history
main.py - Chat Endpoint → History Conversion: converts records
main.py - History Conversion → Message Records: maps records
main.py - Chat Endpoint → LangChain Gemini Client: invokes with history
main.py - LangChain Gemini Client → Gemini Model: requests response
README.md - Chat Endpoint → SQLite Store: saves exchange
main.py - Table Startup → Message Records: creates tables
main.py - Table Startup → SQLite Store: initializes store
main.py - Chat Endpoint → Chat Client: returns reply
README.md