---
sidebar_position: 2
title: "The stack"
slug: /architecture/the-stack
slide: /diagrams/abi-dependencies.svg
slide_alt: First-party Naas packages and the open-source libraries they call. naas-abi-core calls FastAPI, LangGraph, RDFLib and the MCP SDK; naas-abi adds the Nexus API. The fabric is nats-py and protobuf. The adapter client libraries come from the catalog, each with the naas-abi-core extra that installs it. Nexus web is Next.js; the CLI is Click and Textual.
question: Which open-source libraries does each ABI package call?

---

# The stack

The first-party packages live in the `.abi` submodule (`jupyter-naas/abi`). A project from `abi new project` installs them as editable paths in `pyproject.toml` (`tool.uv.sources`). This page binds each Naas package to the open-source code it actually calls. The zones of a running system are on [Overview](/architecture/overview); what each engine service does and which adapters it ships are on [Services and adapters](/architecture/services-and-adapters).

Adapters are chosen in `config.yaml`. Swap the adapter, not the port. NATS is the broker under the [real-time fabric](/architecture/real-time-fabric), not the product name.

`naas-abi-marketplace` modules (model providers and applications) load only when you enable them. They are not listed here.

## Engine / kernel

| Naas lib | Dependency | Description | Why we use it |
|---|---|---|---|
| `naas-abi-core` | FastAPI | Python HTTP framework | Core API in `apps/api/api.py` (port 9879 under `abi dev`) |
| `naas-abi` | FastAPI | Same process, Nexus routes | Nexus API under `apps/nexus/apps/api/`, attached to the core app |
| `naas-abi-core` | LangGraph | Agent graphs and checkpoints | `services/agent/Agent.py` (`StateGraph`, `PostgresSaver` from `langgraph-checkpoint-postgres`) |
| `naas-abi-core` | `langchain-openai` | OpenAI-compatible chat clients | Core dependency; provider modules such as `ai.chatgpt` build their models on it |
| `naas-abi-core` | MCP SDK (`fastmcp` dependency) | MCP server | `apps/mcp/mcp_server.py` (`FastMCP("abi")`) |
| `naas-abi` | PostgreSQL (SQLAlchemy, `asyncpg`) | Nexus app tables | `apps/nexus/apps/api/app/models.py`; `database_url` is PostgreSQL only |

## Fabric

| Naas lib | Dependency | Description | Why we use it |
|---|---|---|---|
| `naas-abi-core` | NATS (`nats-py`, JetStream) | Broker for request/reply, the bus, jobs, discovery | `nats:` in every `abi new project` preset; `[nats]` extra; `NATSJetStreamAdapter.py` |
| `naas-abi-sdk` | `nats-py` | Client for a remote module | Direct dependency; entry point `naas-abi-module`. Does not import `naas-abi-core` |
| `naas-abi-proto` | `protobuf` | Versioned service contracts | Direct dependency; `abi.svc.<service>.v1.*` on the broker |

## Adapter libraries

Each shipped adapter reaches its backend through a client library (some through several), or none when it keeps files on disk, holds data in memory, or writes through another engine service. A library that sits behind an extra loads only when you install that extra (`naas-abi-core[aws]`, `[qdrant]`, `[redis]` and so on). This table is generated from the pinned engine's imports and `pyproject.toml`:

| Library | Installed by | Adapters |
|---|---|---|
| `boto3` | `naas-abi-core[aws]` | Triple store `aws_neptune_sshtunnel`, Triple store `aws_neptune`, Object storage `s3`, Object storage `naas`, Object storage `r2`, Email `ses` |
| `duckdb` | `naas-abi-core` | Dataset `ducklake` |
| `msal` | `naas-abi-core[microsoft]` | Email `microsoft_outlook` |
| `nats-py` | `naas-abi-core[nats]` | Bus `nats_jetstream` |
| `paramiko` | `naas-abi-core[ssh]` | Triple store `aws_neptune_sshtunnel` |
| `pika` | `naas-abi-core[rabbitmq]` | Bus `rabbitmq` |
| `psycopg` | `naas-abi-core` | Document `postgresql`, Event `postgresql` |
| `pyoxigraph` | `naas-abi-core` | Triple store `oxigraph_embedded` |
| `python-dotenv` | `naas-abi-core` | Secret `dotenv`, Secret `base64` |
| `qdrant-client` | `naas-abi-core[qdrant]` | Vector store `qdrant`, Vector store `qdrant_in_memory` |
| `redis` | `naas-abi-core[redis]` | Key-value `redis`, Cache `redis` |
| `requests` | not declared by `naas-abi-core` (comes with its other dependencies) | Triple store `oxigraph`, Triple store `apache_jena_tdb2`, Triple store `aws_neptune_sshtunnel`, Triple store `aws_neptune`, Object storage `naas`, Secret `naas`, Email `sendgrid`, Email `microsoft_outlook`, Source control `forgejo`, Coding environment `coder` |
| `smtplib` | Python standard library | Email `smtp` |
| `sparqlwrapper` | `naas-abi-core` | Triple store `aws_neptune_sshtunnel`, Triple store `aws_neptune` |
| `sqlite-vec` | `naas-abi-core[sqlite-vec]` | Vector store `sqlite_vec` |
| `sqlite3` | Python standard library | Vector store `sqlite_vec`, Document `sqlite`, Event `sqlite`, Activity log `sqlite`, Key-value `python`, Bus `python_queue` |
| `sshtunnel` | `naas-abi-core[ssh]` | Triple store `aws_neptune_sshtunnel` |
| None | — | Triple store `fs`, Triple store `object_storage`, Activity log `document`, Object storage `fs`, Cache `fs`, Cache `object_storage`, Cache `keyvalue`, Email `filesystem`, Source control `in_memory`, Source control `local_git`, Coding environment `code_server`, Coding environment `in_memory`, Coding environment `local_directory` |

The backends these libraries talk to are listed service by service, with the presets that run them, on [Services and adapters](/architecture/services-and-adapters#services).

## Ontology

| Naas lib | Dependency | Description | Why we use it |
|---|---|---|---|
| `naas-abi-core` | RDFLib | RDF / OWL graph library | `TripleStoreService.py` and `onto2py`. SPARQL runs on the store adapter |
| `naas-abi-core` | Oxigraph (`pyoxigraph`) | RDF store and SPARQL server | `oxigraph_server.py` for `abi dev`, and the `oxigraph_embedded` adapter |

## Interface

| Naas lib | Dependency | Description | Why we use it |
|---|---|---|---|
| `nexus-web` | Next.js 15 | Nexus collaboration UI | `apps/nexus/apps/web/package.json` (`next` 15.5.28) |

## CLI

| Naas lib | Dependency | Description | Why we use it |
|---|---|---|---|
| `naas-abi-cli` | Click | `abi` command group | `cli/__init__.py` (`@click.group("abi")`) |
| `naas-abi-cli` | Textual | Terminal UI for the stack | `cli/stack_tui.py` (`StackTextualApp`) |

## Legacy extras

`abi new project --without-nats` creates the classic in-process project with the `naas-abi-core[dagster,rabbitmq]` extras: Dagster orchestrations and the `rabbitmq` bus. Dagster, RabbitMQ and `--without-nats` are legacy and will be removed in the next major.
