yao/agent
Max bdfe7e83e8 Revise Agent and SUI Documentation for Clarity and Consistency
- Updated the Agent API documentation to reflect a new structure, emphasizing quick start instructions and reorganizing content for better readability.
- Renamed the main documentation title to "Yao Agent" and streamlined sections, including API endpoints and file management.
- Adjusted the SUI documentation to align with the Yao App Engine license, ensuring consistency across project documentation.
2026-01-01 11:08:30 +08:00
..
assistant Enhance Message Filtering in LLM Context Conversion 2025-12-30 16:06:20 +08:00
caller Refactor Agent Response Handling to Use Structured Response Types 2025-12-18 17:32:49 +08:00
content Enhance PDF and Content Processing with New File Handling Features 2025-12-29 15:20:38 +08:00
context Enhance PDF and Content Processing with New File Handling Features 2025-12-29 15:20:38 +08:00
docs Revise Agent and SUI Documentation for Clarity and Consistency 2026-01-01 11:08:30 +08:00
i18n Enhance PDF and Content Processing with New File Handling Features 2025-12-29 15:20:38 +08:00
llm Enhance Options and Metadata Handling in Context and Test Cases 2025-12-18 11:03:55 +08:00
memory Enhance Memory Namespace Isolation Tests and Functionality 2025-12-22 14:54:42 +08:00
output Enhance built-in types and chat storage design for retrieval functionality 2025-12-09 09:09:31 +08:00
search Enhance PDF and Content Processing with New File Handling Features 2025-12-29 15:20:38 +08:00
store Enhance Search Result Storage and Intermediate Data Handling 2025-12-15 16:06:11 +08:00
test Implement Tool Call Assertions in Asserter for Enhanced Validation 2025-12-27 14:23:15 +08:00
testutils Refactor Test Files and Enhance Test Environment Initialization 2025-12-18 12:11:51 +08:00
types Implement System Agents Configuration and Loading Mechanism 2025-12-16 15:32:20 +08:00
agent_test.go ⚠️ BREAKING: Removed the Studio package and renamed Neo to Agent. Configuration file path changed from neo/neo.yml to agent/agent.yml. 2025-11-06 18:13:54 +08:00
load.go Enhance Search Functionality with Keyword Extraction and Intent Detection 2025-12-18 20:16:56 +08:00
load_test.go Implement search configuration management and testing enhancements 2025-12-13 11:19:20 +08:00
README.md Revise Agent and SUI Documentation for Clarity and Consistency 2026-01-01 11:08:30 +08:00

Yao Agent

A powerful AI assistant framework for building intelligent conversational agents with tool integration, knowledge base search, and multi-agent orchestration.

Quick Start

1. Create an Assistant

assistants/
└── my-assistant/
    ├── package.yao      # Configuration
    ├── prompts.yml      # System prompts
    └── locales/
        └── en-us.yml    # Translations

package.yao

{
  "name": "{{ name }}",
  "connector": "gpt-4o",
  "description": "{{ description }}",
  "placeholder": {
    "title": "{{ chat.title }}",
    "prompts": ["{{ chat.prompts.0 }}"]
  }
}

prompts.yml

- role: system
  content: |
    You are a helpful assistant.

locales/en-us.yml

name: My Assistant
description: A helpful AI assistant
chat:
  title: New Chat
  prompts:
    - How can I help you today?

2. Add Hooks (Optional)

Create src/index.ts for custom logic:

import { agent } from "@yao/runtime";

function Create(ctx: agent.Context, messages: agent.Message[]): agent.Create {
  // Preprocess messages before LLM call
  return { messages };
}

function Next(ctx: agent.Context, payload: agent.Payload): agent.Next {
  // Post-process LLM response
  return null;
}

3. Test (Optional)

yao agent test -i "Hello, how are you?"

4. Run

yao start

Access via API: POST /api/__yao/agent

Documentation

Architecture

flowchart LR
    subgraph Request
        A[User Request]
    end

    subgraph Create["Create Hook"]
        B1[Preprocess Messages]
        B2[Configure LLM]
        B3[Delegate to Agent]
    end

    subgraph LLM["LLM Call"]
        C1[Load Prompts]
        C2[Generate Response]
    end

    subgraph Tools["Tool Execution"]
        D1[MCP Tools]
        D2[Search]
        D3[Memory]
    end

    subgraph Next["Next Hook"]
        E1[Process Results]
        E2[Transform Output]
        E3[Delegate to Agent]
    end

    subgraph Response
        F[Stream Response]
    end

    A --> Create
    Create --> LLM
    LLM --> Tools
    Tools --> Next
    Next --> Response
    Next -.->|Continue| LLM

API Endpoints

Endpoint Method Description
/api/__yao/agent POST Chat with assistant
/api/__yao/agent/history GET Get chat history
/api/__yao/agent/chats GET List chat sessions
/api/__yao/agent/assistants GET List assistants
/api/__yao/agent/upload/:type POST Upload files

License

This project is part of the Yao App Engine and follows the Yao Open Source License.