# rufolangus/aaosp architecture

> Architecture diagram of the GitHub repository rufolangus/aaosp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rufolangus/aaosp
- Repository: https://github.com/rufolangus/aaosp

## Overview

AAOSP is an Android 15 reference platform for on-device LLM tool use through manifest-declared MCP services. The documented workflow runs from a user request in a launcher, through local inference and tool discovery, to consent-gated dispatch and a result returned for another model pass. The tree exposes only the Contacts provider source; platform services, launcher, registry, and Calendar implementation are documented but not present here, so those nodes have no source path. Relationships among those components reflect README statements, not inspected implementation.

Main entry points: [`test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java`](https://github.com/rufolangus/aaosp/blob/main/test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java) (Contacts MCP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Agent experience"]
  node_launcher["AgenticLauncher"]
end

subgraph group_platform["MCP platform"]
  node_llm["Local LLM"]
  node_manifest["MCP manifest"]
  node_parser["Manifest parser"]
  node_registry[("MCP registry")]
  node_manager["LlmManagerService"]
end

subgraph group_safety["Consent and audit"]
  node_consent["Consent gate"]
  node_audit[("Audit log")]
end

subgraph group_providers["Reference providers"]
  node_contacts["Contacts MCP"]
  node_calendar["Calendar MCP"]
  node_contact_store[("Contacts provider")]
  node_calendar_store[("Calendar data")]
end

node_user(("User"))

node_user -->|"submits request"| node_launcher
node_launcher -->|"sends prompt"| node_manager
node_manager -->|"runs inference"| node_llm
node_llm -->|"emits tool call"| node_manager
node_manifest -->|"declares tools"| node_parser
node_parser -->|"indexes tools"| node_registry
node_manager -->|"discovers tools"| node_registry
node_manager -->|"requests approval"| node_consent
node_consent -->|"records call"| node_audit
node_manager -->|"dispatches tool"| node_contacts
node_manager -->|"dispatches tool"| node_calendar
node_contacts -->|"queries contacts"| node_contact_store
node_calendar -.->|"accesses calendar"| node_calendar_store
node_contacts -->|"returns result"| node_manager
node_calendar -->|"returns result"| node_manager
node_manager -->|"continues model pass"| node_llm
node_manager -->|"returns answer"| node_launcher
node_launcher -->|"renders answer"| node_user

click node_contacts "https://github.com/rufolangus/aaosp/blob/main/test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_launcher,node_user toneBlue
class node_llm,node_manifest,node_parser,node_registry,node_manager toneAmber
class node_consent,node_audit toneMint
class node_contacts,node_calendar,node_contact_store,node_calendar_store toneRose
```

## Components

### Agent experience

- **AgenticLauncher**

### MCP platform

- **Local LLM**
- **MCP manifest**
- **Manifest parser**
- **MCP registry**
- **LlmManagerService**

### Consent and audit

- **Consent gate**
- **Audit log**

### Reference providers

- [Contacts MCP](https://github.com/rufolangus/aaosp/blob/main/test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java): `test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java`
- **Calendar MCP**
- **Contacts provider**
- **Calendar data**

### Other components

- **User**

## Connections

- User → AgenticLauncher: submits request (evidence: `README.md`)
- AgenticLauncher → LlmManagerService: sends prompt (evidence: `README.md`)
- LlmManagerService → Local LLM: runs inference (evidence: `README.md`)
- Local LLM → LlmManagerService: emits tool call (evidence: `README.md`)
- MCP manifest → Manifest parser: declares tools (evidence: `README.md`)
- Manifest parser → MCP registry: indexes tools (evidence: `README.md`)
- LlmManagerService → MCP registry: discovers tools (evidence: `README.md`)
- LlmManagerService → Consent gate: requests approval (evidence: `README.md`)
- Consent gate → Audit log: records call (evidence: `README.md`)
- LlmManagerService → Contacts MCP: dispatches tool (evidence: `README.md`)
- LlmManagerService → Calendar MCP: dispatches tool (evidence: `README.md`)
- Contacts MCP → Contacts provider: queries contacts (evidence: `test-mcp-apps/ContactsMcp/src/com/android/contacts/mcp/ContactsMcpService.java`)
- Calendar MCP → Calendar data: accesses calendar
- Contacts MCP → LlmManagerService: returns result (evidence: `README.md`)
- Calendar MCP → LlmManagerService: returns result (evidence: `README.md`)
- LlmManagerService → Local LLM: continues model pass (evidence: `README.md`)
- LlmManagerService → AgenticLauncher: returns answer (evidence: `README.md`)
- AgenticLauncher → User: renders answer (evidence: `README.md`)
