Skip to main content

Quivr + MemPalace

This is the first project slice for a future pip package. It gives a Quivr application a local, persistent memory layer backed by MemPalace.

The package deliberately keeps the model provider separate from memory. It can therefore be connected to Quivr, OpenAI, Anthropic, Ollama, or any other responder that accepts a question and a context string.

Install locally

From this directory:

python -m pip install -e ".[dev,models,ui]"

MemPalace uses a local palace by default. You can select another palace with --palace or MEMPALACE_PALACE_PATH.

The models extra adds LangChain integrations for Groq, NVIDIA AI Endpoints (including compatible local NVIDIA NIM servers), and Hugging Face. These provider versions intentionally use the LangChain 0.3 generation required by the current Quivr Core package. The Hugging Face full extra also installs the Transformers and sentence-transformers dependencies needed for local pipelines and embeddings.

The ui extra adds Gradio for the browser-based RAG test interface.

Run the Gradio RAG UI

From CMD:

quivr-rag-ui

Then open http://127.0.0.1:7860. Choose Groq or NVIDIA NIM, enter a question, and click Ask. The interface displays the retrieved MemPalace context and stores the completed user/assistant turn. Click Recall memories to test only the retrieval stage without making an LLM request.

If the quivr-rag-ui command is not recognized, run it as a Python module:

python -m quivr_mempalace.gradio_app

To run the Quivr Core RAG test separately:

cd /d C:\Users\GauravSarma\Downloads\quivr-main\quivr-main
python -m pip install -e core
python -m pytest core\tests\test_quivr_rag.py -v

The Core install is required because the RAG tests import Quivr Core's full dependency set, including rapidfuzz.

Configure Groq and NVIDIA NIM

The project includes a local .env file with empty credential placeholders and an .env.example template. Edit the local file from CMD:

if not exist .env copy .env.example .env
notepad .env

Set GROQ_API_KEY for Groq. For NVIDIA, set NVIDIA_API_KEY when using the hosted NVIDIA API Catalog, or set NVIDIA_BASE_URL to your self-hosted NIM URL, such as http://localhost:8000/v1. Keep .env private; it is excluded by .gitignore.

Try the memory CLI

quivr-memory remember \
  --wing quivr-demo \
  --room preferences \
  "I prefer concise answers with Python examples."

quivr-memory search "How should answers be written?" --wing quivr-demo
quivr-memory wake-up --wing quivr-demo

Memories are stored verbatim. The same wing, room, and content produce the same ID, so retrying a write does not create a duplicate drawer.

Use it from Python

from quivr_mempalace import MemoryAwareAssistant, MempalaceMemoryStore

store = MempalaceMemoryStore(palace_path="~/.mempalace/palace", wing="my-app")

assistant = MemoryAwareAssistant(
    store=store,
    wing="my-app",
    room="conversation",
    responder=lambda question, context: my_model(question, context),
)

answer = assistant.ask("What style do I prefer?")
print(answer)

responder is intentionally a two-argument callable. A Quivr adapter can be created with QuivrBrainResponder(brain); it forwards question to Brain.ask(...) and places the recalled context in the system prompt. The memory package does not force a particular LLM or API key.

For LangChain models, use LangChainResponder. It works with any LangChain model that exposes invoke, including ChatGroq, ChatNVIDIA, HuggingFacePipeline, and ChatHuggingFace.

from langchain_groq import ChatGroq
from quivr_mempalace import LangChainResponder

model = ChatGroq(model="llama-3.3-70b-versatile", temperature=0)
assistant = MemoryAwareAssistant(
    store=store,
    wing="my-app",
    responder=LangChainResponder(model),
)

For NVIDIA, use:

from quivr_mempalace import create_nvidia_model

model = create_nvidia_model()

For Groq, use:

from quivr_mempalace import create_groq_model

model = create_groq_model()

Both models can be passed to LangChainResponder(model).

For Hugging Face, create a HuggingFacePipeline or ChatHuggingFace from langchain_huggingface and pass it to LangChainResponder.

from quivr_mempalace import QuivrBrainResponder

assistant = MemoryAwareAssistant(
    store=store,
    wing="my-app",
    responder=QuivrBrainResponder(brain),
)

Next packaging step

Before publishing, choose your final distribution/import name, add project metadata such as author and repository URLs, and add the LLM adapter you want to support. The package is already structured as a standalone Hatch project so that the later python -m build / twine upload flow is straightforward.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quivr_mempalace-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quivr_mempalace-0.1.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file quivr_mempalace-0.1.0.tar.gz.

File metadata

  • Download URL: quivr_mempalace-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quivr_mempalace-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a1f595260d2c8a193842190a4d787805c2e77503765bba75552c63f4fa164196
MD5 695a67206ecc5914a9e2f702b373b3ad
BLAKE2b-256 54c142b8d822ff98f044cb7b7f0ba7d94d76be5fc0f2a754b579ca36f6c94605

See more details on using hashes here.

File details

Details for the file quivr_mempalace-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quivr_mempalace-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for quivr_mempalace-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49ae37b5b2bd415a42560a8856562bfd6ba94cfef7d8efab7bcf2e6cb1bbb121
MD5 bae4d1de809cf591e3c877a91ea69074
BLAKE2b-256 f2f7294ebfd771102b85492d81082f3efe4d0ebf3b9bcee885c2c6b4e99f28cf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page