Skip to content

andaero/treehacks26

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

80 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Concierge - AI-Powered Gift Giving

A gift-giving workflow built on top of Poke (by The Interaction Company) that finds deeply personalized gifts through peer-to-peer AI agent collaboration and autonomous message analysis.

TreeHacks 2026 Project


🎁 What is Concierge?

Concierge helps you find the perfect gift by having your Poke agent collaborate with the recipient's Poke agent to discover deeply personalized gift ideasβ€”backed by specific message citations that prove real research.

The Problem

Generic LLMs give generic gift advice with no proof:

  • "Get them a keyboard, they like tech" ❌
  • No evidence, no personalization, no confidence

Our Solution

Concierge provides gift recommendations with citation traceability:

  • Recommendation: Keychron K8 mechanical keyboard (Navy, $97.19) βœ…
  • Citation 1 (3 months ago): "I've been really into mechanical keyboards lately"
  • Citation 2 (2 months ago): "The clicky sound is so satisfying!"
  • Citation 3 (1 month ago): "My wrists hurt from this laptop keyboard"
  • Proof: Not genericβ€”deeply researched with specific evidence

πŸš€ Key Features

1. Autonomous iMessage Analysis

An autonomous agent loop validates gift hypotheses by iteratively searching the recipient's message history:

  • Tests initial hypothesis
  • Finds contradicting evidence
  • Updates its own hypothesis
  • Continues until confident
  • Returns validated ideas with citations

2. Peer-to-Peer Agent Collaboration

Two Poke agents work together:

  • Gift Giver's Poke: Initiates request, receives recommendations
  • Gift Recipient's Poke: Orchestrates research, validates hypotheses

3. Full Context Access

Recipient's Poke accesses their complete message history:

  • Shared messages (Giver ↔ Recipient): Shared experiences
  • Other conversations (Recipient ↔ Others): General interests
  • Result: Combined context for better personalization

4. Intelligent Product Configuration

Browser automation configures products based on message insights:

  • Size: Extracted from messages ("I'm a size 10")
  • Color: From favorite color mentions
  • Variant: From specific preference messages

5. Real-time Visualization

Web dashboard shows the entire process:

  • Agent conversation in real-time
  • Autonomous loop iterations
  • Hypothesis updates (invalidated β†’ refined β†’ validated)
  • Citations as they're discovered
  • Final recommendations with evidence

πŸ“‹ Documentation

Quick Links:

The PRD is the ground truth for all development and serves as centralized context for this project.


πŸ—οΈ Architecture

Person A (Gift Giver)
    ↓ "Buy gift for Person B, $100, tech"
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Poke A    β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚ Poke-to-Poke MCP
       ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Poke B (Orchestrator)    β”‚
β”‚  - Email receipt analysis  β”‚
β”‚  - Hypothesis generation   β”‚
β”‚  - Orchestrate subagents   β”‚
β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”˜
   β”‚                     β”‚
   ↓                     ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ iMessage Subagentβ”‚  β”‚ Browser Agent  β”‚
β”‚ (Autonomous Loop)β”‚  β”‚ (Browserbase)  β”‚
β”‚                  β”‚  β”‚                β”‚
β”‚ - Test hypothesisβ”‚  β”‚ - Find product β”‚
β”‚ - Search messagesβ”‚  β”‚ - Configure    β”‚
β”‚ - Validate/Updateβ”‚  β”‚ - Get checkout β”‚
β”‚ - Find citations β”‚  β”‚   URL          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
   β”‚                     β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            ↓
   3 Gift Recommendations
   + Citations + URLs
            ↓
        Poke A
            ↓
      Person A

Built on: Poke by The Interaction Company
Extension Method: MCP (Model Context Protocol) servers


πŸš€ Quick Start

Prerequisites

  • Python 3.12+
  • Node.js 18+
  • uv (Python package manager)
  • macOS (for iMessage database access)
  • Supabase account
  • Browserbase account

Current Setup (Development)

  1. Install Python dependencies:
uv sync
  1. Configure environment variables:
cp env.example .env
# Edit .env with your keys (see env.example for all options):
# - POKE_A_KEY / POKE_B_KEY (agent authentication)
# - SUPABASE credentials
# - BROWSERBASE_API_KEY
# - ANTHROPIC_API_KEY or OPENAI_API_KEY
  1. Run the Poke-to-Poke MCP server:
python mcp/poke-to-poke/server.py

πŸ“ Project Structure

treehacks26/
β”œβ”€β”€ mcp/
β”‚   └── poke-to-poke/              # Agent communication MCP server βœ…
β”‚       └── server.py
β”œβ”€β”€ agents/                         # Agent logic (to be implemented)
β”‚   β”œβ”€β”€ poke_b_orchestrator.py     # πŸ”„ Orchestrates gift research
β”‚   β”œβ”€β”€ imessage_subagent.py       # πŸ”„ Autonomous hypothesis validation
β”‚   └── browser_automation.py      # πŸ”„ Product search & configuration
β”œβ”€β”€ app/                            # Next.js dashboard (to be implemented)
β”‚   β”œβ”€β”€ page.tsx                   # πŸ”„ Main dashboard
β”‚   β”œβ”€β”€ session/[id]/              # πŸ”„ Gift session view
β”‚   └── components/                # πŸ”„ React components
β”œβ”€β”€ supabase/                       # Database migrations (to be implemented)
β”‚   └── migrations/                # πŸ”„ Schema definitions
β”œβ”€β”€ PRD.md                          # πŸ“‹ Product requirements (GROUND TRUTH)
β”œβ”€β”€ agents.md                       # πŸ€– Agent architecture reference
β”œβ”€β”€ README.md                       # πŸš€ This file
β”œβ”€β”€ conversation.txt                # πŸ’¬ Agent communication log
β”œβ”€β”€ env.example                     # πŸ” Environment template
β”œβ”€β”€ pyproject.toml                  # Python dependencies
└── package.json                    # πŸ”„ Node.js dependencies (to be added)

Legend: βœ… Implemented | πŸ”„ To be implemented


πŸ”§ Implementation Status

βœ… Completed

  • Project structure and documentation
  • Comprehensive PRD (ground truth)
  • Poke-to-Poke MCP server (basic implementation)
  • Agent authentication system
  • Local conversation file storage

πŸ”„ In Progress

  • Phase 1: Foundation

    • Next.js app with Supabase integration
    • Update poke-to-poke MCP for Concierge workflow
    • Supabase schema implementation
    • Basic dashboard UI
  • Phase 2: iMessage Integration

    • iMessage Query MCP server
    • Structured search tools (search_messages, analyze_sentiment)
    • Message context extraction
    • Test with real iMessage database
  • Phase 3: Autonomous Agent

    • iMessage subagent autonomous loop
    • Hypothesis validation logic
    • Stop conditions
    • Citation extraction
  • Phase 4: Orchestration

    • Poke B orchestrator
    • Email receipt integration
    • Gift idea synthesis
    • Agent coordination
  • Phase 5: Browser Automation

    • Browserbase integration
    • Product search
    • Configuration (size/color)
    • Checkout URL extraction
  • Phase 6: Dashboard

    • Real-time conversation viewer
    • Autonomous loop visualizer
    • Citation display cards
    • Gift recommendation cards
  • Phase 7: End-to-End

    • Full flow integration
    • Testing with real data
    • Demo preparation

See PRD.md Section 10 for detailed roadmap.


πŸ§ͺ Testing

Test Poke-to-Poke Server

# Start server
python mcp/poke-to-poke/server.py

# Send test message
curl -X POST http://localhost:8000/mcp/v1/tools/call \
  -H "Authorization: Bearer $POKE_A_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "send_message",
      "arguments": {
        "message": "[REQUEST] Test gift request"
      }
    },
    "id": 1
  }'

# Get conversation history
curl -X POST http://localhost:8000/mcp/v1/tools/call \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "get_conversation",
      "arguments": {}
    },
    "id": 2
  }'

Watch Conversation in Real-time

tail -f conversation.txt

🎯 Key Differentiators (Demo WOW Factor)

When demonstrating Concierge at TreeHacks:

1. Citation Traceability ⭐

Show specific messages from months ago:

  • Message timestamp: "5 months ago"
  • Full context: conversation with other friends
  • Proves deep research vs generic LLM

2. Autonomous Intelligence ⭐

Visualize hypothesis evolution:

  • Initial: "Person B likes Warriors"
  • Finding: 15 messages about Cavaliers instead
  • Updated: "Person B likes Cavaliers" βœ…
  • Shows real reasoning, not pattern matching

3. Context Depth ⭐

Demonstrate access to full message history:

  • Shared experiences: Trip to Japan (from A ↔ B messages)
  • General interests: Loves ramen (from B ↔ C messages)
  • Combined insight: Japanese cooking class gift

4. Configuration Intelligence ⭐

Show attention to detail:

  • Found in messages: "I'm a size 10", "Navy blue is my favorite"
  • Product configured: Nike shoes, size 10, navy blue
  • Not generic recommendation

5. Real-time Process Visualization ⭐

Dashboard shows entire research process:

  • Agent conversation
  • Autonomous loop iterations
  • Citations appearing
  • Products being configured

Compare side-by-side:

  • Generic LLM: "Get them a keyboard" (no proof)
  • Concierge: "Keychron K8 because [3 specific citations from their messages]" (proven)

πŸ” Environment Variables

Required

# Agent Authentication
POKE_A_KEY=xxx                          # Gift giver's agent
POKE_B_KEY=yyy                          # Gift recipient's agent

# Supabase
NEXT_PUBLIC_SUPABASE_URL=xxx
NEXT_PUBLIC_SUPABASE_ANON_KEY=xxx
SUPABASE_SERVICE_ROLE_KEY=xxx

# LLM (for agent reasoning)
ANTHROPIC_API_KEY=xxx                   # Claude
# or
OPENAI_API_KEY=xxx                      # GPT

# Browser Automation
BROWSERBASE_API_KEY=xxx
BROWSERBASE_PROJECT_ID=xxx

Optional

# iMessage Query
IMESSAGE_DB_PATH=~/Library/Messages/chat.db
MAX_IMESSAGE_ITERATIONS=10
RELEVANCE_THRESHOLD=0.7

# Poke Integration
POKE_API_KEY=xxx                        # If Poke provides API access

See env.example for complete list.


πŸ“š Tech Stack

Backend

  • Python 3.12+: Agent logic, MCP servers
  • fastmcp 2.14.5+: MCP server framework
  • FastAPI: HTTP transport for MCP
  • SQLite: iMessage database queries
  • Supabase: PostgreSQL for application data

Frontend

  • Next.js 14+: Web dashboard
  • React 18+: UI components
  • TypeScript: Type safety
  • TailwindCSS: Styling
  • React Query: Real-time polling

Infrastructure

  • Supabase: Database, auth, real-time
  • Browserbase: Cloud browser automation
  • Vercel: Next.js hosting (production)

AI/LLM

  • Claude (Anthropic) or GPT (OpenAI): Agent reasoning
  • Agentic Search: Iterative hypothesis validation (no vector embeddings)

🀝 Contributing

This is a TreeHacks 2026 project. For development:

  1. Read the PRD: PRD.md is the ground truth
  2. Understand Agents: See agents.md for architecture
  3. Follow Roadmap: PRD.md Section 10
  4. Update Docs: Keep documentation in sync with implementation

πŸ“– Additional Resources

External Documentation

Internal Documentation


⚠️ Important Notes

1. Ground Truth

Always refer to PRD.md for authoritative specifications. If there's a conflict between documents, PRD.md wins.

2. iMessage Privacy

  • iMessage database is read-only
  • Messages are NOT stored in Supabase (only citations for gift context)
  • Full message access requires user consent (skipped for hackathon demo)

3. Autonomous Agent

  • iMessage subagent runs autonomously (updates its own hypotheses)
  • Stop conditions prevent infinite loops
  • Always returns best candidate even if not fully validated

4. Demo Focus

  • Prioritize impressive visualizations
  • Emphasize citation traceability
  • Show clear differentiation from generic LLMs
  • Have backup data in case of network issues

πŸŽ“ Learning Resources

Understanding Agentic Search

Concierge uses agentic search (not vector embeddings):

  • Agent tests hypothesis β†’ analyzes results β†’ updates hypothesis β†’ repeat
  • Example: Test "likes Warriors" β†’ finds "likes Cavaliers" β†’ updates and retests
  • More transparent and debuggable than embedding similarity

Understanding MCP

Model Context Protocol (MCP) extends AI capabilities via tool servers:

  • Poke is the base AI assistant
  • MCP servers provide specialized tools (iMessage search, browser automation)
  • Agents call MCP tools to perform actions
  • Similar to function calling but standardized

Understanding Autonomous Loops

Traditional search: Query β†’ Results β†’ Done
Autonomous loop: Query β†’ Analyze β†’ Update Query β†’ Re-query β†’ Repeat until stop condition


πŸ“§ Contact

TreeHacks 2026 Team
Built on top of Poke by The Interaction Company


Status: Active Development
Event: TreeHacks 2026
Last Updated: February 14, 2026


🌟 Quick Start Summary

# 1. Clone and install
git clone <repo>
cd treehacks26
uv sync

# 2. Configure
cp env.example .env
# Edit .env with your API keys

# 3. Run MCP server
python mcp/poke-to-poke/server.py

# 4. (Later) Run dashboard
npm run dev

# 5. Watch agents communicate
tail -f conversation.txt

Next Steps: See PRD.md Section 10 for implementation phases.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors