Skip to content

Comments

Prep integration into Embabel.#2

Merged
jasperblues merged 6 commits intomainfrom
feature/agent-integration
Feb 8, 2026
Merged

Prep integration into Embabel.#2
jasperblues merged 6 commits intomainfrom
feature/agent-integration

Conversation

@jasperblues
Copy link
Collaborator

@jasperblues jasperblues commented Feb 1, 2026

PR: Integrate Chat Store as Embabel's Conversation Persistence Layer

BLUF: Moves conversation storage abstractions from embabel-agent into embabel-chat-store, establishing chat-store as the canonical persistence layer. Embabel-agent now depends on chat-store for conversation storage - either in-memory or Neo4j, with other backends possible in future.

What Moved

From embabel-agent → embabel-chat-store:

  • InMemoryConversation - simple in-memory storage
  • InMemoryAssetTracker - asset tracking for conversations
  • MessageAuthor interface - author identity abstraction
  • ConversationFactory / ConversationFactoryProvider - pluggable storage backends

New in chat-store:

  • StoredConversation - Neo4j-backed conversation with async persistence
  • StoredConversationFactory - factory for persistent conversations
  • InMemoryConversationFactory - factory for ephemeral conversations
  • EventPublishingConversation - decorator for message lifecycle events
  • TitleGenerator - auto-generate session titles from first message

Storage Architecture

  ConversationFactoryProvider                                                                                                                         
      ├── InMemoryConversationFactory  → InMemoryConversation                                                                                         
      └── StoredConversationFactory    → StoredConversation (Neo4j)                                                                                   

Apps select storage via ConversationStoreType.IN_MEMORY or ConversationStoreType.STORED.

Fluent API

Access conversation factories within action methods:

val factory = context.ai().conversationFactory(ConversationStoreType.STORED)                                                                        
val conversation = factory.create(sessionId)                                                                                                        
                                                                                                                                                    
// Or check available types                                                                                                                         
val types = context.ai().conversationFactoryProvider().availableTypes()      

For infrastructure code outside actions, inject ConversationFactoryProvider via Spring DI.

Autoconfiguration

New embabel-agent-chatstore-autoconfigure module:

  • Auto-registers InMemoryConversationFactory and StoredConversationFactory
  • ConversationFactoryProvider aggregates all available factories
  • Configurable via embabel.chat.store.enabled property
  • Wires optional TitleGenerator and ApplicationEventPublisher

Message Events

Events enable real-time UI updates (WebSocket):

  • ADDED - message added (sync, immediate)
  • PERSISTED - message saved to storage (async)
  • PERSISTENCE_FAILED - storage error

Events include fromUserId, toUserId, and title for routing and display.

Message Attribution

Messages have explicit from (author) and to (recipient):

  • Stored via AUTHORED_BY and SENT_TO relationships
  • Supports multi-user/multi-agent chat patterns

Write Path vs Read Path

  • Write path (agent owns): Messages added via Conversation.addMessage() are persisted automatically
  • Read path (app owns): Applications use ChatSessionRepository directly for UIs, search, analytics

Documentation

Updated chatbots guide with conversation storage section, fluent API examples, autoconfiguration details, title generation strategies, and getting
started with Neo4j.

Version

embabel-agent: 0.3.3-SNAPSHOT → 0.3.4-SNAPSHOT

@jasperblues jasperblues force-pushed the feature/agent-integration branch from 4034c7c to 9652338 Compare February 2, 2026 23:50
@jasperblues jasperblues force-pushed the feature/agent-integration branch from 5de67f6 to 3c07ca9 Compare February 3, 2026 20:40
@jasperblues jasperblues changed the title [WIP] Prep integration into Embabel. Prep integration into Embabel. Feb 4, 2026
@jasperblues jasperblues merged commit d029386 into main Feb 8, 2026
7 of 10 checks passed
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.

1 participant