flutter_agentic_memory 0.2.0 copy "flutter_agentic_memory: ^0.2.0" to clipboard
flutter_agentic_memory: ^0.2.0 copied to clipboard

Semantic memory for Flutter AI agents — embeddings, on-device vector search, and long-term recall that plugs into flutter_agentic.

example/main.dart

// Example: an agent with semantic long-term memory.
// ignore_for_file: avoid_print
import 'package:flutter_agentic/flutter_agentic.dart';
import 'package:flutter_agentic_memory/flutter_agentic_memory.dart';

Future<void> main() async {
  final memory = SemanticMemory(
    embedder: GeminiEmbeddingProvider(apiKey: 'YOUR_GEMINI_API_KEY'),
    vectors: InMemoryVectorStore(), // or: await HiveVectorStore.open('mem')
  );

  final agent = AgenticAgent(
    provider: GeminiProvider(apiKey: 'YOUR_GEMINI_API_KEY'),
    memory: memory,
    sessionId: 'user_42',
  );

  await agent.chat('Remember: I am vegetarian and I live in Mumbai.');
  await agent.chat('I mostly code Flutter apps on weekends.');

  // Later — recall by meaning, not keywords:
  final recalled = await memory.recall('user_42', 'dinner suggestions?');
  for (final r in recalled) {
    print('${r.score.toStringAsFixed(2)}  ${r.message.content}');
  }

  // Build a prompt window: recent tail + relevant older messages.
  final context = await memory.buildContext(
    'user_42',
    'what should I eat tonight?',
  );
  print('Context window: ${context.length} messages');
}
1
likes
160
points
196
downloads

Documentation

API reference

Publisher

verified publisherinlayad.com

Weekly Downloads

Semantic memory for Flutter AI agents — embeddings, on-device vector search, and long-term recall that plugs into flutter_agentic.

Repository (GitHub)
View/report issues

Topics

#flutter #ai #memory #embeddings #vector-search

License

MIT (license)

Dependencies

flutter, flutter_agentic, hive, hive_flutter, http

More

Packages that depend on flutter_agentic_memory