Skip to content

AINP (Artificial Intelligence Native Protocol) — an open standard for intent-driven, semantic, and context-aware communication between AI systems and digital services.

Notifications You must be signed in to change notification settings

atatus/ainp-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

RFC: AINP — Artificial Intelligence Native Protocol (v1.0)

Category: Standards Track

Status: Draft

Author: Fizer Khan

Created: 2025-10-17

Version: 1.0

License: Apache-2.0


1. Overview

AINP (Artificial Intelligence Native Protocol) defines a new standard for AI-native communication between intelligent systems and digital services.

Unlike REST, GraphQL, or gRPC — which were designed for humans and machine systems — AINP is designed for AI systems that:

  • interpret intent rather than fixed routes,
  • require semantic understanding of capabilities,
  • negotiate actions dynamically, and
  • operate in context-rich, multi-step reasoning environments.

AINP aims to establish a foundation for semantic, intent-driven, and autonomous interactions among software, AI agents, and services.


2. Motivation

Traditional API standards assume that:

  • The client knows what endpoint to call.
  • Parameters are fixed.
  • Data contracts are human-defined.

In AI-driven ecosystems, these assumptions fail. AI agents must discover, understand, and decide how to act — often without predefined endpoint knowledge.

Challenge REST/GraphQL/gRPC AINP Solution
Intent Understanding Hardcoded endpoints Dynamic intent mapping
Schema Evolution Manual updates Semantic negotiation
Contextual Execution Stateless Context-aware
Multi-step Reasoning Out of scope Supported
Explainability Not designed Built-in explanations

3. Goals

AINP’s primary goals are:

  1. Intent-Based Communication: Allow AI systems to express what they want to achieve, not how.
  2. Semantic Discovery: Enable agents to understand a service’s purpose through structured metadata.
  3. Negotiation and Reasoning: Allow multi-turn capability negotiation.
  4. Explainability: Support confidence, outcome, and reasoning feedback.
  5. Interoperability: Bridge between REST, GraphQL, and AI-native systems.

4. Core Concepts

Term Definition
Capability A semantically defined operation the service can perform.
Intent Natural-language description of a user or agent’s goal.
Context Additional environmental or conversational information.
Negotiation The process of matching intent to a specific capability.
Execution The structured invocation of a capability.
Outcome Result data, including status, confidence, and explanation.

5. Protocol Structure

AINP services expose three core interfaces:

Endpoint Purpose
GET /.ainp/manifest Capability discovery
POST /.ainp/query Intent negotiation
POST /.ainp/execute Action execution

6. Capability Manifest

Every service must publish a manifest describing available capabilities.

6.1 Example

version: "1.0"
service:
  name: "UserService"
  description: "Manages user accounts, authentication, and subscription plans."

capabilities:
  - id: "create_user"
    name: "CreateUser"
    description: "Creates a new user account."
    intents:
      - "create a new user"
      - "register someone"
      - "sign someone up"
    parameters:
      - name: email
        type: string
        required: true
        description: "Email address of the user."
      - name: plan
        type: enum
        values: [free, pro, enterprise]
        default: free
      - name: referrer
        type: string
        required: false
    returns:
      type: object
      fields:
        - name: user_id
          type: string
        - name: status
          type: string
          values: [success, failed]
    semantics:
      "@type": "CreateAction"
      "@context": "https://schema.org"
metadata:
  version: "1.0.0"
  maintainer: "api@company.com"
  updated_at: "2025-10-17"

7. Intent Negotiation

7.1 Request

POST /.ainp/query
{
  "intent": "register someone with a pro plan",
  "context": {
    "email": "alice@example.com"
  }
}

7.2 Response

{
  "match": {
    "capability_id": "create_user",
    "confidence": 0.93,
    "missing_params": ["plan"],
    "next_step": "Provide missing parameters or confirm execution."
  }
}

8. Execution

8.1 Request

POST /.ainp/execute
{
  "capability_id": "create_user",
  "parameters": {
    "email": "alice@example.com",
    "plan": "pro"
  },
  "trace_id": "ai-session-12345"
}

8.2 Response

{
  "status": "success",
  "result": {
    "user_id": "u-5678",
    "status": "success"
  },
  "confidence": 0.98,
  "explanation": "User created successfully.",
  "next_suggestions": ["send welcome email", "assign default workspace"]
}

9. Semantic Layer

AINP supports integration with semantic standards such as JSON-LD and schema.org for meaning-based interoperability.

Example

{
  "@context": "https://schema.org",
  "@type": "CreateAction",
  "object": {
    "@type": "Person",
    "email": "alice@example.com"
  }
}

This enables reasoning systems to map similar concepts (e.g., “Person” ↔ “User”).


10. Multi-Step Reasoning and Session Context

AINP supports session-based reasoning for multi-action workflows.

Example

POST /.ainp/session
{
  "session_id": "agent-789",
  "previous_steps": [
    { "capability_id": "search_user", "result": "found existing user" }
  ],
  "next_intent": "upgrade the user to enterprise"
}

Response

{
  "next_action": "update_user_plan",
  "parameters": { "plan": "enterprise" },
  "depends_on": "search_user"
}

11. Authentication and Security

AINP does not prescribe a single authentication model but supports:

  • OAuth 2.0 Bearer tokens
  • Service tokens (mTLS, JWT)
  • Signed manifests using JWS/JWKS
  • Capability-based access control (CBAC)

Agents must only execute actions for which they have explicit permission.


12. Versioning and Compatibility

  • version field in the manifest specifies protocol version.
  • Services must support backward compatibility for one minor version.
  • Major version upgrades may change negotiation semantics.

13. Error Handling

AINP standardizes structured error responses:

{
  "error": {
    "code": "INVALID_PARAMETER",
    "message": "Missing required field: email",
    "hint": "Provide a valid email to continue.",
    "confidence": 0.0
  }
}

14. Explainability and Feedback

Responses should include:

Field Type Description
confidence float Confidence score of execution or reasoning
explanation string Textual summary of what happened
next_suggestions array Next possible logical steps

15. Extensions

Extension Purpose
AINP-Events Defines event-driven notifications for AI systems
AINP-Graph Adds graph-based introspection and traversal
AINP-Metrics Telemetry and observability schema
AINP-Trust Provenance, bias, and data lineage metadata
AINP-Reason Structured reasoning trace for transparency

16. Comparison Summary

Feature REST GraphQL gRPC AINP
Schema Definition
Intent Representation
Semantic Typing
Negotiation Layer
Context-Aware
Multi-step Reasoning
Explainability

17. Implementation Guidance

Developers can:

  • Use adapters to generate AINP manifests from existing OpenAPI or protobuf definitions.
  • Implement AINP endpoints as wrappers over existing REST or gRPC APIs.
  • Use semantic libraries (e.g., RDFLib, JSON-LD) for ontology mapping.

Reference SDKs (planned):

  • Go: ainp-go
  • Python: ainp-py
  • TypeScript: ainp-ts

18. Philosophy

AINP is designed for a world where:

Systems understand, negotiate, and reason — not just respond.

It complements, not replaces, existing APIs — adding an AI-intent interface layer that enables collaboration between reasoning systems and digital services.


19. References

  • REST Architectural Style — Fielding, 2000
  • GraphQL Specification — Lee Byron, 2018
  • gRPC Protocol — Google, 2016
  • JSON-LD 1.1 — W3C Recommendation, 2020
  • Schema.org Vocabulary
  • OpenAI Function Calling, 2023
  • Anthropic Tool Use, 2024

20. Appendix A — Example Workflow

1️⃣  AI Agent → POST /.ainp/query
     → discovers "create_user"
     → receives parameters to fill

2️⃣  AI Agent → POST /.ainp/execute
     → executes with structured payload

3️⃣  Service → returns outcome + confidence + explanation

Result:

“User successfully created with Pro plan. Confidence: 0.98.”


About

AINP (Artificial Intelligence Native Protocol) — an open standard for intent-driven, semantic, and context-aware communication between AI systems and digital services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published