# AI agent layer

> **The platform that explains itself is the platform everyone stays on.**

The AI agent layer is the interface that makes every other layer accessible. Instead of reading raw scores and learning to interpret data, users ask questions in plain language and the agent answers with intelligence drawn directly from the Peptosis analysis engine.

## Agent Architecture

```js
// Peptosis Agent System — Request Routing

USER: 'Why did BPC-157 score higher than TB-500 for tissue repair?'

// Step 1: Intent classification
intent = intent_classifier.run(user_message)
=> {
     type: 'comparison',
     compounds: ['BPC-157', 'TB-500'],
     context: 'tissue_repair',
     intent: 'explain_score_delta'
   }

// Step 2: Fetch relevant analysis data
data = compound_db.fetch_for_context(intent)
=> {
     BPC157_bioactivity: 88,       TB500_bioactivity: 74,
     BPC157_research_strength: 82, TB500_research_strength: 69
   }

// Step 3: Generate explanation using context-aware LLM
response = peptosis_llm.explain(intent, data)
=> 'BPC-157 scores higher for tissue repair primarily because...'
```

The agent is not a generic chatbot layered on top of the platform. It is a context-aware reasoning system trained on peptide intelligence data and wired directly into the Peptosis scoring engine. It knows the data because it runs on the same data.

***

## Agent Capabilities by Phase

| Phase           | Agent Capability                                                       |
| --------------- | ---------------------------------------------------------------------- |
| Phase 2 *(now)* | Grade explanations, basic Q\&A, score breakdowns                       |
| Phase 3         | Full compound comparisons, category exploration, report generation     |
| Phase 4         | Multi-turn research sessions, AI-generated novel candidate suggestions |
| Phase 5         | Autonomous discovery runs, community validation integration            |
| Phase 6         | Multi-agent architecture, autonomous research lead generation          |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://peptosis.gitbook.io/peptosis-docs/documentation/platform/ai-agent-layer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
