Skip to main content

A tiny, file-based, AI-native database engine with semantic search

Project description

neuDB

A tiny, file-based, AI-native database engine.
Zero dependencies. Human-readable JSON storage. Semantic search built in.

License: MIT Python 3.8+

Features

  • No server, no config – just a folder of JSON tables.
  • AI‑ready – store embeddings, search by meaning with cosine similarity.
  • Multi‑user – sessions, messages, tags, and memory per user.
  • Library + CLIimport neudb or use the command‑line tool.

Quick start

# Clone
git clone https://github.com/neuralbroker/neudb.git
cd neudb

# CLI
python neudb.py table create users
python neudb.py row insert users --data '{"username":"alice"}'
python neudb.py row list users

# Library
from neudb import connect
db = connect("mydb")
users = db.table("users")
users.insert({"username": "bob"})

AI memory mode

from neudb.ai_schema import *
db = init_ai_database()
alice = add_user(db, "alice", "alice@example.com")
session = create_session(db, alice, "Chat about Python")
add_message_with_embedding(db, session, "user", "How do I fix an import error?")

Install as a package

pip install .
# or
pip install -e .

Then you can import neudb from anywhere.

HTTP API

Install the API extra and run FastAPI with Uvicorn:

pip install -e ".[api]"
uvicorn neudb.api:app --reload

Open Swagger UI at http://127.0.0.1:8000/docs, or use curl:

curl -X POST http://127.0.0.1:8000/users \
  -H 'Content-Type: application/json' \
  -d '{"username":"alice","email":"alice@example.com"}'

Set NEUDB_API_DB=/path/to/db to choose the API storage directory. By default it uses neudb_api_data/.

Local LLM agent memory

Run a chat loop that uses neuDB as long-term memory for Ollama:

ollama pull llama3.2
pip install -e ".[agent]"
neudb-agent --provider ollama --model llama3.2

Each turn searches similar past messages, injects them into the prompt, and saves the new user/assistant exchange back into neuDB.

OpenAI is also supported:

export OPENAI_API_KEY="..."
neudb-agent --provider openai --model gpt-4o-mini

Use --db /path/to/memory to choose the memory directory. By default it uses neudb_agent_memory/.

License

MIT – see LICENSE.

Changelog

See CHANGELOG.md.

Project details


Download files

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

Source Distribution

neudb-0.4.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

neudb-0.4.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file neudb-0.4.0.tar.gz.

File metadata

  • Download URL: neudb-0.4.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for neudb-0.4.0.tar.gz
Algorithm Hash digest
SHA256 07a1aee21055445332ba3c745b9f644a0a477fa3b9ce41c7d3424654cf1c27e6
MD5 fee97090e0fc5c2194a036efb008b521
BLAKE2b-256 ed6cac37ccded1605f33f4f577ea91c51f306b096d0a781b7333a5a92a2a285a

See more details on using hashes here.

File details

Details for the file neudb-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: neudb-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for neudb-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59f4939650faaec3697602bdc9942866fff6f180618437b33cdc1c85cffdebd3
MD5 6ab5b238622dcd84a968c698dcd5e95b
BLAKE2b-256 7e5054e5f556e8b9b6799d01629fd25c30dac90a8c0445672162ce94d3231286

See more details on using hashes here.

Supported by

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