"Information is surprises. You learn something when things don’t turn out the way you expected." ⸺ Roger Schank
Aileen 3 is an agentic AI system designed for Information Foraging. Unlike standard summarizers that compress content flatly, Aileen uses Expectation-Driven Analysis. You provide a set of "priors" (what you already know, what you expect to hear), and the agent watches and listens to long-form media (YouTube, Podcasts) to report only the surprises — the signal amidst the noise. This can turn a recording of a 45-minutes panel discussion into a 2-minutes read.
This repository contains the Agentic Orchestration Layer (aileen3_agent) built with the Google Agent Development Kit (ADK). It consumes tools provided by the Aileen 3 Core MCP Server.
Aileen 3 represents a multi-agent architecture using Sequential, Loop, and LLM agents, integrated with Vertex AI Memory and MCP Tools. The frontend is built with Gradio 6, exchanging messages and state with the agents either through ADK api_server or Vertex AI Agent Engine.
This project implements the following agent concepts:
-
Multi-Agent System:
- Sequential orchestration:
ConditionalPrepAgentprepares state before the main loop begins. - Loop Agent: The
assistant_loopallows the agent to reason, call tools, check status and integrate results iteratively (up to 8 turns). - Specialized Sub-Agents: Dedicated agents for user's briefing refinement (
briefing_refinement_agent) and message normalization (message_fix_agent).
- Sequential orchestration:
-
Tools & MCP:
- Model Context Protocol (MCP) client: Connects to
aileen3_corevia stdio to access long-running media tools (start_media_retrieval,start_media_analysis,translate_slide). - Custom Tools: Implements
get_factual_memory_toolto fetch context from Vertex AI.
- Model Context Protocol (MCP) client: Connects to
-
Sessions & Memory:
- Long-Term Memory: Integrates Vertex AI Memory Bank to retrieve high-confidence facts about the user's domain, acting as automatic "priors."
- to import priors into the memory bank, a command line utility is provided (
tools/memory_bank_cli.py)
- to import priors into the memory bank, a command line utility is provided (
- State Management: Persists briefing states (
briefing_refined) across chat turns using ADK session state.
- Long-Term Memory: Integrates Vertex AI Memory Bank to retrieve high-confidence facts about the user's domain, acting as automatic "priors."
-
Context Engineering:
- Uses a
ConditionalPrepAgentto normalize user input (fixing grammar/spelling) and restructure complex briefing requirements into clean XML blocks before the main assistant ever sees them.
- Uses a
-
Observability:
- Custom
LoggingPlugintraces agent lifecycle events and LLM calls for debugging.
- Custom
- Python 3.11+
- Docker (optional, for deployment)
- Google Cloud Project with Vertex AI enabled
- Gemini API Key
- Aileen 3 Core MCP
- patched ADK for Gemini 3 Pro compatibility
Copy the example environment and fill in your credentials:
# Create .env file
GEMINI_API_KEY=AIza...
VERTEX_PROJECT_ID=your-project-id
VERTEX_LOCATION=us-central1
# Alternatively to VERTEX_PROJECT_ID and ..._LOCATION:
# VERTEX_API_KEY=...Aileen uses Vertex AI Reasoning Engines for factual memory. Use the included CLI to set this up:
# Create the bank
python tools/memory_bank_cli.py create-bank --display-name "Aileen Memory"# Add the resource name reported by `create-bank` to .env
echo "AGENT_ENGINE_NAME=projects/.../locations/.../reasoningEngines/..." >> .env# Seed it with initial facts (optional)
python tools/memory_bank_cli.py add-facts --user-id neal --fact "The user's name is Neal"... or use generate for automatic extraction of facts from bodies of text.
You can run the API server and UI separately, or use the Docker container.
Using Python:
# Install dependencies
pip install -r requirements.txt
# Start the Agent Server (Backend)
python -m agent_system.run_api_server --log_level debug
# Start the Web UI (Frontend) - in a new terminal
python -m chat_ui.mainUsing Docker:
docker build -t aileen3-agent .
docker run --env-file .env -p 7860:7860 -p 8000:8000 aileen3-agentAccess the UI at http://localhost:7860.
- Briefing: The user provides a URL and "priors" (Context, Expectations, Prior Knowledge, Questions) in the UI.
- Refinement: The
briefing_refinement_agentcleans this input, splitting expectations into bullet points for better LLM processing. - Execution: The
assistant_agent(Aileen):- Checks Vertex Memory for existing facts about the topic.
- Calls MCP Tools to download the video and run expectation-driven analysis using Gemini.
- Receives a dense report identifying where the video deviated from the user's expectations.
- Interaction: The user can ask follow-up questions or request slide translations (handled by autonomous MCP slide tools).
agent_system/: ADK Agent definitions, loop logic, and tool bindings.chat_ui/: Gradio interface and backend adapters (API Server & Vertex Agent Engine).tools/: CLI utilities for managing the Vertex Memory Bank.Dockerfile: Deployment configuration for Cloud Run / HF Spaces.
