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 & ARM64)
  • ✅ Linux (x86_64)
  • ⚠️ Windows: Not tested. For Windows users, build extensions manually from sqlite-graph and sqlite-vector source, or use WSL.

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.1.tar.gz (600.0 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.1-py3-none-any.whl (600.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chimeradb-0.1.1.tar.gz
  • Upload date:
  • Size: 600.0 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.1.tar.gz
Algorithm Hash digest
SHA256 e40cbe09b53572ec5c73768c8020cab63b1d8967b8d42eaa207e22939f9e4109
MD5 67333febc2ca80e8aae9985cb1689105
BLAKE2b-256 47e9b199edb5dcdc76e7a49dd8ff039db9a3f9dcde71c7d18c94cb9f12ba1248

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chimeradb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 600.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9aad839bb0bf27bdf1396124c41f34559e5bf024a41751648d3773fc71b21687
MD5 9b52426142f6a5209c26da1c14d362f4
BLAKE2b-256 14ac1340a1efaf52e6d7495657d3493d1a1196ef191f5d4015309109c0edc38b

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