DEV Community

naman kumar
naman kumar

Posted on

chatstore โ€“ persistent chat history service for LLM apps, zero infrastructure


๐Ÿš€ I just open-sourced chatstore โ€” a lightweight, framework-agnostic persistent chat library for LLM applications.

If you've ever built an AI assistant or agent, you know the pain:
โ†’ Where do I store conversation history?
โ†’ How do I feed a sliding window to the LLM without blowing the context limit?
โ†’ How do I retrieve relevant past context without spinning up a server?

Most solutions either lock you into a framework (LangChain), require Docker + a running server (Zep), or need an LLM call just to store a memory (Mem0).

chatstore does none of that.

โœ… One class. Zero infrastructure.
โœ… Works with any LLM โ€” OpenAI, Gemini, Anthropic, Ollama, anything
โœ… Persistent history backed by SQLite (swappable to Postgres)
โœ… Sliding window context โ€” configurable, token-aware
โœ… Optional semantic search with local embeddings (no API key needed)

๐—ฉ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป ๐Ÿญ โ€” drop in and go:
pip install chatstore

๐—ฉ๐—ฒ๐—ฟ๐˜€๐—ถ๐—ผ๐—ป ๐Ÿฎ โ€” add vector memory with one flag:
pip install chatstore[semantic]

Start using it in 3 lines:

from chatstore import ChatService
chat = ChatService(project_id="my_app")
chat.save_message("user", "Hello!")

That's it. No config files. No environment setup. No servers.

๐Ÿ”— GitHub โ†’ https://github.com/namankr/chatstore

If this saves you even an hour of boilerplate work, drop a โญ on the repo โ€” it genuinely helps more developers discover it.

And if you're building something with LLMs, I'd love to hear what you're working on. Drop a comment or DM me ๐Ÿ‘‡

OpenSource #Python #LLM #AI #GenAI #MachineLearning #Developer #BuildInPublic #ArtificialIntelligence #ChatGPT #Gemini

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.