Metadata-Version: 2.4
Name: llama-index-vector-stores-synapcores
Version: 0.1.0
Summary: LlamaIndex vector store integration for SynapCores — the AI-native SQL engine.
Project-URL: Homepage, https://synapcores.com
Project-URL: Repository, https://github.com/SynapCores/synapcores-llamaindex
Project-URL: Issues, https://github.com/SynapCores/synapcores-llamaindex/issues
Project-URL: Documentation, https://docs.synapcores.com
Author-email: SynapCores <hello@synapcores.com>
License: MIT
Keywords: ai-native-database,llama-index,rag,synapcores,vector-store
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Requires-Dist: llama-index-core<0.13.0,>=0.10.0
Requires-Dist: pydantic>=2.0
Requires-Dist: synapcores>=0.5.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# llama-index-vector-stores-synapcores

LlamaIndex vector store integration for [SynapCores](https://synapcores.com) — the AI-native SQL engine that combines vectors, graph, SQL, and AI inference in one self-hosted binary.

```bash
pip install llama-index llama-index-vector-stores-synapcores
```

## Quickstart

```python
from llama_index.core import VectorStoreIndex, StorageContext
from llama_index.core.readers import SimpleDirectoryReader
from llama_index.vector_stores.synapcores import SynapCoresVectorStore

# 1. Start the engine: docker run -p 8080:8080 -e AIDB_ACCEPT_LICENSE=1 synapcores/community:latest
# 2. Point the integration at it
vector_store = SynapCoresVectorStore(
    uri="http://localhost:8080",
    table_name="my_docs",
    embedding_dim=1536,           # match your embedding model
)

# 3. Standard LlamaIndex flow — no per-vendor weirdness
docs = SimpleDirectoryReader("./data").load_data()
index = VectorStoreIndex.from_documents(
    docs,
    storage_context=StorageContext.from_defaults(vector_store=vector_store),
)
response = index.as_query_engine().query("What does this document say?")
print(response)
```

## Configuration

| Argument | Default | Env fallback |
|---|---|---|
| `uri` | `http://localhost:8080` | `SYNAPCORES_URI` |
| `database` | `default` | `SYNAPCORES_DATABASE` |
| `auth_token` | `None` | `SYNAPCORES_AUTH_TOKEN` |
| `table_name` | `llama_nodes` | — |
| `embedding_dim` | `1536` | — |
| `distance` | `"cosine"` (also: `"euclidean"`, `"dot_product"`) | — |
| `overwrite` | `False` | — |
| `batch_size` | `100` | — |

## Metadata filters

LlamaIndex's full filter grammar maps to SynapCores' JSON arrow operator:

```python
from llama_index.core.vector_stores import MetadataFilters, MetadataFilter, FilterOperator

filters = MetadataFilters(filters=[
    MetadataFilter(key="tenant_id", value="acme", operator=FilterOperator.EQ),
    MetadataFilter(key="doc_type", value=["policy", "contract"], operator=FilterOperator.IN),
])

retriever = index.as_retriever(filters=filters)
```

Supported operators: `EQ`, `NE`, `GT`, `GTE`, `LT`, `LTE`, `IN`, `NIN`, `TEXT_MATCH`, `TEXT_MATCH_INSENSITIVE`, `CONTAINS`, `IS_EMPTY`. Conditions: `AND`, `OR`, `NOT`. Filter groups may be nested. `ANY` / `ALL` (array-membership) are tracked for v0.2.0.

## Existing store

If you've already ingested:

```python
vector_store = SynapCoresVectorStore(uri="http://localhost:8080", table_name="my_docs", embedding_dim=1536)
index = VectorStoreIndex.from_vector_store(vector_store)
```

## Engine requirements

- `synapcores/community:v1.7.0.2-ce` or newer

## Async

`async_add`, `aquery`, `adelete`, `adelete_nodes`, `aclear` are available. v0.1.0 wraps the sync client via `asyncio.to_thread` — non-blocking but uses a thread per call. Native httpx path is on the v0.2.0 roadmap.

## License

MIT
