Skip to main content

VecForge logo

VecForge

Forge your vector database. Own it forever.

Local-first · Encrypted · Hybrid Search · AI Memory over MCP · Zero Cloud Dependency


VecForge is a universal, local-first Python vector database with enterprise security, multimodal ingestion, quantum-inspired reranking, and — new in 2.0 — a persistent memory layer for AI assistants that Claude Desktop, Claude Code and any MCP client can use to remember everything between sessions.

Built by Suneel Bose K — Founder & CEO, ArcGX TechLabs Private Limited

PyPI version License: BSL 1.1 Python 3.10+ Tests Coverage Ruff MCP Quantum


⚡ 5-Line Quickstart

from vecforge import VecForge

db = VecForge("my_vault")
db.add("Patient admitted with type 2 diabetes", metadata={"ward": "7"})
results = db.search("diabetic patient")
print(results[0].text)

That's it. No API keys. No cloud. No config files. Your data stays on your machine, and the vault reopens in milliseconds next time.

Offline, in CI, or on a small machine? VecForge("my_vault", model_name="hash") needs no model download at all.


🧠 AI Memory for Claude and other agents

VecForge 2.0 gives any assistant a long-term memory: facts, preferences, decisions and session summaries that survive the end of a conversation and come back ranked by relevance, importance and recency.

from vecforge import MemoryStore

mem = MemoryStore("~/.vecforge/memory.db", agent="claude")
mem.remember("User prefers concise answers without em-dashes", kind="preference", importance=0.9)
mem.remember("Deploys happen on Fridays", kind="fact", tags=["ops"])

mem.start_session()
print(mem.context_pack("how should I answer?"))   # prompt-ready briefing
mem.end_session("Reviewed the deployment plan")   # remembered for next time

Expose it to Claude over the Model Context Protocol — nothing leaves your machine:

pip install "vecforge[mcp]"
vecforge mcp --print-config claude-desktop     # paste into claude_desktop_config.json
vecforge mcp --print-config claude-code > .mcp.json

Tools: context_pack, remember, recall, forget, reinforce, list_memories, start_session, end_session, recent_sessions, search_vault, add_document, vault_stats. Near-duplicates reinforce existing memories instead of piling up, the embedding model warms up in the background, and the index snapshot is refreshed every few writes so the next session opens instantly.

📖 Memory Guide · MCP Guide · examples/ai_memory_agent.py


🔥 Why VecForge?

Feature Pinecone ChromaDB VecForge
Local-first ❌ Cloud-only ✅ ✅ Always
Encryption at rest ❌ ❌ ✅ AES-256
Hybrid search ✅ ❌ ✅ Dense + BM25, explainable signals
AI memory + MCP server ❌ ❌ ✅ Built-in
Quantum reranking ❌ ❌ ✅ Grover, closed form
Multimodal search ❌ ❌ ✅ CLIP + Whisper
Namespace isolation ✅ Cloud ❌ ✅ Inside the index
RBAC + audit log ✅ Cloud ❌ ✅ Built-in
Pluggable embedders ❌ ✅ ✅ Any model, any API, or none
Price $$$$ Free ✅ Free

📦 Install

pip install vecforge                 # core
pip install "vecforge[mcp]"          # + MCP server for Claude
pip install "vecforge[encryption]"   # + SQLCipher AES-256
pip install "vecforge[multimodal]"   # + CLIP images, Whisper audio

From source: git clone https://github.com/bosekarmegam/vecforge.git && cd vecforge && pip install -e ".[dev]"

Windows users: PyTorch needs the Microsoft Visual C++ Redistributable. See the Installation Guide.


results = db.search(
    "elderly diabetic hip fracture",
    top_k=5,
    alpha=0.7,                     # 70% semantic, 30% keyword
    rerank=True,                   # cross-encoder precision boost
    quantum_rerank=True,           # Grover amplification of consensus hits
    namespace="ward_7",            # enforced inside FAISS + BM25
    filters={"year": {"gte": 2023}, "tags": {"any": ["ortho", "geriatric"]}},
)
for r in results:
    print(r.score, r.signals, r.dense_score, r.sparse_score, r.text)

Namespace scoping and deletes are applied inside the retrievers, so a namespace with ten documents in a vault of a million returns all ten; metadata filters widen the candidate window automatically until top_k matches are found.

More: db.add_batch, db.upsert, db.get, db.update_metadata, db.similar(doc_id), db.search_batch, db.delete_many, db.delete_namespace, db.compact, db.backup.

📖 Search Guide · API Reference


🔁 Adapts to any AI stack

from vecforge import VecForge, CallableEmbedder, HashEmbedder

VecForge("v.db", model_name="all-mpnet-base-v2")             # any sentence-transformers model
VecForge("v.db", model_name="hash")                          # deterministic, no download, instant
VecForge("v.db", embedder=CallableEmbedder(my_api_embed))     # OpenAI / Voyage / Ollama / ONNX

Switch models later with db.reembed(). Every engine caches repeated queries, and vectors can be supplied directly: db.add("caption", embedding=clip_vec, modality="image").


quantum_rerank=True runs Grover amplitude amplification over the candidates with a consensus oracle (hits returned by both the dense and the keyword retriever), evaluated in closed form in O(N). Marked candidates rise above unmarked ones while keeping their order; the best candidate always stays first.

2.0 fixes the 1.x implementation, which applied Grover's diffusion step without an oracle and therefore reversed the ranking for roughly half of all candidate-set sizes. Regression tests cover every size the old code reversed.

Candidates Full rerank (window 1000)
1,000 0.11 ms
100,000 0.29 ms
1,000,000 1.7 ms

📖 Quantum Guide


🔐 Encrypted Vault, RBAC, Audit

import os
from vecforge import VecForge

db = VecForge(
    "secure_vault",
    encryption_key=os.environ["VECFORGE_KEY"],   # SQLCipher AES-256, indexes included
    audit_log="audit.jsonl",
    deletion_protection=True,
)
db.register_api_key(os.environ["TEAM_KEY"], "read-only")   # digests only; unknown keys get nothing

📖 Security Guide


from vecforge.ingest.vision import ImageEmbedder

clip = ImageEmbedder()
db = VecForge("gallery.db", embedder=clip)                       # one CLIP space for text + images
db.add("ward photo", embedding=clip.embed_image("ward.jpg"), modality="image")
db.search("patients in beds", alpha=1.0)                         # text → image

Audio goes through Whisper: AudioEmbedder().transcribe_and_embed("meeting.mp3").

📖 Multimodal Guide


📄 Auto-Ingest Documents

db.ingest("medical_records/")   # PDF, DOCX, TXT, MD, HTML — chunked and batched

📖 Ingestion Guide


🖥️ CLI & 🌐 REST API

vecforge ingest my_docs/ --vault my.db
vecforge search "diabetes" --vault my.db --top-k 5 --quantum --json
vecforge memory remember "User prefers tea" --kind preference
vecforge mcp --vault ~/.vecforge/memory.db --agent claude
vecforge serve --vault my.db --port 8080 --api-key "$VECFORGE_API_KEY"
curl -X POST http://localhost:8080/api/v1/search -H "X-API-Key: $VECFORGE_API_KEY" \
  -H "Content-Type: application/json" -d '{"query": "diabetes", "top_k": 5, "quantum_rerank": true}'
curl -X POST http://localhost:8080/api/v1/memory/remember -H "Content-Type: application/json" \
  -d '{"content": "User prefers dark mode", "kind": "preference", "agent": "claude"}'

📖 CLI Reference · REST API Reference


🧪 Examples

Example Description
🧠 AI Memory Agent An assistant that remembers across a process restart
🏥 Hospital Search Medical record search with namespace isolation per ward
⚖️ Legal Documents NDA and contract search with type/year filtering
🌍 GIS Data Search Geospatial dataset discovery
🤖 RAG Pipeline Retrieval-Augmented Generation with VecForge as backend
🏢 Multi-Tenant SaaS Namespace isolation, RBAC, and audit logging
💻 Codebase Assistant Code documentation semantic search

📚 Documentation


📊 Benchmarks

Measured on a 4-core CPU container with the built-in hash embedder (so the numbers show database cost, not model cost), 100,000 documents, python -m benchmarks.bench_search / bench_quantum:

Operation VecForge 2.0 VecForge 1.1
Hybrid search, 100k docs (flat) 7.3 ms p50 ~11 ms (no namespace scoping)
Hybrid search, 100k docs (HNSW, index_type="auto") 7.3 ms p50, FAISS <1 ms —
Namespace-scoped search, 500 of 100k docs 0.8 ms p50, full recall lost recall past 4·top_k
Ingest 100k docs (database cost) 4,500 docs/s O(N²) BM25 rebuild per add
Delete 0.1 ms (tombstone) full index rebuild
Reopen 5k-doc vault 30 ms rebuild
Reopen 100k-doc vault 1.5 s (snapshot) 2.3 s (rebuild)
Quantum rerank, 1M candidates 1.7 ms 3.3 s (and reversed rankings)

Quality Gates

Check Result
Ruff lint ✅ All checks passed
Black ✅
Pytest ✅ 346 tests (+10 that need the sentence-transformers download)
Coverage 89%

⚖️ License

Business Source License 1.1 (BSL)

  • ✅ Free for personal, research, open-source, and non-commercial use
  • ✅ Read, modify, and share freely
  • 📋 Commercial use requires a license from ArcGX TechLabs

Contact: suneelbose@arcgx.in


Built with ❤️ by Suneel Bose K · ArcGX TechLabs Private Limited

Metadata

Release files for vecforge 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vecforge 2.0.0
File Size Uploaded Provenance Actions
vecforge-2.0.0.tar.gz 113.3 kB Without provenance Details for vecforge-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vecforge 2.0.0
File Interpreter ABI Platform Actions
vecforge-2.0.0-py3-none-any.whl Python 3 none any Details for vecforge-2.0.0-py3-none-any.whl

Total release size: 246.4 kB

Release files / vecforge-2.0.0.tar.gz

Download URL vecforge-2.0.0.tar.gz
Size 113.3 kB
Tags Source
SHA-256 checksum
How to use checksums
af6563376caa94675be88d3fba2c28a4c66f4481bef4a9f15a0d099d2fec430b
BLAKE2b-256 checksum
How to use checksums
71661614d2a3834ca3e16b5954cc6892ef3e5d47013919dac64c6745004141c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / vecforge-2.0.0-py3-none-any.whl

Download URL vecforge-2.0.0-py3-none-any.whl
Size 133.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebd10ff83fb9e7e876d5187302cb04a7fc325b47944880d611c72d77125a42be
BLAKE2b-256 checksum
How to use checksums
3a26a01ad1fd34e51707b59012278bdfff1752645327b0f5c26f461725143be7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for vecforge 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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