Skip to content

(feat) Agent persistence with message history#38

Merged
rrr63 merged 1 commit intodoppar:1.xfrom
rrr63:store-datas
Feb 25, 2026
Merged

(feat) Agent persistence with message history#38
rrr63 merged 1 commit intodoppar:1.xfrom
rrr63:store-datas

Conversation

@rrr63
Copy link
Copy Markdown
Member

@rrr63 rrr63 commented Feb 24, 2026

  1. StoreInterface
  • Contract for storage implementations
  • Methods: store(), load(), has(), delete(), clear()
  • Allows custom implementations (database, Redis, sessions, etc.)
  1. CacheStore -> First integration, to show how it works, indeed each user will make custom depending where they want to save
  • File-based serialized storage
  • Configurable path (default: ./doppar_ai_store)
  • MD5-based filename generation
  1. Agent Integration
  • withStore(StoreInterface $store, ?string $key = null) - configure store
  • store(string $key, mixed $response = null) - save messages + optional response
  • loadMessages(string $key) - restore full history
  • assistant(string $content) - add assistant role messages
$store = new CacheStore("./storage/doppar_ai_store");

// Set store in agent object
$agent->withStore($store);

// Save conversation
$res = $agent->send();
$agent->store('conversation-1', $res);

// Load and continue
$agent->loadMessages('conversation-1')
    ->prompt('Next question')
    ->send();

@rrr63 rrr63 requested a review from techmahedy February 24, 2026 13:39
@techmahedy
Copy link
Copy Markdown
Member

@rrr63 great, very good job. Very important feature

Copy link
Copy Markdown
Member

@techmahedy techmahedy left a comment

Choose a reason for hiding this comment

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

Nice to have this @rrr63 good job

@rrr63 rrr63 merged commit daead52 into doppar:1.x Feb 25, 2026
5 checks passed
@techmahedy
Copy link
Copy Markdown
Member

Thanks @rrr63

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.

2 participants