Metadata-Version: 2.5
Name: biocognia-intelligence
Version: 0.2.1
Summary: Biocognia Intelligence: one AI workspace over the BioCognia products installed, opened with `biocognia`
Project-URL: Homepage, https://biocognia.com
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.2
Requires-Dist: spatialagents<0.3,>=0.2.2
Requires-Dist: spatialbridge[mcp]<0.3,>=0.2.3
Description-Content-Type: text/markdown

# Biocognia Intelligence

One AI workspace over the BioCognia products you have installed, opened with one command.
It comes with every product:

```bash
pip install scimappro          # or plexora: either brings the app
biocognia
```

`biocognia` opens the Workspace in your browser. Start with your data: a file, a
folder, or a data location. The product that fits it opens it (or the one you
choose), and the assistant helps you explore and interpret it. Your workspaces
from each product are listed together. The products you have installed, such
as Plexora, can be opened from the home screen in their own windows.

One conversation can use several products. In a SCIMAP Pro workspace with
Plexora installed, the assistant can also gate markers against the staining,
check the image's quality, draw regions and look at rendered images in
Plexora, and bring the results back into the table. With a Plexora Pro licence
it can also run Plexora's AI gating and AI QC: the whole run on Plexora's own
AI (Plexora's credits), or step by step, deciding from each packet's images
itself.

| You have | The app gives you |
|---|---|
| SCIMAP Pro | SCIMAP Pro's analyses in conversation |
| SCIMAP Pro and Plexora | both in one conversation, Plexora's Free tools included |
| both, with Plexora Pro | Plexora's AI gating and QC too |
| Plexora only | Plexora's own application, with its AI inside; `biocognia install scimappro` to analyse data here |

| Command | What it does |
|---|---|
| `biocognia` | Opens the app. `--no-browser` prints its address instead, `--port` serves elsewhere (default 8480), and `--home ID` sets the product a new workspace belongs to. |
| `biocognia list` | The products installed, and those of the family that are not. `--licence` adds whether each one's AI licence lets a conversation run and how many of a guest's tools it unlocks; `--json` prints it all as JSON. |
| `biocognia open plexora` | Opens a product's own application. |
| `biocognia install plexora` | Installs a product into the Python the app runs in (pip, else uv). `--upgrade` takes it to its newest release. A desktop application's own Python is updated by its installer instead. |
| `biocognia doctor` | Checks each product: its registration, its AI licence, its tools and whether it is running. Exits 1 on a problem, with what to do. |
| `biocognia license status` | This device's licences, for every product. `activate`, `refresh`, `install` and the other verbs work as in each product's own command line. |
| `biocognia serve --desktop` | A desktop shell's sidecar: one ready line, then the app until stdin closes. |

## How it is put together

- **A workspace belongs to one product**, its home. It is stored where that
  product keeps its sessions, so the product's own app (`scimappro`) lists and
  opens the same workspaces.
- **The home product pays.** Its AI licence pays for the conversation, through
  that product's own gateway. There is no separate Intelligence licence: AI
  comes with each product's licence.
- **Other products join as guests.** A guest's tools are listed in the
  conversation as `<product>.<tool>`, from a manifest shipped with the product,
  so the conversation's catalogue does not change when the guest is not
  running. Each call goes over [spatialbridge](https://pypi.org/project/spatialbridge/)
  to the copy already running, or starts one. The guest checks the call against its own licence.
  A tool that needs a licence is offered only where the guest's licence on this
  device covers it. Images a guest draws reach the model as images.
  Guests offer reads and reversible writes only, because the bridge cannot
  carry an approval. The home's own hand-offs, such as SCIMAP Pro's `view_image`,
  still move data between products, and the guest tools they already drive are
  not offered a second time.
- **The runtime is shared.** The conversation, plans, approvals and the page are
  [spatialagents](https://pypi.org/project/spatialagents/). Licences and the
  AI token come from [biocognia](https://pypi.org/project/biocognia/).
- **Products register themselves.** A product joins by registering one object
  under the `biocognia.products` entry point, from a package small enough to
  import in a moment. The contract is in `src/biocognia_intelligence/registry.py`.

```toml
[project.entry-points."biocognia.products"]
myproduct = "myproduct_intelligence:PRODUCT"
```

## Adding a product

A new package joins without a release of this app:

1. Depend on `biocognia-intelligence>=0.2.1,<0.3`, so the app comes with it.
2. Register one object under `biocognia.products` (above), and assert
   `registry.check_registration(PRODUCT) == []` in its suite.
3. Be a **home**, whose `home().opener()` holds workspaces and pays for their
   conversations, or a **guest**, whose `guest()` offers tools in another
   product's workspace over spatialbridge.
4. A guest ships its manifest, written from its capability registry with
   `biocognia_intelligence.manifest.build(...)`: every tool names its
   permission, and a licensed one its entitlement, which `grants()` unlocks.
5. Test a whole conversation with `biocognia_intelligence.testing` (`guest_of`,
   `manifest_of`) and spatialagents' `FakeGateway`, then check an install with
   `biocognia doctor`.

The full contract, with how licences and credits work, is
`docs/intelligence.md` in the BioCognia platform repository.
