VecForge: A Local-First Hybrid Vector Database with Persistent Agent Memory and Order-Preserving Grover-Inspired Reranking | IJCSE Volume 10 β Issue 5 | IJCSE-V10I5P46
IJCSE
International Journal of Computer Science Engineering Techniques
ISSN 2455-135X Β· Peer-Reviewed Β· Open Access
π Volume 10, Issue 5
π
October 23, 2026
π Pages 377β397
π ID: IJCSE-V10I5P46
Table of Contents
ToggleVecForge: A Local-First Hybrid Vector Database with Persistent Agent Memory and Order-Preserving Grover-Inspired Reranking
Author(s)
Suneel Bose K
Abstract
Retrieval-augmented applications and AI assistants need a vector store that runs inside the user’s own process, keeps data encrypted on disk, combines semantic and keyword retrieval, and remembers information across conversations. This paper presents VecForge 2.0, an embedded Python vector database built for these needs. One SQLite file, optionally encrypted with SQLCipher, holds documents, vectors, metadata, access keys, agent sessions and index snapshots. Queries fuse FAISS dense search with an incremental BM25 index, and namespace and deletion constraints apply inside both indexes. A memory layer, served over the Model Context Protocol, ranks memories by relevance, importance and recency. The paper also proves that the Grover-inspired reranker of the previous release applies only the diffusion half of Grover’s algorithm, so it can only keep or reverse a ranking, and replaces it with an O(N) closed form of the full algorithm that preserves order. Eighteen experiments evaluate every feature. On the SciFact benchmark, hybrid fusion reaches an nDCG@10 of 0.707, against 0.645 for dense search, 0.665 for BM25 and 0.681 for reciprocal rank fusion. Compared with the previous release, in-index constraints raise recall in small namespaces from 0.5% to 100%, incremental indexing makes insertion 183 times faster, and snapshots make reopening 9 to 17 times faster, while encryption and access control add little cost. The evaluation also reports where the design falls short, including slow, highly selective filters and memory deduplication that confuses paraphrases with changed facts. A single local file can therefore serve both retrieval and long-term memory for AI agents.
Keywords
agent memory, amplitude amplification, hybrid retrieval, Model Context Protocol, vector database
Conclusion
VecForge 2.0 shows that an embedded vector database can offer hybrid retrieval with in-index constraints, encrypted storage that reopens without re-indexing, access control, and a persistent, standards-based memory for AI assistants, all inside one Python process and one file. On SciFact its default hybrid configuration improves nDCG@10 by 9.6% over dense retrieval and beats reciprocal rank fusion. Along the way we found and corrected a reranker that applied only half of Groverβs algorithm, proved why that half alone can only keep or reverse a ranking, and replaced it with an O(N) closed form of the full algorithm that preserves order within the marked and unmarked sets
References
P. Lewis et al., βRetrieval-augmented generation for knowledge-intensive NLP tasks,β in Advances in Neural Information Processing Systems 33 (NeurIPS 2020), pp. 9459β9474, 2020.
[2] Pinecone Systems, Inc., βPinecone: The vector database,β https://www.pinecone.io, 2026, Accessed October 2026.
[3] J. Wang et al., βMilvus: A purpose-built vector data management system,β in Proceedings of the 2021 International Conference on Management of Data (SIGMOD β21), pp. 2614β2627, 2021, doi: 10.1145/3448016.3457550.
[4] Model Context Protocol Project, βModel context protocol specification,β https://modelcontextprotocol.io, 2024, Accessed October 2026.
[5] J. S. Park, J. C. OβBrien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein, βGenerative agents: Interactive simulacra of human behavior,β in Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST β23), 2023, doi: 10.1145/3586183.3606763.
[6] C. Packer et al., βMemGPT: Towards LLMs as operating systems,β arXiv:2310.08560, 2023.
[7] M. Kleppmann, A. Wiggins, P. van Hardenberg, and M. McGranaghan, βLocal-first software: You own your data, in spite of the cloud,β in Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward! 2019), pp. 154β178, 2019, doi: 10.1145/3359591.3359737.
[8] J. Johnson, M. Douze, and H. JΓ©gou, βBillion-scale similarity search with GPUs,β IEEE Transactions on Big Data, vol. 7, no. 3, pp. 535β547, 2021, doi: 10.1109/TBDATA.2019.2921572.
[9] M. Douze et al., βThe Faiss library,β arXiv:2401.08281, 2024.
[10] S. Robertson and H. Zaragoza, βThe probabilistic relevance framework: BM25 and beyond,β Foundations and Trends in Information Retrieval, vol. 3, no. 4, pp. 333β389, 2009, doi: 10.1561/1500000019.
[11] Zetetic LLC, βSQLCipher: Full database encryption for SQLite,β https://www.zetetic.net/sqlcipher/, 2026, Accessed October 2026.
[12] L. K. Grover, βA fast quantum mechanical algorithm for database search,β in Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing (STOC β96), pp. 212β219, 1996, doi: 10.1145/237814.237866.
[13] G. Brassard, P. HΓΈyer, M. Mosca, and A. Tapp, βQuantum amplitude amplification and estimation,β in Quantum Computation and Information, Contemporary mathematics, vol. 305, pp. 53β74, 2002, doi: 10.1090/conm/305/05215.
[14] H. JΓ©gou, M. Douze, and C. Schmid, βProduct quantization for nearest neighbor search,β IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 33, no. 1, pp. 117β128, 2011, doi: 10.1109/TPAMI.2010.57.
[15] Yu. A. Malkov and D. A. Yashunin, βEfficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs,β IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 42, no. 4, pp. 824β836, 2020, doi: 10.1109/TPAMI.2018.2889473.
[16] D. R. Hipp, βSQLite,β https://www.sqlite.org, 2026, Accessed October 2026.
[17] N. Thakur, N. Reimers, A. RΓΌcklΓ©, A. Srivastava, and I. Gurevych, βBEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models,β in Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks, 2021.
[18] G. V. Cormack, C. L. A. Clarke, and S. BΓΌttcher, βReciprocal rank fusion outperforms condorcet and individual rank learning methods,β in Proceedings of the 32nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 758β759, 2009, doi: 10.1145/1571941.1572114.
[19] S. Bruch, S. Gai, and A. Ingber, βAn analysis of fusion functions for hybrid retrieval,β ACM Transactions on Information Systems, vol. 42, no. 1, 2023, doi: 10.1145/3596512.
[20] R. Nogueira and K. Cho, βPassage re-ranking with BERT,β arXiv:1901.04085, 2019.
[21] N. Reimers and I. Gurevych, βSentence-BERT: Sentence embeddings using Siamese BERT-networks,β in Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3982β3992, 2019, doi: 10.18653/v1/D19-1410.
[22] W. Wang, F. Wei, L. Dong, H. Bao, N. Yang, and M. Zhou, βMiniLM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers,β in Advances in Neural Information Processing Systems 33 (NeurIPS 2020), 2020.
[23] National Institute of Standards and Technology, βAdvanced encryption standard (AES),β Federal Information Processing Standards Publication 197, 2001, doi: 10.6028/NIST.FIPS.197.
[24] R. S. Sandhu, E. J. Coyne, H. L. Feinstein, and C. E. Youman, βRole-based access control models,β IEEE Computer, vol. 29, no. 2, pp. 38β47, 1996, doi: 10.1109/2.485845.
[25] E. Tang, βA quantum-inspired classical algorithm for recommendation systems,β in Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC 2019), pp. 217β228, 2019, doi: 10.1145/3313276.3316310.
[26] ONNX Runtime developers, βONNX Runtime: Cross-platform, high performance ML inferencing and training accelerator,β https://onnxruntime.ai, 2021, Accessed October 2026.
[27] D. Wadden et al., βFact or fiction: Verifying scientific claims,β in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 7534β7550, 2020, doi: 10.18653/v1/2020.emnlp-main.609.
[28] K. JΓ€rvelin and J. KekΓ€lΓ€inen, βCumulated gain-based evaluation of IR techniques,β ACM Transactions on Information Systems, vol. 20, no. 4, pp. 422β446, 2002, doi: 10.1145/582415.582418.
[29] B. Efron and R. J. Tibshirani, βAn introduction to the bootstrap,β Chapman; Hall/CRC, 1993.
[30] M. D. Smucker, J. Allan, and B. Carterette, βA comparison of statistical significance tests for information retrieval evaluation,β in Proceedings of the Sixteenth ACM Conference on Information and Knowledge Management (CIKM β07), pp. 623β632, 2007, doi: 10.1145/1321440.1321528.
[31] M. G. Kendall, βA new measure of rank correlation,β Biometrika, vol. 30, no. 1/2, pp. 81β93, 1938, doi: 10.2307/2332226
[2] Pinecone Systems, Inc., βPinecone: The vector database,β https://www.pinecone.io, 2026, Accessed October 2026.
[3] J. Wang et al., βMilvus: A purpose-built vector data management system,β in Proceedings of the 2021 International Conference on Management of Data (SIGMOD β21), pp. 2614β2627, 2021, doi: 10.1145/3448016.3457550.
[4] Model Context Protocol Project, βModel context protocol specification,β https://modelcontextprotocol.io, 2024, Accessed October 2026.
[5] J. S. Park, J. C. OβBrien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein, βGenerative agents: Interactive simulacra of human behavior,β in Proceedings of the 36th Annual ACM Symposium on User Interface Software and Technology (UIST β23), 2023, doi: 10.1145/3586183.3606763.
[6] C. Packer et al., βMemGPT: Towards LLMs as operating systems,β arXiv:2310.08560, 2023.
[7] M. Kleppmann, A. Wiggins, P. van Hardenberg, and M. McGranaghan, βLocal-first software: You own your data, in spite of the cloud,β in Proceedings of the 2019 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software (Onward! 2019), pp. 154β178, 2019, doi: 10.1145/3359591.3359737.
[8] J. Johnson, M. Douze, and H. JΓ©gou, βBillion-scale similarity search with GPUs,β IEEE Transactions on Big Data, vol. 7, no. 3, pp. 535β547, 2021, doi: 10.1109/TBDATA.2019.2921572.
[9] M. Douze et al., βThe Faiss library,β arXiv:2401.08281, 2024.
[10] S. Robertson and H. Zaragoza, βThe probabilistic relevance framework: BM25 and beyond,β Foundations and Trends in Information Retrieval, vol. 3, no. 4, pp. 333β389, 2009, doi: 10.1561/1500000019.
[11] Zetetic LLC, βSQLCipher: Full database encryption for SQLite,β https://www.zetetic.net/sqlcipher/, 2026, Accessed October 2026.
[12] L. K. Grover, βA fast quantum mechanical algorithm for database search,β in Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing (STOC β96), pp. 212β219, 1996, doi: 10.1145/237814.237866.
[13] G. Brassard, P. HΓΈyer, M. Mosca, and A. Tapp, βQuantum amplitude amplification and estimation,β in Quantum Computation and Information, Contemporary mathematics, vol. 305, pp. 53β74, 2002, doi: 10.1090/conm/305/05215.
[14] H. JΓ©gou, M. Douze, and C. Schmid, βProduct quantization for nearest neighbor search,β IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 33, no. 1, pp. 117β128, 2011, doi: 10.1109/TPAMI.2010.57.
[15] Yu. A. Malkov and D. A. Yashunin, βEfficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs,β IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 42, no. 4, pp. 824β836, 2020, doi: 10.1109/TPAMI.2018.2889473.
[16] D. R. Hipp, βSQLite,β https://www.sqlite.org, 2026, Accessed October 2026.
[17] N. Thakur, N. Reimers, A. RΓΌcklΓ©, A. Srivastava, and I. Gurevych, βBEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models,β in Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks, 2021.
[18] G. V. Cormack, C. L. A. Clarke, and S. BΓΌttcher, βReciprocal rank fusion outperforms condorcet and individual rank learning methods,β in Proceedings of the 32nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 758β759, 2009, doi: 10.1145/1571941.1572114.
[19] S. Bruch, S. Gai, and A. Ingber, βAn analysis of fusion functions for hybrid retrieval,β ACM Transactions on Information Systems, vol. 42, no. 1, 2023, doi: 10.1145/3596512.
[20] R. Nogueira and K. Cho, βPassage re-ranking with BERT,β arXiv:1901.04085, 2019.
[21] N. Reimers and I. Gurevych, βSentence-BERT: Sentence embeddings using Siamese BERT-networks,β in Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 3982β3992, 2019, doi: 10.18653/v1/D19-1410.
[22] W. Wang, F. Wei, L. Dong, H. Bao, N. Yang, and M. Zhou, βMiniLM: Deep self-attention distillation for task-agnostic compression of pre-trained transformers,β in Advances in Neural Information Processing Systems 33 (NeurIPS 2020), 2020.
[23] National Institute of Standards and Technology, βAdvanced encryption standard (AES),β Federal Information Processing Standards Publication 197, 2001, doi: 10.6028/NIST.FIPS.197.
[24] R. S. Sandhu, E. J. Coyne, H. L. Feinstein, and C. E. Youman, βRole-based access control models,β IEEE Computer, vol. 29, no. 2, pp. 38β47, 1996, doi: 10.1109/2.485845.
[25] E. Tang, βA quantum-inspired classical algorithm for recommendation systems,β in Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC 2019), pp. 217β228, 2019, doi: 10.1145/3313276.3316310.
[26] ONNX Runtime developers, βONNX Runtime: Cross-platform, high performance ML inferencing and training accelerator,β https://onnxruntime.ai, 2021, Accessed October 2026.
[27] D. Wadden et al., βFact or fiction: Verifying scientific claims,β in Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 7534β7550, 2020, doi: 10.18653/v1/2020.emnlp-main.609.
[28] K. JΓ€rvelin and J. KekΓ€lΓ€inen, βCumulated gain-based evaluation of IR techniques,β ACM Transactions on Information Systems, vol. 20, no. 4, pp. 422β446, 2002, doi: 10.1145/582415.582418.
[29] B. Efron and R. J. Tibshirani, βAn introduction to the bootstrap,β Chapman; Hall/CRC, 1993.
[30] M. D. Smucker, J. Allan, and B. Carterette, βA comparison of statistical significance tests for information retrieval evaluation,β in Proceedings of the Sixteenth ACM Conference on Information and Knowledge Management (CIKM β07), pp. 623β632, 2007, doi: 10.1145/1321440.1321528.
[31] M. G. Kendall, βA new measure of rank correlation,β Biometrika, vol. 30, no. 1/2, pp. 81β93, 1938, doi: 10.2307/2332226
π How to Cite This Paper
Suneel Bose K (2026). VecForge: A Local-First Hybrid Vector Database with Persistent Agent Memory and Order-Preserving Grover-Inspired Reranking. International Journal of Computer Science Engineering Techniques, 10(5), 377β397. ISSN: 2455-135X. DOI: https://doi.org/10.5281/zenodo.23594256
Related Posts:
NATURAL LANGUAGE DATABASE QUERY AND ANALYTICS AGENT…
Adaptive Explainable Multi-Agent Fraud Detection…
AI-ATS: A Scalable Machine Learning and Vector Space…
A REVIEW ON: INTEGRATED WATERSHED MANAGEMENT USING…
LocalMind OS: Adaptive Multi-Modal Fusion for…
CareerMap: A Comparative AI Framework for Resume…