Here's how I built my own custom persistent-memory AI research assistant. Note the need for multiple orthogonal governance layers! If you don't have those then your system will be naturally unstable and apt to collapse into confabulation or dishonesty.
Here's what worked for us:
https://energyscholar.github.io/persistent-ai-collaboration/