This is the final chapter (3/3) in our series on building an AI-Agent using retrieval augmented generation. In part 1/3, we discussed the limitations of a disconnected embedding and vector-based retrieval pipeline. In part 2/3, we introduced Neural Databases, which eliminates the need for storing and manipulating heavy and expensive embeddings. Instead, it uses a simple unified end-to-end learnable retrieval system. We argued that embedding representations are 3–25 times heavier than the text data itself, while neural databases only require a few billion parameter networks and simple integer hash tables (less than 20GB overhead), even for hundreds of gigabytes to terabytes of text, resulting in a significant reduction in memory usage.
Why ThirdAI?: Two Major Breakthroughs Making NeuralDB Commercially Viable on Commodity CPUs


ThirdAI’s Lightweight NeuralDB Python APIs for Any Environment (On-premise or On-Cloud)
- Automatic Self-supervised Pre-training on the Inserted Text: Insert any raw text into the NeuralDB with a flag for additional fine tuning on the new data. The flag kicks in a pre-training process that allows the NeuralDB to specialize in understanding co-occurrences within the inserted text. This process is adaptable to variety of inputs such as logs, codes, or even multilingual data. Unlike existing fixed and pre-trained embedding models, self-supervised pre-training empowers NeuralDB to be domain specialized, providing a significant upgrade in end-to-end retrieval.
- Supervised Training of NeuralDB: In addition to self-supervised pre-training, NeuralDB can also be trained in a supervised manner. You can leverage text-to-text mappings (weak or strong) to specify textual information that should be close to each other, similar to contrastive training of embedding models. Furthermore, any supervised mapping from text to a known category, such as product search engines mapping user queries to products, can be utilized.
- Real-Time Reinforcement Learning with Human Feedback: NeuralDB can be further refined in real-time using human feedback. Two forms of human feedback are supported by NeuralDB APIs. First, preference information can be used, where users provide a thumbs-up or upvote on the best option among several retrieved options. Second, the model can be guided to associate two different text strings in an online fashion, similar to supervised training. For example, you can align NeuralDB to understand the oil industry jargon where “WOW” is associated with “Wait On Weather.”
The AI community has recognized a key lesson from the success of ChatGPT: even the most advanced AI systems require constant human expert feedback. Our NeuralDB is designed with this in mind. Achieving a high-quality AI model is a continuous process that involves ongoing training, fine-tuning, and reinforcement learning.
NeuralDB: A Much-Needed Reduction in the AI Software Stack
Resources, Notebooks, and PubMed Q & A NeuralDB
References
- BLISS: A Billion scale Index using Iterative Re-partitioning. Gaurav Gupta, Tharun Medini, Anshumali Shrivastava, and Alex Smola SIGKDD International Conference on Knowledge Discovery & Data Mining (KDD) 2022.
- SOLAR: Sparse Orthogonal Learned and Random Embeddings. Tharun Medini, Beidi Chen, Anshumali Shrivastava International Conference on Learning Representations (ICLR) 2021.
- Extreme Classification in Log Memory using Count-Min Sketch: A Case Study of Amazon Search with 50M Products. Tharun Medini, Qixuan Huang, Yiqiu Wang, Vijai Mohan, Anshumali Shrivastava Neural Information Processing Systems (NeurIPS) 2019.
- Asymmetric LSH (ALSH) for Sublinear Time Maximum Inner Product Search (MIPS). Anshumali Shrivastava and Ping Li. Neural Information Processing Systems (NIPS) 2014 Best Paper Award.