ServiceSpace

Circle Agent

A graph database and agentic AI system for weaving wisdom-based Metta Circles from the living network of pod relationships.

What Are Pods?

Pods are peer-learning virtual circles—typically 7 to 30 days—where participants engage through posts, comments, hearts, and other interactions. Over time, ServiceSpace has run many pods: interfaith challenges, compassion practices, Gandhi study circles, and more. Some people participate in multiple pods across months or years, creating a rich web of relationships and shared learning.

The Opportunity

After a pod ends, we often want to create smaller "Metta Circles" of 4–6 people for continued connection. But how do we form these circles wisely? Currently, it's manual—facilitators do their best based on memory and intuition.

What if we could form circles based on resonance (deep mutual engagement), edge (respectful differing perspectives), serendipity (surprising cross-pod connections), or shared history (alumni of many pods together)? This requires understanding relationships at a scale beyond human memory.

Why a Graph Database?

Traditional databases store data in tables with rows and columns. They're excellent for many things, but relationships between entities require complex "joins" that become slow and unwieldy. Graph databases store relationships as first-class citizens. Instead of asking "find all comments where user_id = 123 and post_author_id = 456," you simply traverse: Person → COMMENTED_ON → Post ← AUTHORED ← Person.

This makes questions like "who are the bridge people connecting the Gandhi pod community to the Rumi pod community?" not just possible, but fast.

Why Agentic AI?

Building and querying a graph database requires technical skill—writing Cypher queries, understanding graph traversal, interpreting results. Agentic AI acts as an intelligent intermediary: for building, agents can analyze our existing database and execute the migration; for circle formation, agents can translate natural requests into graph queries and balanced groupings; and for exploration, facilitators can ask questions in plain English and get meaningful answers.

Five Modes of Weaving

The Circle Agent supports multiple approaches to forming Metta Circles. Facilitators can request single modes or combinations.

Resonance

High mutual engagement, similar themes. People who deeply connected with each other's reflections.

dense connections, shared theme nodes

Edge

Respectful disagreement, diverse perspectives. Engagement across difference.

engagement despite theme divergence

Serendipity

Surprising commonalities across pods that no one noticed. Non-obvious connections.

non-obvious paths, graph distance > 2

Alumni

Shared pod history—people who've done 5+ pods together but haven't reconnected.

multiple shared participations

Bridge

People who connect otherwise separate pod communities. Cross-cluster connectors.

connections to multiple clusters

Architecture

┌─────────────────────────────────────────────────────────────────────┐
                      C I R C L E   A G E N T                         
├─────────────────────────────────────────────────────────────────────┤
                                                                     
   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐          
   │   Pod App   │────▶│   AWS SQS   │────▶│   Lambda    │          
   │ (Frontend)  │     │  (Queue)    │     │ (Processor) │          
   └─────────────┘     └─────────────┘     └─────────────┘          


   ┌─────────────┐     ┌─────────────┐     ┌─────────────┐          
   │  Agno       │────▶│ MCP Server  │────▶│   Neo4j     │          
   │  (Agents)   │     │  (Tools)    │     │  (Graph DB) │          
   └─────────────┘     └─────────────┘     └─────────────┘          
         │                                        ▲                  
┌─────────────┐
         └─────────────▶│  Claude API │───────────┘                  
                        │  (Reasoning)│                              
                        └─────────────┘                              
                                                                     
└─────────────────────────────────────────────────────────────────────┘
Component Purpose
Neo4j Self-hosted graph database storing people, pods, posts, and all their relationships
AWS SQS Message queue that buffers interaction events from the pod application
Lambda Serverless functions that process events and update the graph
Agno Open-source framework for building AI agents with tools and workflows
MCP Server Exposes graph operations as tools that agents can invoke
Claude API Provides reasoning capabilities for agents

Six Phases

Infrastructure Setup

Get the foundational systems running.

  • 1.1 Deploy EC2 instance (t3.large or r6g.medium recommended for Neo4j's memory needs)
  • 1.2 Install and configure Neo4j Community Edition (self-hosted)
  • 1.3 Set up security groups, SSL, and backup routines
  • 1.4 Install Agno framework for agent orchestration
  • 1.5 Deploy MCP server with initial toolset
  • 1.6 Configure AWS SQS queue for event ingestion
Empty but operational graph database with agent infrastructure ready.

Ontology Design

Define how pod data becomes a graph—what are the nodes, what are the relationships?

  • 2.1 Agent analyzes existing MySQL schema (tables, columns, foreign keys) Schema Analyzer Agent
  • 2.2 Agent examines common query patterns in existing PHP code Agent-Assisted
  • 2.3 Agent proposes initial ontology: node types, relationship types, properties Agent-Assisted
  • 2.4 Human review with pod facilitators—what relationships matter for circle formation?
  • 2.5 Refine ontology based on feedback
  • 2.6 Document final ontology with examples

Key principle: Columns typically become node properties; foreign key joins typically become relationships. But the agent helps surface non-obvious patterns and the humans ensure the model reflects pod wisdom, not just database structure.

Documented graph ontology ready for migration.

Data Migration

Populate the graph database with historical pod data.

  • 3.1 Agent generates Cypher CREATE statements based on approved ontology Migration Agent
  • 3.2 Agent executes migration in batches, starting with a pilot pod Agent-Assisted
  • 3.3 Agent validates record counts and relationship integrity Agent-Assisted
  • 3.4 Agent computes derived relationships (resonance scores, engagement patterns) Agent-Assisted
  • 3.5 Agent surfaces anomalies or edge cases for human review Agent-Assisted
  • 3.6 Expand to full historical migration after pilot validation
Graph database populated with historical pod data and computed relationships.

Real-Time Event Pipeline

Keep the graph current as new interactions happen in pods.

  • 4.1 Modify pod frontend to emit events (post created, comment added, heart given) to SQS
  • 4.2 Build Lambda function to process events and execute Cypher updates
  • 4.3 Implement periodic job to recompute derived relationships (resonance, etc.)
  • 4.4 Add monitoring and alerting for pipeline health
  • 4.5 Test with live pod, validate graph stays in sync
Graph database updates automatically as pod activity happens.

Circle Agent Core

Build the intelligent agent that forms Metta Circles.

  • 5.1 Define MCP tools for graph operations (query, compute resonance, propose circle)
  • 5.2 Build Circle Agent with formation modes: resonance, edge, serendipity, alumni, bridge
  • 5.3 Implement scoring algorithms for each mode
  • 5.4 Create human-in-the-loop workflow: agent proposes, facilitator approves or adjusts
  • 5.5 Test with facilitators using historical data
  • 5.6 Refine based on feedback
Working Circle Agent that facilitators can use to form wisdom-based circles.
Example Interaction
Facilitator
"Create 3 metta circles from the Interfaith Compassion Pod alumni who haven't connected in 6 months. Mix resonance and edge."
Circle Agent
1. Queries alumni of Interfaith Compassion Pods (2023, 2024)
2. Filters to those inactive in shared circles for 6+ months
3. Computes pairwise resonance and edge scores
4. Forms balanced circles of 5, each with resonance AND edge
5. Presents proposals with rationale for each grouping

Query Interface

Enable exploration of the graph by non-technical facilitators.

  • 6.1 Build natural language query interface using Claude
  • 6.2 Create library of common questions with example responses
  • 6.3 Add direct Cypher access for technical team (secured)
  • 6.4 Build simple dashboard for graph health and statistics

Example queries: "Who are the bridge people between the Gandhi pod and the Rumi pod?" · "Show me people who engaged deeply but have never been in a circle together" · "What themes resonated most in last month's pods?"

Facilitators can explore and understand community patterns through conversation.

What Makes This "Agentic"?

Traditional automation follows rigid rules. Agentic AI brings judgment.

01

Understanding intent. "Mix resonance and edge" requires interpreting what balance means, not just running two queries.

02

Handling ambiguity. When there aren't enough people for perfect circles, the agent makes tradeoffs and explains them.

03

Learning patterns. Over time, agents can notice what circle compositions lead to sustained engagement.

04

Natural interaction. Facilitators describe what they want in human terms, not query syntax.

The agent has tools (graph queries, scoring functions) but decides how to use them based on the request. It proposes; humans decide.

For Refinement

Circle Agent transforms scattered pod interaction data into a living map of community relationships. By combining graph technology with agentic AI, we can form Metta Circles based on genuine patterns of connection—not guesswork.

Technology serves the deeper intention:
Agents propose. Humans decide. Community deepens.