A high-performance RAG (Retrieval-Augmented Generation) system designed for deep document analysis and persistent context awareness. This project implements a sophisticated architecture that synchronizes unstructured text and image data, utilizing a dual-memory layer for a truly personalized chat experience.
Quark distinguishes itself through a multi-stage pipeline:
- Multimodal Ingestion: Uses
Unstructured.iofor text partitioning andpdfplumberfor precise image extraction. A custom Sync Layer aligns these modalities for comprehensive embedding. - Dual-Stream Memory:
- Short-Term Memory (STM): Powered by Redis for rapid session-based context.
- Long-Term Memory (LTM): Powered by Mem0 to retain user history and preferences over time.
- Local Chat History: All conversation logs are stored in a local SQLite database, ensuring your data stays on your system.
- Interface: A streamlined CLI UI for interacting with your documents.
Follow these steps to initialize and run the Quark-RAG system on your local machine.
We provide a setup script to handle dependency installation and environment checks.
- Grant execution permissions:
chmod +x setup.sh
- Run the initializer:
./setup.sh
Before launching the cli, you must set up your credentials. inside a .env file in the root directory and populate it with your API keys
Once the setup is complete, you can start chatting with your documents immediately via the terminal interface.
npm run cliThis implementation follows a Modular RAG pattern. By decoupling the ingestion of images and text and re-syncing them at the metadata level, the system maintains higher contextual integrity than standard "text-only" pipelines. The integration of Redis and Mem0 mimics human cognitive functions by separating immediate recall from historical knowledge.


