facebookresearch / fairo

A modular embodied agent architecture and platform for building embodied agents
MIT License
843 stars 87 forks source link

Understand, document and clean up memory #351

Open kavyasrinet opened 3 years ago

kavyasrinet commented 3 years ago

Type of Issue

Select the type of issue:

Checklist

Use this checklist if you are using this issue as a tracker:

kavyasrinet commented 3 years ago

High level WIP doc: https://docs.google.com/document/d/1XBKaYrcYLsP2XwMFryKKGGcIgT4BA4HTq2G75ohUmmU/edit

Also refer to: https://docs.google.com/document/d/1LNbwt_FF-v6TQXRC2wCjMSrsnBnPQBCDAlvx3uy6B50/edit

Questions:

  1. memory API is spread across: memory_filters.py + (sq_memory.py + agent's memory.py) right ?
  2. what high_level purpose does memory_attribute serve ? From looking at it, looks like an abstraction (to perform one level complex stuff) on top of memory APIs ?
  3. memory_nodes is just all node types where each node is a class with certain attributes and functions - most of which are getters, but we also have create, update() and some attributes here are exposed. For example, name
  4. how about memory_values.py ? Also looks like memory APIs but not sure I understand this properly
  5. What do we get from exposing the TABLE, TABLE_COLUMNS and NODE_TYPE in MemoryNode ?
  6. We need to define the boundaries of SQL queries imo. Having raw sql queries in databse_access functions in memory makes sense, but some of these internal accessors are being called outside (https://github.com/facebookresearch/droidlet/blob/d96ec5b79014d44d01516fdff83ff0d32ce309ee/base_agent/loco_mc_agent.py#L319 , https://github.com/facebookresearch/droidlet/blob/cd30b44d0775695af15aa7209e7ab9a9e42b94f4/locobot/agent/loco_memory_nodes.py#L80 ) with raw SQL and in memory nodes.
  7. We expose TABLE and TABLE_COLUMNS and NODE_TYPE - what's the purpose?
  8. Right now we have both : memory.add_triple(subj=memid, pred_text="has_name", obj_text=mobtype) and memory.tag(memid, "VOXEL_OBJECT") Should we use one ?
  9. We should replace untag in memory with delete_triple
  10. An aside: we aren't quite using SetNode should we remove ?
  11. Why is dances a property of mc_memory ?
kavyasrinet commented 3 years ago

For visualization: We need a high level diagram for the current state of memory, the schema, the architecture, the base class and children We need two things:

high-level understanding, Something on low level details for each agent.

Pointers from Soumith: Example diagram from graphviz: #337 Generated with: https://gist.github.com/soumith/9c6a9a21e426423f55207d2d291c7f7a and the command neato -T png architecture.dot -o out.png