GitHub
Examples

Functor SDK Examples

Short, focused 'Guide for Dummies' examples demonstrating each capability of the Functor SDK.

Start Here

These examples follow the story of Emma (User ID: emma_2024) and her Personal AI Companion. While you can run the Python scripts directly from the functor_examples directory, these pages explain the concepts behind the code.

The Scenario

We simulate a Personal AI Companion for a user named Emma. The data spans 3 weeks of interactions, allowing us to demonstrate temporal memory, knowledge evolution, and long-term recall.

  • Week 1 (Onboarding): Emma introduces herself, her new job as a PM, and her initial stress.
  • Week 2 (Conflict & Growth): Work challenges with "ProjectX", family health scare (Nana Rose), and starting a running tracking habit.
  • Week 3 (Resolution): Project success, family recovery, and reflecting on progress.

Data Structure

The examples utilize a structured JSON dataset (companion_conversations.json) that mimics real-world application state.

{
  "user_profile": {
    "user_id": "emma_2024",
    "name": "Emma",
    "timezone": "America/New_York"
  },
  "conversations": [
    {
      "session_id": "session_week1_day1",
      "date": "2024-11-04",
      "messages": [
        { "role": "user", "content": "I just started a new job..." }
      ],
      "extracted_facts": [
        { "type": "job", "value": "Product Manager" }
      ]
    }
  ]
}

Example Modules