Skip to main content

Knowledge graph + vector search + SQL analytics in SQLite

Project description

ChimeraDB

Semantic search + graph queries + SQL analytics. All in one SQLite file.

The only database that combines vector embeddings, Cypher graph patterns, and full SQL for LLM apps. No separate vector DB, no separate graph DB, no infrastructure.

Python 3.8+ License: MIT

ExamplesDocs


Quick Start

pip install chimeradb
from chimeradb import KnowledgeGraph

kg = KnowledgeGraph("my.db")  # Auto-embeddings enabled

# 1. Vector embeddings - semantic search
kg.cypher("CREATE (p:Person {name: 'Alice', bio: 'ML engineer building LLM agents'})")
kg.cypher("CREATE (p:Person {name: 'Bob', bio: 'AI researcher focused on NLP'})")

results = kg.search("who works on language models?", top_k=2)
# Finds both Alice and Bob even though query doesn't match exactly

# 2. Cypher - graph relationships
kg.cypher("CREATE (alice:Person {name: 'Alice'})")
kg.cypher("CREATE (bob:Person {name: 'Bob'})")
kg.cypher("CREATE (acme:Company {name: 'Acme AI'})")
kg.cypher("MATCH (alice:Person {name: 'Alice'}), (acme:Company) CREATE (alice)-[:WORKS_AT]->(acme)")

# Simple pattern matching - no messy SQL joins
colleagues = kg.cypher("MATCH (p:Person)-[:WORKS_AT]->(:Company)<-[:WORKS_AT]-(colleague) RETURN colleague")

# 3. SQL - analytics and aggregation
stats = kg.query("""
    SELECT
        json_extract(properties, '$.name') as company,
        COUNT(*) as employee_count
    FROM graph_nodes
    WHERE labels LIKE '%Company%'
    GROUP BY company
""")

# The power: combine all three in one query!

Why ChimeraDB?

Three powerful tools, one simple database:

  1. Vector embeddings - Search by meaning, not keywords. Find "machine learning expert" when the text says "AI researcher"
  2. Cypher graph queries - Express relationships naturally: MATCH (person)-[:WORKS_AT]->(company) beats complex SQL joins
  3. Full SQL analytics - Aggregate, filter, join with the full power of SQLite when you need it

The combination is the killer feature:

  • RAG systems: Semantic search + relationship context
  • AI agents: Graph traversal + analytical reasoning
  • Recommendations: Similarity search + collaborative filtering

Zero infrastructure:

  • One SQLite file
  • Runs anywhere (laptop, server, edge device)
  • Works with any language (Python, Node.js, Go, Rust...)

Installation

Python Package

pip install chimeradb

Platform Support:

  • ✅ macOS (Intel x86_64 & Apple Silicon ARM64)
  • ✅ Linux (x86_64 only)
  • ❌ Linux ARM64: Not supported yet. Build extensions from source: sqlite-graph and sqlite-vector
  • ⚠️ Windows: Not tested. Use WSL (x86_64) or build extensions manually from source.

Or from source:

git clone https://github.com/codimusmaximus/chimeradb.git
cd chimeradb
./setup.sh && source .venv/bin/activate

SQL Only (Any Language)

# macOS ARM64
mkdir -p extensions
curl -L https://github.com/agentflare-ai/sqlite-graph/releases/latest/download/libgraph.dylib -o extensions/libgraph.dylib
curl -L https://github.com/sqliteai/sqlite-vector/releases/latest/download/vector-macos-arm64.dylib -o extensions/vector.dylib

Then load in any SQLite client:

.load extensions/libgraph
.load extensions/vector

Use from Python, Node.js, Go, Rust, Java, C++, or any language with SQLite support.

Python API

from chimeradb import KnowledgeGraph

# Create database
kg = KnowledgeGraph("my_graph.db")  # Or ":memory:"

# Optional: disable embeddings or use different model
# kg = KnowledgeGraph("my.db", embedding_model=None)
# kg = KnowledgeGraph("my.db", embedding_model="text-embedding-3-small")

# Add nodes
kg.add_entity(
    entity_id="person1",
    labels=["Person"],
    properties={"name": "Alice", "bio": "AI researcher"},
    embed_field="bio"
)

# Add relationships
kg.add_relationship(
    from_id="person1",
    to_id="company1",
    relation_type="WORKS_AT",
    properties={"since": 2020}
)

# Semantic search
results = kg.search("machine learning expert", top_k=10)

# Graph traversal
network = kg.traverse("person1", direction="outgoing", max_depth=3)

# SQL queries
data = kg.query("""
    SELECT json_extract(properties, '$.name') as name
    FROM graph_nodes
    WHERE json_extract(properties, '$.role') = 'Engineer'
""")

kg.close()

Examples

Requirements

  • Python 3.8+
  • macOS (ARM64 or Intel) - Linux and Windows coming soon
  • sentence-transformers (auto-installed by setup.sh)

Documentation

Tech Stack

Built on:

License

MIT - see LICENSE

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

chimeradb-0.1.2.tar.gz (600.7 kB view details)

Uploaded Source

Built Distribution

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

chimeradb-0.1.2-py3-none-any.whl (601.3 kB view details)

Uploaded Python 3

File details

Details for the file chimeradb-0.1.2.tar.gz.

File metadata

  • Download URL: chimeradb-0.1.2.tar.gz
  • Upload date:
  • Size: 600.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for chimeradb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d912d62b5da1b1ebbdab99914d0cec3b31261fd12546e38110f43d2d675660bc
MD5 485fc79d9f053f68025332834e6392bb
BLAKE2b-256 a06f8b885766ed9730418141111e2fc6edf35ad61972382db88c2f9de076ce89

See more details on using hashes here.

File details

Details for the file chimeradb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: chimeradb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 601.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for chimeradb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ecf2638d605fd180ab680c6abec9de3a50111881d2d0963b938c2804b492ac
MD5 b2b6b45e5b7e179bd96f3b2c5ae3ac5b
BLAKE2b-256 545c448ac69d70844f793807ef2a77a4df6a78fc811a3bddb08f61a2d9e47f60

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