Skip to content

Conversation

@jasperblues
Copy link
Contributor

Extract Common Types for Chat-Store Integration

Summary

This PR introduces a new embabel-common-chat module containing storage-agnostic interfaces for chat/conversation persistence.
These common types enable both embabel-chat-store and embabel-agent to share a consistent contract without being directly coupled to each other.

Motivation

Previously, chat persistence types were tightly coupled to agent-specific abstractions (e.g., PromptContributor, Awaitable,
ActionContext). This made it difficult for embabel-chat-store to depend on conversation types without pulling in the entire
agent framework. By extracting minimal, persistence-focused interfaces into embabel-common, both modules can now share types through this common dependency.

Changes

New Module: embabel-common-chat
File: StorableConversation.kt
Description: Core interface for conversations with message management, slicing support, and persistence awareness
────────────────────────────────────────
File: StorableMessage.kt
Description: Minimal message interface with role, content, timestamp, and optional author/recipient
────────────────────────────────────────
File: MessageRole.kt
Description: Enum: USER, ASSISTANT, SYSTEM
────────────────────────────────────────
File: MessageAuthor.kt
Description: Interface for message author identity with id and displayName
────────────────────────────────────────
File: ConversationFactory.kt
Description: Factory interface for creating conversations, with ConversationStoreType enum (IN_MEMORY, STORED)
────────────────────────────────────────
File: ConversationFactoryProvider.kt
Description: Provider pattern for resolving factories by storage type
Simple Implementations Included:

  • SimpleStorableMessage - Data class implementation for basic use cases
  • SimpleMessageAuthor - Data class implementation for non-persistent scenarios
  • MapConversationFactoryProvider - Map-based provider implementation

Architecture

  embabel-common-chat (this PR)
          ↑                ↑
          |                |
  embabel-agent    embabel-chat-store

Both downstream modules implement these interfaces:

  • embabel-agent: Implements StorableConversation with rich agent context
  • embabel-chat-store: Implements persistent storage (e.g., Neo4j-backed conversations)

Copy link
Contributor

@igordayen igordayen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good approach

* conversation.addMessageFrom(message, author)
* ```
*/
interface MessageAuthor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is relationship between MessageAuther and "User" from com.embabel.agent.api.identity

@igordayen igordayen requested a review from alexheifetz February 5, 2026 04:33
Copy link
Collaborator

@alexheifetz alexheifetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good. Tnx!!

@alexheifetz alexheifetz merged commit 6e49da8 into main Feb 5, 2026
3 checks passed
@alexheifetz alexheifetz deleted the feature/chat-store-integration branch February 5, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants