Metadata-Version: 2.5
Name: spatialagents
Version: 0.1.0
Summary: The chat harness runtime SCIMAP Pro, Plexora and other BioCognia products share
Author-email: Ajit Johnson Nirmal <ajitjohnson.n@gmail.com>
License-Expression: LicenseRef-Proprietary
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.12
Requires-Dist: biocognia<0.2,>=0.1.1
Requires-Dist: pydantic>=2.13
Requires-Dist: pyyaml>=6
Description-Content-Type: text/markdown

# spatialagents

The in-app AI conversation runtime BioCognia's products share (Plexora, SCIMAP
Pro): the streamed model call through the BioCognia AI gateway, a tool loop
with deferred tool schemas, approvals for source-file writes and deletes,
sub-agents, deterministic compaction, a tool-result cache, offloaded results,
the conversation store, the local trace and a terminal loop.

A product binds it with three things and never the other way round:

- a `spatialagents.backend.ToolBackend`: what its tools are and how one runs
  (`catalog`, `definition`, `permission(tool, arguments)`, `invoke`, ...);
- a `spatialagents.runner.ChatProfile`: its prompt content, task names and
  wording;
- its places on disk and its version, given to each store.

```python
from biocognia.gateway import TokenSource
from spatialagents.conversations import ChatService, ConversationStore
from spatialagents.gateway import GatewayClient
from spatialagents.policy import Policy

service = ChatService(ConversationStore(root / "conversations"),
                      gateway_factory=lambda: GatewayClient(TokenSource(LICENSING)),
                      backend_factory=MyBackend, profile=MY_PROFILE)
started = service.start(Policy())
```

Dependencies: the standard library, `biocognia`, `pydantic`, `pyyaml`. No
`mcp`, `anndata`, Flask or numpy, and nothing from either product;
`import spatialagents` imports nothing beyond the standard library.

Tests need no product, no network and no model: `spatialagents.testing` has
`FakeGateway` (the gateway's wire and a prompt-cache emulator),
`FakeToolBackend` and `ScriptedBrain`, and registers inert pytest fixtures.

```bash
UV_PROJECT_ENVIRONMENT=$HOME/.venvs/spatialagents uv sync --all-groups
BIOCOGNIA_OFFLINE=1 $HOME/.venvs/spatialagents/bin/python -m pytest -q -p no:cacheprovider
```
