Skip to main content

⚛️ QDB (v1.6.0): Quantum-Inspired Deductive Database & Code Hypergraph Engine

PyPI version License: MIT Python 3.9+ Hardware: CPU / CUDA GPU

QDB (qdb-ai) is a self-contained, multi-hop combinatorial reasoning database, AST codebase dependency hypergraph engine, embedded SQL/OLAP analytics engine, and in-VRAM thermodynamic logit interceptor.

Unlike standard Vector RAG (which relies on shallow 1-hop similarity) or Graph DBs (which suffer from $O(d^k)$ path explosion), QDB formulates multi-hop relational deduction across knowledge graphs and codebases as a Quadratic Unconstrained Binary Optimization (QUBO) problem solved in $< 50 ext{ms}$ via Hamiltonian ground-state energy minimization.


🚀 What's New in v1.6.0

  • 🧠 Adaptive Domain Model Selection: Auto-detects task domain and dynamically loads the optimal HuggingFace model:
    • Code: microsoft/codebert-base
    • Finance: ProsusAI/finbert
    • Science / Research: allenai/scibert_scivocab_uncased
    • Medical / Clinical: dmis-lab/biobert-base-cased-v1.2
    • Legal: nlpaueb/legal-bert-base-uncased
    • General QA: bert-base-uncased
  • ⚡ Automatic Hardware & CUDA Acceleration: Automatically detects NVIDIA GPUs, Apple MPS, or CPU and places model tensors on optimal device.
  • 📦 AST-Level Codebase Ingestion (vault.ingest_codebase): Recursively parses Python AST, JS/TS, package manifests, imports, class inheritance, decorators, and function call chains into k-ary QUBO Hyperedges.
  • 🕸️ k-ary HyperEdges: Multi-participant relational clusters with direct Hamiltonian matrix couplings.
  • 🤫 Clean Output: Suppressed all checkpoint warning clutter.

📦 Installation

pip install --upgrade qdb-ai

⚡ Quickstart

1. Ingest Full Codebase & Query Architecture via QUBO

import qdb
from qdb import Vault

# Initialize Vault
vault = Vault("my_codebase")

# Ingest entire repository (Python AST, JS/TS, requirements.txt, package.json)
report = vault.ingest_codebase("./src/")
print(f"Parsed {report['files_parsed']} files into {report['nodes_created']} AST nodes and {report['edges_created']} hyperedges.")

# Multi-Hop Transitive Dependency Deduction (< 50ms)
res = vault.query("What modules depend on the database layer and what functions are called?")
print(res["answer_narrative"])

2. Multi-Hop Factual Knowledge Deduction

vault.ingest("Alexander Holder received the royal Beryl Coronet as security for a loan of 50000 pounds.", value=50000.0)
vault.ingest("Sir George Burnwell was the secret lover of Mary Holder and masterminded the Beryl Coronet theft.")

result = vault.query("Who masterminded the theft and what was the value of the security?")
print(result["answer_narrative"])

3. In-Memory SQL & OLAP Analytics Over Knowledge/Code

sql_res = vault.query("SELECT id, content FROM states_sql WHERE content LIKE '%FUNCTION%' LIMIT 5")
print(sql_res["sql_results"])

4. In-VRAM Thermodynamic Logit Shield (+50J)

from qdb import Shield
import torch

shield = Shield()
shield.register_ground_truth(
    entity_name="JPMorgan",
    aliases=["JPMC", "$JPM"],
    truth_token_ids=[1042],
    statement="JPMorgan Chase acquired First Republic Bank on May 1, 2023."
)

raw_logits = torch.randn(1, 32000)
penalized_logits, intercepted, telemetry = shield.evaluate("Tell me about $JPM", raw_logits)

📄 License

MIT License. Developed by Prannesshkva.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qdb_ai-1.7.6.tar.gz (97.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qdb_ai-1.7.6-py3-none-any.whl (105.9 kB view details)

Uploaded Python 3

File details

Details for the file qdb_ai-1.7.6.tar.gz.

File metadata

  • Download URL: qdb_ai-1.7.6.tar.gz
  • Upload date:
  • Size: 97.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.10

File hashes

Hashes for qdb_ai-1.7.6.tar.gz
Algorithm Hash digest
SHA256 38934d32599eb7788293875377f3081eb0c92106957ba72bb75636c27705b33a
MD5 e57060d6fb1a8afe2982d607e489b6f1
BLAKE2b-256 0ac0013ceaa9f261d2338873f45b6f9249b0119ab7687426c14a550ff1b10091

See more details on using hashes here.

File details

Details for the file qdb_ai-1.7.6-py3-none-any.whl.

File metadata

  • Download URL: qdb_ai-1.7.6-py3-none-any.whl
  • Upload date:
  • Size: 105.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.10

File hashes

Hashes for qdb_ai-1.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fd143d70dd75c44abeb4eef38bdb9fcebef31e893f08f875f283807c30f807ae
MD5 d164d263cc8d5e3e93f2d788e892e57c
BLAKE2b-256 1360a1881b48876a4a1a6ab28fa9030c446f9d126d7f1ac80e4c7953265a8229

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.9.7

2 files

1.9.6

2 files

1.9.5

2 files

1.9.4

2 files

1.9.3

2 files

1.9.2

2 files

1.9.1

2 files

1.9.0

2 files

1.8.9

2 files

1.8.8

2 files

1.8.7

2 files

1.8.6

2 files

1.8.5

2 files

1.8.4

2 files

1.8.3

2 files

1.8.2

2 files

1.8.1

2 files

1.8.0

2 files

1.7.9

2 files

1.7.8

2 files

1.7.7

2 files

This release

1.7.6 This release

2 files

1.7.5

2 files

1.7.4

2 files

1.7.3

2 files

1.7.2

2 files

1.7.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page