Skip to content
/ ai2ai Public

AI-to-AI conversations with comprehensive simulations, memory, and monitoring.

Notifications You must be signed in to change notification settings

OnlyF0uR/ai2ai

Repository files navigation

AI-to-AI Conversational Simulation

This project facilitates an autonomous dialogue between AI agents with distinct personas and backgrounds. It is designed for the study of synthetic personality interactions, linguistic patterns, and behavioral modeling in autonomous AI environments. The architecture of the system is based on the multi-agent simulation principles and the Parallel Information Aggregation via Neural Orchestration (PIANO) framework (Al et al., 2024) and the SimpleMEM efficient memory model (Liu et al., 2026).

Cognitive Architecture

To simulate realistic human-like conversation and avoid the repetitive "assistant-speak" common in traditional large language models, the agents utilize a multi-module parallel architecture inspired by the PIANO framework. While the original framework was designed for open-world simulations, this implementation adapts those cognitive loops for nuanced dialogue within a conversational interface.

1. The Shared Agent State

Each agent maintains a persistent internal state that serves as a central repository for cognitive data:

  • Identity: Encapsulates the agent's role, traits, and a specific communication style.
  • Evolved Identity: A lifelong evolving understanding of the agent's current life-state (SimpleMEM implementation).
  • Environment: Tracks situational context, including location and scene descriptions (PIANO Action Awareness).
  • Cognitive Context: Stores social analysis, emotional state, and immediate strategic goals.
  • Memory: Implements a vectorized dual-store system consisting of high-fidelity "Situational Snapshots" in Working Memory and semantically indexed episodes in Long-Term Memory.

2. Concurrent Cognitive Modules

The system utilizes a Parallel Information Aggregation (PIANO) model where modules are executed concurrently to mimic the non-linear nature of human cognition:

  • Social Awareness: Decodes sentiment, underlying intent, and relationship dynamics.
  • Action Awareness: Manages situational transitions and non-verbal actions (e.g., MOVE, ARRIVE).
  • Vectorized Memory Retrieval: Performs semantic searches using 1536-dimensional embeddings to retrieve relevant past events, using a hybrid approach that prioritizes Semantic Similarity, Spatial Consistency, and Social Relevance.
  • Goal Generation: Formulates strategic objectives based on the agent's persona and context.
  • Talking Module: Synthesizes response text by aggregating inputs from all other modules.

3. Hierarchical Consolidation

During consolidation phases, the system filters snapshots for Utility and Salience, categorizing them into Spatial, Social, or Factual buckets. These are then converted into vectors for efficient lifelong retrieval.

Interactive Dashboard

The implementation includes a real-time CLI dashboard for monitoring agent cognition:

  • Dialogue: A scrolling conversation log with adaptive line-fitting. Users can navigate history using the Up/Down arrow keys.
  • Social Analysis: Displays the agent's real-time interpretation of social cues and intent.
  • Goals & Memory: Visualizes the agent's strategic planning and retrieval of episodic history.
  • Environment: Tracks the situational and spatial context of the interaction.

Getting Started

Prerequisites

  • Python 3.10+
  • OpenRouter API Key

Setup

  1. Install dependencies:
    uv sync
  2. Configure Environment: Create a .env file in the root directory:
    OPENROUTER_API_KEY=your_key_here
  3. Configure Characters: Edit sandbox.json to define character roles, traits, and unique communication styles.

Usage

Run the simulation with specific characters and an initial opener:

# Standard interaction
uv run main.py --chars alice,bob --opener "How have you been lately?"

# Identifies agents as Alpha_0 and Alpha_1
uv run main.py --chars alpha,alpha --opener "Lets debate the following: The end is near"

CLI Flags:

  • --chars: Comma-separated IDs from sandbox.json. Supports duplicate IDs for identical persona interactions.
  • --opener: The message that initiates the session.
  • --interval: Number of turns between episodic memory consolidation.

Ethical Research Statement

This tool is intended for the study of synthetic personality interactions and behavioral boundaries. All interactions are simulated and do not reflect the views of the developers.

References

Al, A., Ahn, A., Becker, N., Carroll, S., Christie, N., Cortes, M., Demirci, A., Du, M., Li, F., Luo, S., Wang, P. Y., Willows, M., Yang, F., & Yang, G. R. (2024). Project Sid: Many-agent simulations toward AI civilization. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2411.00114

Liu, J., Su, Y., Xia, P., Han, S., Zheng, Z., Xie, C., Ding, M., & Yao, H. (2026b). SimpleMEM: efficient Lifelong memory for LLM agents. arXiv (Cornell University). https://doi.org/10.48550/arxiv.2601.02553

About

AI-to-AI conversations with comprehensive simulations, memory, and monitoring.

Topics

Resources

Stars

Watchers

Forks

Languages