YSClaude is an Android-first personal AI agent workbench that integrates LLM reasoning, tool calling, long-term memory, sub-agents, and automated workflows into a persistent mobile agent runtime.

Stars

72

7-day growth

No data

Forks

31

Open issues

0

License

NOASSERTION

Last updated

2026-07-28

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It combines a full React Native interface with deep Android native modules (AccessibilityService, Shizuku, IME) to create an on-device AI agent that can observe and control the phone, execute shell commands, and run autonomously, all while employing advanced techniques like prompt caching and streaming fault tolerance.

Who it is for

  • Android developers building AI-powered automation tools
  • Power users seeking a customizable mobile personal assistant
  • AI researchers exploring on-device agent architectures
  • Open-source enthusiasts interested in self-hosted agent platforms

Use cases

  • Automate repetitive phone tasks like scheduling, messaging, and note-taking
  • Real-time voice conversations with AI using LiveKit and STT/TTS pipelines
  • Personal knowledge management with long-term memory, journaling, and artifact versioning
  • Remote device control via Shizuku shell and accessibility services

Strengths

  • Comprehensive tool ecosystem covering memory, MCP, web, Android native, and sub-agents
  • Robust agent loop with parallel sub-agent execution, abort propagation, and bounded tool calls
  • Sophisticated streaming parser that handles malformed chunks and multi-vendor protocols
  • Modular ToolModule architecture allowing easy extension without modifying central dispatch

Considerations

  • Android-only; no iOS support is mentioned
  • Requires a development build (cannot run in Expo Go) due to native Kotlin modules
  • Licensed under PolyForm Noncommercial, restricting commercial use without additional licensing

README quick start

YSClaude

YSClaude 是一个 Android 优先的个人 AI Agent 工作台。它以对话为入口,将大模型推理、工具调用、长期记忆、子 Agent、自动化工作流与 Android 系统能力组织成一个可持续运行的移动端 Agent Runtime。

项目并非简单的 Chat UI:模型可以在多轮执行循环中搜索记忆、操作网页、读写 Artifact、调用 MCP Server、派发子 Agent,并通过 Kotlin 原生模块观察和控制 Android 设备。

技术栈

  • 应用框架:React 19、React Native 0.85、Expo SDK 56、Expo Router、TypeScript 6
  • 状态与数据:Zustand、Expo SQLite、File System
  • Agent 能力:OpenAI-compatible Chat Completions、Function Calling、MCP、Prompt Cache
  • 实时通信:LiveKit、WebRTC、STT / LLM / TTS 流水线
  • Android 原生层:Kotlin、React Native NativeModules、AIDL、AccessibilityService、InputMethodService、Shizuku

整体架构

flowchart LR
    subgraph MessageFlow["消息流"]
        U["用户输入 / 系统触发"] --> Store["useChatStore落库并组装上下文"]
        Store --> API["OpenAI-compatible APISSE 流式响应"]
    end

    subgraph AgentLoop["Agent 执行引擎"]
        API --> Parse{"解析模型输出"}
        Parse -->|"文本增量"| Render["更新 assistant 消息"]
        Parse -->|"tool_calls"| Calls["校验并记录工具调用"]
        Result["工具结果 / 错误"] --> ToolMessage["追加 tool 消息"]
        ToolMessage --> API
    end

    subgraph Dispatch["工具分发"]
        Calls --> Router["executeTool匹配 ToolModule"]
        Router --> JSTools["JS / 远程工具记忆 · MCP · Web · Artifact · 子 Agent"]
        Router --> NativeTools["设备工具屏幕 · 输入 · Shell · 通知 · 文件"]
        JSTools --> Result
    end

    subgraph NativeBridge["React Native → Android 原生桥"]
        NativeTools --> Service["TypeScript Service 封装"]
        Service --> Bridge["NativeModules / AIDL"]
        Bridge --> Kotlin["Kotlin Modules & Services"]
        Kotlin --> Android["AccessibilityService · IMEShizuku · Foreground Service"]
        Android --> NativeResult["结构化执行结果"]
        NativeResult --> Result
    end

    Render --> Persist["SQLite 持久化"]
    Render --> Output["UI / TTS / 通知"]

核心技术难点

1. Agent 执行引擎

Agent 主循环位于 src/stores/chat.ts。它负责把模型、消息、工具和 UI 状态组织成一个可中断、可追踪的执行过程:

构造稳定 Prompt、历史消息和运行时上下文
  → 发起流式 Chat Completion
  → 实时写入文本和 Thinking 内容
  → 收集并重组 tool_calls
  → 执行工具并生成 tool message
  → 携带执行结果继续请求模型
  → 无工具调用、用户中止或达到调用上限后结束

有界循环

不同工具的合理调用深度不同。引擎根据当前启用能力动态计算本轮上限,例如记忆检索、MCP、网页交互、远程命令和 Android 控制分别提供自己的 maxToolCalls 配置。循环同时记录累计调用次数,避免模型陷入无限工具调用。

每轮 tool_calls 会以 assistant 消息写回上下文,执行结果则按 OpenAI 协议附带 tool_call_id 追加为 tool 消息,从而维持完整的因果链。工具调用状态还会同步到 ToolInvocation,支持 UI 实时展示和历史回放。

并行与顺序语义

普通工具默认串行执行,避免文件读写、页面操作等工具之间的隐式依赖被破坏。当同一批调用全部为 `di

Description

YSClaude Expo/React Native Android AI assistant client

Related repositories

Similar projects matched by category, topics, and programming language.

TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861
vercel-labs
Featured
vercel-labs GitHub avatar

scriptc

scriptc compiles ordinary TypeScript into small, fast native executables without needing Node.js, V8, or any JavaScript runtime in the binary.

Developer ToolsCode Quality & Build
1,985
Jakubantalik
Featured
Jakubantalik GitHub avatar

thinking-orbs

A React component library that renders six hand-tuned animated thought orb loading indicators on a plain 2D canvas, with two purpose-tuned sizes and automatic theme detection for AI and agent UIs.

AI & Machine LearningAI Agents
1,191