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

VecForge: 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

πŸ“‹ 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
Β© 2026 International Journal of Computer Science Engineering Techniques (IJCSE). All rights reserved. Β· ijcsejournal.org
Submit Your Paper