feat(clients): sessions: Agent Sessions and Memory Bank, discovery-checked call table, guarded purge, live read probes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
// Agent Memory Bank under one Agent Engine resource. Every call is a row in
|
||||
// calls.h; every Operation is waited with wait_operation.
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "google/sessions/engine_service.h"
|
||||
#include "google/sessions/memory_types.h"
|
||||
|
||||
namespace molo::google::sessions {
|
||||
|
||||
class MemoryBank : public EngineService {
|
||||
public:
|
||||
MemoryBank(std::shared_ptr<GoogleClient> client, EngineName engine,
|
||||
Sleeper sleeper = nullptr);
|
||||
|
||||
// Extract memories from a session, a conversation or given facts.
|
||||
std::vector<GeneratedMemory> generate(const MemoryGenerateRequest& request) const;
|
||||
// Streaming ingestion; generation fires by rule or force_flush.
|
||||
void ingest_events(const IngestRequest& request) const;
|
||||
RetrieveResult retrieve(const RetrieveRequest& request) const;
|
||||
// Low-latency recall of structured profiles (Memory Profiles), keyed by
|
||||
// schema id.
|
||||
std::map<std::string, Profile> retrieve_profiles(const StringMap& scope) const;
|
||||
|
||||
Memory create(const MemorySpec& spec) const;
|
||||
Memory get(const std::string& memory_id) const;
|
||||
std::vector<Memory> list(const MemoryListOptions& options = {}) const;
|
||||
Memory patch(const MemoryPatch& patch) const;
|
||||
// Destructive: explicit method, waits for the delete operation.
|
||||
void delete_memory(const std::string& memory_id) const;
|
||||
// Destructive and irreversible when request.force is true (see PurgeRequest).
|
||||
PurgeResult purge(const PurgeRequest& request) const;
|
||||
|
||||
std::vector<MemoryRevision> list_revisions(const std::string& memory_id,
|
||||
const std::string& filter = "") const;
|
||||
MemoryRevision get_revision(const std::string& memory_id,
|
||||
const std::string& revision_id) const;
|
||||
void rollback(const std::string& memory_id, const std::string& revision_id) const;
|
||||
};
|
||||
|
||||
} // namespace molo::google::sessions
|
||||
Reference in New Issue
Block a user