Metadata-Version: 2.4
Name: veccore
Version: 0.4.0
Summary: Ports-and-adapters vector substrate: embed -> index -> search -> hydrate, backend/embedder-agnostic.
Author: Ash Damle
License-Expression: MIT
Project-URL: Homepage, https://github.com/ashdamle/veccore
Project-URL: Repository, https://github.com/ashdamle/veccore
Project-URL: Issues, https://github.com/ashdamle/veccore/issues
Keywords: embeddings,vector-search,qdrant,semantic-search,ports-and-adapters,retrieval
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.9; extra == "qdrant"
Provides-Extra: openai
Requires-Dist: openai>=1.30; extra == "openai"
Requires-Dist: tiktoken>=0.7; extra == "openai"
Requires-Dist: spendguard; extra == "openai"
Provides-Extra: cli
Requires-Dist: typer>=0.12; extra == "cli"
Provides-Extra: mcp
Requires-Dist: fastmcp>=2.0; extra == "mcp"
Provides-Extra: metered
Requires-Dist: openai>=1.30; extra == "metered"
Requires-Dist: tiktoken>=0.7; extra == "metered"
Requires-Dist: spendguard; extra == "metered"
Provides-Extra: surface
Requires-Dist: typer>=0.12; extra == "surface"
Requires-Dist: fastmcp>=2.0; extra == "surface"
Requires-Dist: spendguard; extra == "surface"
Provides-Extra: st
Requires-Dist: sentence-transformers>=2.7; extra == "st"
Provides-Extra: fastembed
Requires-Dist: fastembed>=0.3; extra == "fastembed"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-timeout>=2.3; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5; extra == "dev"
Dynamic: license-file

# veccore

veccore is a ports-and-adapters vector substrate for `embed -> index -> search -> hydrate`.
It provides backend- and embedder-independent retrieval mechanics, content-sha
idempotency, typed capability failures, estimate-first ingest, and audit seams while
leaving payload policy and record hydration with the consuming application.

## Install

From a checkout of the private standalone repository:

```console
pip install -e .
pip install -e '.[cli]'
pip install -e '.[mcp]'
pip install -e '.[openai]'
pip install -e '.[qdrant]'
```

Extras can be combined, for example `pip install -e '.[cli,mcp,openai,qdrant]'`.
The core package requires Python 3.11 or newer and has NumPy as its sole hard runtime
dependency. Local embedder extras are `st` and `fastembed`.

## Quickstart: Python API

```python
from veccore import AuditEnvelope, CollectionRegistry, CollectionSpec, MockEmbedder, SqliteNumpyStore, VecCore

store = SqliteNumpyStore(path="<sqlite-path>")
core = VecCore(CollectionRegistry(), {"sqlite_numpy": store}, {"mock": MockEmbedder()})
core.register(CollectionSpec(name="<collection-name>", backend="sqlite_numpy", embedder="mock", dim=64))
core.embed_upsert(
    "<collection-name>",
    [{"id": "<item-id>", "text": "<complete text>", "payload": {"source": "<source-id>"}}],
    AuditEnvelope(who="<caller>", why="<reason>"),
)
hits = core.search(
    "<collection-name>", "<query>", 5,
    AuditEnvelope(who="<caller>", why="<reason>"),
)
```

Each hit contains `id`, `score`, and consumer payload. Hydrate the full record from your
own system of record by id.

## Quickstart: CLI

The CLI is generated from the shared capability registry and reads complete JSON
configuration:

```console
veccore ingest --config <config-path> --collection <collection-name> --items '<json-array>' --who <caller> --why <reason>
veccore search --config <config-path> --collection <collection-name> --query '<query>' --k 5 --who <caller> --why <reason>
```

`veccore --help` lists all seven commands. See [usecase.md](usecase.md) for every command
and the configuration schema.

## Quickstart: MCP

```python
from pathlib import Path
from veccore.mcp import build_mcp_surface
from veccore.surfaces.runtime import load_surface_context

build_mcp_surface(load_surface_context(Path("<config-path>"))).run()
```

The MCP tools are generated from the same registry as the API and CLI.

## Network gating

`make_embedder("openai:<model>")` installs `SpendguardGate` by default. Immediately before
network egress it requires active spendguard enforcement and refuses if enforcement is
missing. An explicit injected gate may replace the default. Mock and local embedders do
not egress and use `NullGate`.

## Documentation

- [intent.md](intent.md) — purpose and governing invariant
- [architecture.md](architecture.md) — canonical system structure and data flow
- [design.md](design.md) — rationale and behavioral contracts
- [usecase.md](usecase.md) — API, CLI, MCP, and configuration walkthrough
- [docs/API.md](docs/API.md) — public library reference
- [READINESS.md](READINESS.md) — release gates
- [CHANGELOG.md](CHANGELOG.md) — notable changes

Source repository: [github.com/ashdamle/veccore](https://github.com/ashdamle/veccore)
(private). License: MIT.
